blob: 1ef5ad3b1cca28d13aaa033e657c99aaf1ef46c5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
%token STEP HEADER ENDSEC DATA ENDSTEP SCOPE ENDSCOPE ENTITY TYPE INTEGER FLOAT IDENT TEXT NONDEF ENUM HEXA QUID
%start stepf
%{
#include "recfile.ph" /* definitions des types d'arguments */
#include "recfile.pc" /* la-dedans, tout y est */
/*
#define stepparse STEPparse
#define steplex STEPlex
#define stepwrap STEPwrap
#define steprestart STEPrestart
#define steplex STEPlex
#define steplval STEPlval
#define stepval STEPval
#define stepchar STEPchar
#define stepdebug STEPdebug
#define stepnerrs STEPnerrs
#define steperror STEPerror
*/
#define stepclearin yychar = -1
#define steperrok yyerrflag = 0
/*
#define stepin STEPin
#define yyerrflag STEPerrflag
#define yyerrstatus STEPerrflag
*/
/* ABV 19.12.00: merging porting modifications by POP (for WNT, AIX) */
#if defined(WNT) && !defined(MSDOS)
#define MSDOS WNT
#endif
#if defined(_AIX)
#include <malloc.h>
#define alloca malloc
#endif
%}
%%
/* N.B. : les commentaires sont filtres par LEX */
/* La fin vide (selon systeme emetteur) est filtree ici */
finvide : ' '
| finvide ' ' ;
finstep : ENDSTEP
| ENDSTEP finvide ;
stepf1 : STEP HEADER headl ENDSEC endhead model ENDSEC finstep ;
stepf2 : STEP HEADER ENDSEC endhead model ENDSEC ENDSTEP ;
stepf3 : STEP HEADER ENDSEC endhead model error ;
stepf : stepf1 | stepf2 | stepf3
{ rec_finfile(); return(0); /* fini pour celui-la */ }
;
headl : headent
| headl headent
;
headent : enttype listarg ';'
| error /* Erreur sur Entite : la sauter */
;
endhead : DATA
{ rec_finhead(); }
;
unarg : IDENT { rec_typarg(rec_argIdent); rec_newarg(); }
| QUID { /* deja fait par lex*/ rec_newarg(); }
| listarg /* rec_newent lors du ')' */ { rec_newarg(); }
| listype listarg /* liste typee */ { rec_newarg(); }
| error { rec_typarg(rec_argMisc); rec_newarg();
yyerrstatus = 1; yyclearin; }
/* Erreur sur Parametre : tacher de le noter sans jeter l'Entite */
;
listype : TYPE
{ rec_listype(); }
;
deblist : '('
{ rec_deblist(); }
;
finlist : ')'
{ if (modeprint > 0)
{ printf("Record no : %d -- ",nbrec+1); rec_print(currec); }
rec_newent (); yyerrstatus = 0; }
;
listarg : deblist finlist /* liste vide (peut y en avoir) */
| deblist arglist finlist /* liste normale, non vide */
| deblist error
;
arglist : unarg
| arglist ',' unarg
| arglist error
;
model : bloc
| model bloc
;
bloc : entlab '=' unent ';'
| entlab '=' debscop model finscop unent ';'
| entlab '=' debscop finscop unent ';'
| error /* Erreur sur Entite : la sauter */
;
plex : enttype listarg
| plex enttype listarg /* sert a ce qui suit : */
;
unent : enttype listarg /* Entite de Type Simple */
| '(' plex ')' /* Entite de Type Complexe */
;
debscop : SCOPE
{ scope_debut(); }
;
unid : IDENT
{ rec_typarg(rec_argIdent); rec_newarg(); }
;
export : unid
| export ',' unid
;
debexp : '/'
{ rec_deblist(); }
;
finscop : ENDSCOPE
{ scope_fin(); }
| ENDSCOPE debexp export '/'
{ printf("*** Warning : Export List not yet processed\n");
rec_newent(); scope_fin() ; }
/* La liste Export est prise comme ARGUMENT du EndScope */
;
entlab : ENTITY
{ rec_ident(); }
;
enttype : TYPE
{ rec_type (); }
;
|