-
Notifications
You must be signed in to change notification settings - Fork 0
/
in.ptab
69 lines (68 loc) · 8.06 KB
/
in.ptab
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
METHOD_BODY
EXPRESSION{
EXPRESSION)K
EXPRESSION("("
EXPRESSION")"TERM'"SIMPLE_EXPRESSION'"EXPRESSION'
EXPRESSIONif
EXPRESSIONelse
EXPRESSIONfloat
EXPRESSIONint
EXPRESSION$
EXPRESSIONrelop
EXPRESSIONaddop@
EXPRESSIONnum"num"TERM'"SIMPLE_EXPRESSION'"EXPRESSION';
EXPRESSION+"+"TERM"SIMPLE_EXPRESSION'"EXPRESSION'
EXPRESSIONassign
EXPRESSION};
EXPRESSION-"-"TERM"SIMPLE_EXPRESSION'"EXPRESSION'
EXPRESSIONmulop
EXPRESSION;
EXPRESSIONwhile>
EXPRESSIONid"id"TERM'"SIMPLE_EXPRESSION'"EXPRESSION' ELSE{ ELSE) ELSE(ELSEif"\EPS%ELSEelse"else"{" STATEMENT"}ELSEfloat"\EPSELSEint"\EPSELSE$"\EPS ELSErelop ELSEaddop ELSEnum ELSE+ ELSEassignELSE}"\EPS ELSE- ELSEmulop ELSE;ELSEwhile"\EPSELSEid"\EPS TERM'{TERM')"\EPS TERM'( TERM'if TERM'else TERM'float TERM'int TERM'$TERM'relop"\EPSTERM'addop"\EPS TERM'num TERM'+ TERM'assign TERM'} TERM'-&TERM'mulop"mulop"FACTOR"TERM'TERM';"\EPS TERM'while TERM'id STATEMENT_LIST'{ STATEMENT_LIST') STATEMENT_LIST'(3STATEMENT_LIST'if" STATEMENT"STATEMENT_LIST' STATEMENT_LIST'else6STATEMENT_LIST'float" STATEMENT"STATEMENT_LIST'4STATEMENT_LIST'int" STATEMENT"STATEMENT_LIST'STATEMENT_LIST'$"\EPS STATEMENT_LIST'relop STATEMENT_LIST'addop STATEMENT_LIST'num STATEMENT_LIST'+ STATEMENT_LIST'assign STATEMENT_LIST'} STATEMENT_LIST'- STATEMENT_LIST'mulop STATEMENT_LIST';6STATEMENT_LIST'while" STATEMENT"STATEMENT_LIST'3STATEMENT_LIST'id" STATEMENT"STATEMENT_LIST' SIGN{ SIGN)SIGN( SIGNif SIGNelse SIGNfloat SIGNint SIGN$ SIGNrelop SIGNaddopSIGNnumSIGN+"+ SIGNassign SIGN}SIGN-"- SIGNmulop SIGN; SIGNwhileSIGNid
ASSIGNMENT{
ASSIGNMENT)
ASSIGNMENT(
ASSIGNMENTif
ASSIGNMENTelse
ASSIGNMENTfloat
ASSIGNMENTint
ASSIGNMENT$
ASSIGNMENTrelop
ASSIGNMENTaddop
ASSIGNMENTnum
ASSIGNMENT+
ASSIGNMENTassign
ASSIGNMENT}
ASSIGNMENT-
ASSIGNMENTmulop
ASSIGNMENT;
ASSIGNMENTwhile-
ASSIGNMENTid"id"assign"
EXPRESSION"; STATEMENT{ STATEMENT) STATEMENT(> STATEMENTif"if"("
EXPRESSION")"{" STATEMENT"}"ELSE STATEMENTelse" STATEMENTfloat"float"id"; STATEMENTint"int"id"; STATEMENT$ STATEMENTrelop STATEMENTaddop STATEMENTnum STATEMENT+ STATEMENTassign STATEMENT} STATEMENT- STATEMENTmulop STATEMENT;> STATEMENTwhile"while"("
EXPRESSION")"{" STATEMENT"} STATEMENTid"
ASSIGNMENT SIMPLE_EXPRESSION{SIMPLE_EXPRESSION);SIMPLE_EXPRESSION("FACTOR"TERM'"SIMPLE_EXPRESSION' SIMPLE_EXPRESSIONif SIMPLE_EXPRESSIONelse SIMPLE_EXPRESSIONfloat SIMPLE_EXPRESSIONint SIMPLE_EXPRESSION$ SIMPLE_EXPRESSIONrelop SIMPLE_EXPRESSIONaddop=SIMPLE_EXPRESSIONnum"FACTOR"TERM'"SIMPLE_EXPRESSION'8SIMPLE_EXPRESSION+"SIGN"TERM"SIMPLE_EXPRESSION' SIMPLE_EXPRESSIONassign SIMPLE_EXPRESSION}8SIMPLE_EXPRESSION-"SIGN"TERM"SIMPLE_EXPRESSION' SIMPLE_EXPRESSIONmulopSIMPLE_EXPRESSION; SIMPLE_EXPRESSIONwhile<SIMPLE_EXPRESSIONid"FACTOR"TERM'"SIMPLE_EXPRESSION' EXPRESSION'{EXPRESSION')"\EPS EXPRESSION'( EXPRESSION'if EXPRESSION'else EXPRESSION'float EXPRESSION'int EXPRESSION'$0EXPRESSION'relop"relop"SIMPLE_EXPRESSION EXPRESSION'addop EXPRESSION'num EXPRESSION'+ EXPRESSION'assign EXPRESSION'} EXPRESSION'- EXPRESSION'mulopEXPRESSION';"\EPS EXPRESSION'while EXPRESSION'id DECLARATION{ DECLARATION) DECLARATION( DECLARATIONif DECLARATIONelse$DECLARATIONfloat"float"id"; DECLARATIONint"int"id"; DECLARATION$ DECLARATIONrelop DECLARATIONaddop DECLARATIONnum DECLARATION+ DECLARATIONassign DECLARATION} DECLARATION- DECLARATIONmulop DECLARATION; DECLARATIONwhile DECLARATIONid SIMPLE_EXPRESSION'{SIMPLE_EXPRESSION')"\EPS SIMPLE_EXPRESSION'( SIMPLE_EXPRESSION'if SIMPLE_EXPRESSION'else SIMPLE_EXPRESSION'float SIMPLE_EXPRESSION'int SIMPLE_EXPRESSION'$#SIMPLE_EXPRESSION'relop"\EPS>SIMPLE_EXPRESSION'addop"addop"TERM"SIMPLE_EXPRESSION' SIMPLE_EXPRESSION'num SIMPLE_EXPRESSION'+ SIMPLE_EXPRESSION'assign SIMPLE_EXPRESSION'} SIMPLE_EXPRESSION'- SIMPLE_EXPRESSION'mulopSIMPLE_EXPRESSION';"\EPS SIMPLE_EXPRESSION'while SIMPLE_EXPRESSION'id WHILE{ WHILE) WHILE( WHILEif WHILEelse WHILEfloat WHILEint WHILE$ WHILErelop WHILEaddop WHILEnum WHILE+ WHILEassign WHILE} WHILE- WHILEmulop WHILE;:WHILEwhile"while"("
EXPRESSION")"{" STATEMENT"} WHILEid FACTOR{FACTOR)FACTOR("("
EXPRESSION") FACTORif FACTORelse FACTORfloat FACTORint FACTOR$FACTORrelopFACTORaddopFACTORnum"num FACTOR+ FACTORassign FACTOR} FACTOR-FACTORmulopFACTOR; FACTORwhileFACTORid"id PRIMITIVE_TYPE{ PRIMITIVE_TYPE) PRIMITIVE_TYPE( PRIMITIVE_TYPEif PRIMITIVE_TYPEelse PRIMITIVE_TYPEfloat"floatPRIMITIVE_TYPEint"int PRIMITIVE_TYPE$ PRIMITIVE_TYPErelop PRIMITIVE_TYPEaddop PRIMITIVE_TYPEnum PRIMITIVE_TYPE+ PRIMITIVE_TYPEassign PRIMITIVE_TYPE} PRIMITIVE_TYPE- PRIMITIVE_TYPEmulop PRIMITIVE_TYPE; PRIMITIVE_TYPEwhile PRIMITIVE_TYPEid METHOD_BODY{ METHOD_BODY) METHOD_BODY(#METHOD_BODYif"STATEMENT_LIST METHOD_BODYelse&METHOD_BODYfloat"STATEMENT_LIST$METHOD_BODYint"STATEMENT_LISTMETHOD_BODY$ METHOD_BODYrelop METHOD_BODYaddop METHOD_BODYnum METHOD_BODY+ METHOD_BODYassign METHOD_BODY} METHOD_BODY- METHOD_BODYmulop METHOD_BODY;&METHOD_BODYwhile"STATEMENT_LIST#METHOD_BODYid"STATEMENT_LIST STATEMENT_LIST{ STATEMENT_LIST) STATEMENT_LIST(2STATEMENT_LISTif" STATEMENT"STATEMENT_LIST' STATEMENT_LISTelse5STATEMENT_LISTfloat" STATEMENT"STATEMENT_LIST'3STATEMENT_LISTint" STATEMENT"STATEMENT_LIST'STATEMENT_LIST$ STATEMENT_LISTrelop STATEMENT_LISTaddop STATEMENT_LISTnum STATEMENT_LIST+ STATEMENT_LISTassign STATEMENT_LIST} STATEMENT_LIST- STATEMENT_LISTmulop STATEMENT_LIST;5STATEMENT_LISTwhile" STATEMENT"STATEMENT_LIST'2STATEMENT_LISTid" STATEMENT"STATEMENT_LIST' TERM{TERM)TERM("FACTOR"TERM' TERMif TERMelse TERMfloat TERMint TERM$TERMrelopTERMaddopTERMnum"FACTOR"TERM' TERM+ TERMassign TERM} TERM- TERMmulopTERM; TERMwhileTERMid"FACTOR"TERM' IF{ IF) IF(7IFif"if"("
EXPRESSION")"{" STATEMENT"}"ELSE IFelse IFfloat IFint IF$ IFrelop IFaddop IFnum IF+ IFassign IF} IF- IFmulop IF; IFwhile
IFid