source: applications/trunk/LFC/parser/samples.g @ 3810

Last change on this file since 3810 was 3810, checked in by orlov, 13 years ago
  • Parser for LFC grammars.
  • Property svn:eol-style set to native
File size: 7.3 KB
Line 
1[bProgram]-><bStmts>
2
3[bStmts]->~
4[bStmts]-><bStmt>
5[bStmts]-><bStmt><bStmts>
6
7[bStmt]-><bLabel><bPrintStmt>
8[bStmt]-><bLabel><bAssignmentStmt>
9[bStmt]-><bLabel><bInputStmt>
10[bStmt]-><bLabel><bReadStmt>
11[bStmt]-><bLabel><bDataStmt>
12[bStmt]-><bLabel><bRestoreStmt>
13[bStmt]-><bLabel><bEndStmt>
14[bStmt]-><bLabel><bRemStmt>
15[bStmt]-><bLabel><bGotoStmt>
16[bStmt]-><bLabel><bStopStmt>
17[bStmt]-><bLabel><bIfStmt>
18[bStmt]-><bLabel><bOnGotoStmt>
19[bStmt]-><bLabel><bForStmt>
20[bStmt]-><bLabel><bNextStmt>
21[bStmt]-><bLabel><bDimStmt>
22[bStmt]-><bLabel><bDeffnStmt>
23[bStmt]-><bLabel><bGosubStmt>
24[bStmt]-><bLabel><bReturnStmt>
25[bStmt]-><bLabel><bOnGosubStmt>
26[bStmt]-><bLabel><bStmtCores>
27
28
29[bPrintStmt]->PRINT
30[bPrintStmt]->PRINT<bPrintItems>
31
32
33[bAssignmentStmt]->LET<bNumVar>=<bNumExpr>
34[bAssignmentStmt]->LET<bStrVar>=<bStrExpr>
35[bAssignmentStmt]-><bNumVar>=<bNumExpr>
36[bAssignmentStmt]-><bStrVar>=<bStrExpr>
37
38[bInputStmt]->INPUT<bVarList>
39[bInputStmt]->INPUT<bString>;<bVarList>
40
41[bReadStmt]->READ<bVarList>
42
43[bDataStmt]->DATA<bConstList>
44
45<bRestoreStmt>->RESTORE
46
47<bEndStmt>->END
48
49[bRemStmt]->REM<bStringElems>
50
51[bGotoStmt]->GOTO<bLabel>
52
53<bStopStmt>->STOP
54
55[bIfStmt]->IF<bLogExpr>THEN<bLabel>
56[bIfStmt]->IF<bLogExpr>GOTO<bLabel>
57[bIfStmt]->IF<bLogExpr>THEN<bStmtCores>
58[bIfStmt]->IF<bLogExpr>THEN<bStmtCore>ELSE<bStmtCore>
59
60[bOnGotoStmt]->ON<bNumExpr>GOTO<bLabelList>
61
62[bForStmt]->FOR<bNumVar>=<bNumExpr>TO<bNumExpr>
63[bForStmt]->FOR<bNumVar>=<bNumExpr>TO<bNumExpr>STEP<bNumExpr>
64
65[bNextStmt]->NEXT
66[bNextStmt]->NEXT<bNumVar>
67
68[bDimStmt]->DIM<bDimList>
69
70[bDeffnStmt]-><DEF><FN><bId>(<bId>)=<bNumExpr>
71
72[bGosubStmt]->GOSUB<bLabel>
73
74<bReturnStmt>->RETURN
75
76[bOnGosubStmt]->ON<bNumExpr>GOSUB<bLabelList>
77
78[bStmtCores]-><bStmtCore>
79[bStmtCores]-><bStmtCore>:<bStmtCores>
80
81
82<bPrintItems>-><bPrintItem>
83<bPrintItems>-><bPrintItem>,
84<bPrintItems>-><bPrintItem>;
85<bPrintItems>-><bPrintItem>,<bPrintItems>
86<bPrintItems>-><bPrintItem>;<bPrintItems>
87
88<bPrintItem>-><bNumExpr>
89<bPrintItem>-><bStrExpr>
90<bPrintItem>-><bPrintFuncCall>
91
92<bPrintFuncCall>->TAB(<bNumExpr>)
93
94
95<bNumVar>-><bIntVar>
96<bNumVar>-><bRealVar>
97
98<bIntVar>-><bId>%
99<bIntVar>-><bId>%(<bIndexList>)
100
101<bRealVar>-><bId>
102<bRealVar>-><bId>(<bIndexList>)
103
104<bId>-><alpha>
105<bId>-><bId><alpha>
106<bId>-><bId><digit>
107
108<bIndexList>-><bIndex>
109<bIndexList>-><bIndex>,<bIndexList>
110
111<bIndex>-><bNumExpr>
112
113<bNumExpr>-><sign><bNumTerm>
114<bNumExpr>-><bNumExpr><bAddOp><bNumTerm>
115
116<bNumTerm>-><bNumFactor>
117<bNumTerm>-><bNumTerm><bMulOp><bNumFactor>
118
119<bNumFactor>-><bNumPrimExpr>
120<bNumFactor>-><bNumFactor>^<bNumPrimExpr>
121
122<bNumPrimExpr>-><bNumConst>
123<bNumPrimExpr>->(<bNumExpr>)
124<bNumPrimExpr>-><bNumFuncCall>
125<bNumPrimExpr>-><bNumVar>
126
127<bNumFuncCall>->SIN(<bNumExpr>)
128<bNumFuncCall>->COS(<bNumExpr>)
129<bNumFuncCall>->TAN(<bNumExpr>)
130<bNumFuncCall>->ATN(<bNumExpr>)
131<bNumFuncCall>->INT(<bNumExpr>)
132<bNumFuncCall>->LOG(<bNumExpr>)
133<bNumFuncCall>->EXP(<bNumExpr>)
134<bNumFuncCall>->SQR(<bNumExpr>)
135<bNumFuncCall>->ABS(<bNumExpr>)
136<bNumFuncCall>->SGN(<bNumExpr>)
137<bNumFuncCall>->RND(<bNumExpr>)
138<bNumFuncCall>->LEN(<bStrExpr>)
139<bNumFuncCall>->VAL(<bStrExpr>)
140<bNumFuncCall>->ASC(<bStrExpr>)
141<bNumFuncCall>->FN<bId>(<bNumExpr>)
142
143<bAddOp>->+
144<bAddOp>->-
145
146<bMulOp>->*
147<bMulOp>->/
148
149<sign>->+
150<sign>->-
151<sign>->~
152
153<bNumConst>-><sReal>
154
155<sReal>-><sign><real>
156
157<real>-><int>
158<real>-><int>.<digits>
159<real>-><int><exponent>
160<real>-><int>.<digits><exponent>
161
162<int>-><digit>
163<int>-><int><digit>
164
165<digits>-><digit>
166<digits>-><digits><digit>
167
168<exponent>->E<sign><int>
169
170
171<bStrVar>-><bId>$
172<bStrVar>-><bId>$(<bIndexList>)
173
174<bStrExpr>-><bStrExpr>+<bStrTerm>
175<bStrExpr>-><bStrTerm>
176
177<bStrTerm>-><bStrFactor>
178
179<bStrFactor>-><bStrConst>
180<bStrFactor>->(<bStrExpr>)
181<bStrFactor>-><bStrFuncCall>
182<bStrFactor>-><bStrVar>
183
184<bStrConst>-><bString>
185
186<bStrFuncCall>->LEFT$(<bStrExpr>,<bNumExpr>)
187<bStrFuncCall>->MID$(<bStrExpr>,<bNumExpr>,<bNumExpr>)
188<bStrFuncCall>->RIGHT$(<bStrExpr>,<bNumExpr>)
189<bStrFuncCall>->STR$(<bNumExpr>)
190<bStrFuncCall>->CHR$(<bNumExpr>)
191
192<bString>->"<bStringElems>"
193
194<bStringElems>-><bStringElem>
195<bStringElems>-><bStringElems><bStringElem>
196
197<bStringElem>-><alpha>
198<bStringElem>-><digit>
199<bStringElem>-><specialAlpha>
200<bStringElem>-><space>
201
202<bVarList>-><bVar>
203<bVarList>-><bVar>,<bVarList>
204
205<bVar>-><bIntVar>
206<bVar>-><bRealVar>
207<bVar>-><bStrVar>
208
209<bConstList>-><bConst>
210<bConstList>-><bConst>,<bConstList>
211
212<bConst>-><bNumConst>
213<bConst>-><bStrConst>
214
215<bLabel>-><int>
216
217[bLogExpr]-><bLogExpr>OR<bLogTerm>
218[bLogExpr]-><bLogTerm>
219
220[bLogTerm]-><bLogTerm>AND<bLogFactor>
221[bLogTerm]-><bLogFactor>
222
223[bLogFactor]-><bNumExpr><bRelOp><bNumExpr>
224[bLogFactor]-><bStrExpr><bRelOp><bStrExpr>
225[bLogFactor]->(<bLogExpr>)
226[bLogFactor]->NOT(<bLogExpr>)
227
228<bRelOp>->=
229<bRelOp>->\<
230<bRelOp>->\>
231<bRelOp>->\<\>
232<bRelOp>->\<=
233<bRelOp>->\>=
234
235[bStmtCore]-><bPrintStmt>
236[bStmtCore]-><bAssignmentStmt>
237[bStmtCore]-><bGotoStmt>
238[bStmtCore]-><bGosubStmt>
239[bStmtCore]-><bForStmt>
240[bStmtCore]-><bNextStmt>
241[bStmtCore]-><bInputStmt>
242[bStmtCore]-><bReadStmt>
243[bStmtCore]-><bDataStmt>
244[bStmtCore]-><bEndStmt>
245[bStmtCore]-><bStopStmt>
246[bStmtCore]-><bRestoreStmt>
247[bStmtCore]-><bOnGotoStmt>
248[bStmtCore]-><bDimStmt>
249[bStmtCore]-><bDeffnStmt>
250[bStmtCore]-><bReturnStmt>
251[bStmtCore]-><bOnGosubStmt>
252
253<bLabelList>-><bLabel>
254<bLabelList>-><bLabel>,<bLabelList>
255
256<bDimList>-><bDimItem>
257<bDimList>-><bDimItem>,<bDimList>
258
259<bDimItem>-><bId>(<bIndexList>)
260<bDimItem>-><bId>%(<bIndexList>)
261<bDimItem>-><bId>$(<bIndexList>)
262
263
264<DEF>->DEF
265
266<FN>->FN
267
268<space>->_
269
270<specialAlpha>->+
271<specialAlpha>->-
272<specialAlpha>->*
273<specialAlpha>->/
274<specialAlpha>->=
275<specialAlpha>->\<
276<specialAlpha>->\>
277<specialAlpha>->\[
278<specialAlpha>->\]
279<specialAlpha>->.
280<specialAlpha>->,
281<specialAlpha>->:
282<specialAlpha>->;
283<specialAlpha>->!
284<specialAlpha>->^
285<specialAlpha>->(
286<specialAlpha>->)
287<specialAlpha>->\<\>
288<specialAlpha>->\<=
289<specialAlpha>->\>=
290<specialAlpha>->$
291
292
293<alpha>-><lowerAlpha>
294<alpha>-><upperAlpha>
295
296<upperAlpha>->A
297<upperAlpha>->B
298<upperAlpha>->C
299<upperAlpha>->D
300<upperAlpha>->E
301<upperAlpha>->F
302<upperAlpha>->G
303<upperAlpha>->H
304<upperAlpha>->I
305<upperAlpha>->J
306<upperAlpha>->K
307<upperAlpha>->L
308<upperAlpha>->M
309<upperAlpha>->N
310<upperAlpha>->O
311<upperAlpha>->P
312<upperAlpha>->Q
313<upperAlpha>->R
314<upperAlpha>->S
315<upperAlpha>->T
316<upperAlpha>->U
317<upperAlpha>->V
318<upperAlpha>->W
319<upperAlpha>->X
320<upperAlpha>->Y
321<upperAlpha>->Z
322<lowerAlpha>->a
323<lowerAlpha>->b
324<lowerAlpha>->c
325<lowerAlpha>->d
326<lowerAlpha>->e
327<lowerAlpha>->f
328<lowerAlpha>->g
329<lowerAlpha>->h
330<lowerAlpha>->i
331<lowerAlpha>->j
332<lowerAlpha>->k
333<lowerAlpha>->l
334<lowerAlpha>->m
335<lowerAlpha>->n
336<lowerAlpha>->o
337<lowerAlpha>->p
338<lowerAlpha>->q
339<lowerAlpha>->r
340<lowerAlpha>->s
341<lowerAlpha>->t
342<lowerAlpha>->u
343<lowerAlpha>->v
344<lowerAlpha>->w
345<lowerAlpha>->x
346<lowerAlpha>->y
347<lowerAlpha>->z
348
349<digit>->0
350<digit>->1
351<digit>->2
352<digit>->3
353<digit>->4
354<digit>->5
355<digit>->6
356<digit>->7
357<digit>->8
358<digit>->9
359
360<interLanguage>-><S><cProgram><S><smplVarDeclList><S><arrayVarDeclList><S><dataList><S><refLabelList><S><deffnList><S>
361
362<smplVarDeclList>->~
363<smplVarDeclList>-><bSmplVar>
364<smplVarDeclList>-><bSmplVar>,<smplVarDeclList>
365
366<bSmplVar>-><bId>
367<bSmplVar>-><bId>%
368<bSmplVar>-><bId>$
369
370<arrayVarDeclList>->~
371<arrayVarDeclList>-><bArrayVar>
372<arrayVarDeclList>-><bArrayVar>,<arrayVarDeclList>
373
374<bArrayVar>-><bId>(<bIndexList>)
375<bArrayVar>-><bId>%(<bIndexList>)
376<bArrayVar>-><bId>$(<bIndexList>)
377
378<dataList>->~
379<dataList>-><bConst>
380<dataList>-><bConst>,<dataList>
381
382<refLabelList>->~
383<refLabelList>-><bLabel>
384<refLabelList>-><bLabel>,<refLabelList>
385
386<deffnList>-><String>|~
387
388<S>->\011
389
390<cProgram>-><String>|~
Note: See TracBrowser for help on using the repository browser.