-
Notifications
You must be signed in to change notification settings - Fork 0
/
grammar.txt
68 lines (68 loc) · 2.85 KB
/
grammar.txt
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
start PROGRAM OP CP OCB stmts CCB
stmts declarativeStmts assignmentStmts
declarativeStmts declarativeStmt declarativeStmtsOptional
declarativeStmtsOptional EPSILON
declarativeStmtsOptional declarativeStmt declarativeStmtsOptional
assignmentStmts assignmentStmt assignmentStmtsOptional
assignmentStmtsOptional EPSILON
assignmentStmtsOptional assignmentStmt assignmentStmtsOptional
declarativeStmt varDeclarePhrase specificDeclarativePhrase
varDeclarePhrase DECLARE varOrListDeclare COLON
varOrListDeclare VAR_ID
varOrListDeclare LIST OF VARIABLES listVarId
listVarId VAR_ID listVarIdOptional
listVarIdOptional EPSILON
listVarIdOptional VAR_ID listVarIdOptional
type INTEGER
type BOOLEAN
type REAL
specificDeclarativePhrase primitiveDeclarativePhrase
specificDeclarativePhrase rectArrayDeclarativePhrase
specificDeclarativePhrase jaggedArrayDeclarativePhrase jaggedArrayInitialization
primitiveDeclarativePhrase type SEMI_COLON
rectArrayDeclarativePhrase ARRAY listDim OF INTEGER SEMI_COLON
jaggedArrayDeclarativePhrase JAGGED ARRAY OSB NUM DOUBLE_DOT NUM CSB listEmptyDim OF INTEGER SEMI_COLON
listDim OSB idx DOUBLE_DOT idx CSB listDimOptional
listDimOptional EPSILON
listDimOptional OSB idx DOUBLE_DOT idx CSB listDimOptional
idx NUM
idx VAR_ID
listEmptyDim OSB CSB listEmptyDimOptional
listEmptyDimOptional EPSILON
listEmptyDimOptional OSB CSB listEmptyDimOptional
jaggedArrayInitialization jaggedArrayInitializationPhrase jaggedArrayInitializationOptional
jaggedArrayInitializationPhrase R1 OSB NUM CSB COLON SIZE NUM COLON VALUES OCB listIntSemiColon CCB
jaggedArrayInitializationOptional EPSILON
jaggedArrayInitializationOptional jaggedArrayInitializationPhrase jaggedArrayInitializationOptional
listIntSemiColon listInt listIntSemiColonOptional
listIntSemiColonOptional EPSILON
listIntSemiColonOptional SEMI_COLON listInt listIntSemiColonOptional
listInt NUM listIntOptional
listIntOptional EPSILON
listIntOptional NUM listIntOptional
assignmentStmt element ASSIGN_OP expression SEMI_COLON
expression orLogicExpression
element VAR_ID elementDimOptional
elementDimOptional EPSILON
elementDimOptional OSB listIdx CSB
listIdx idx listIdxOptional
listIdxOptional EPSILON
listIdxOptional idx listIdxOptional
orLogicExpression andLogicExpression orLogicExpressionOptional
orLogicExpressionOptional EPSILON
orLogicExpressionOptional OR_LOGIC_OP andLogicExpression orLogicExpressionOptional
andLogicExpression addExpression andLogicExpressionOptional
andLogicExpressionOptional EPSILON
andLogicExpressionOptional AND_LOGIC_OP addExpression andLogicExpressionOptional
addExpression mulExpression addExpressionOptional
addExpressionOptional EPSILON
addExpressionOptional addOps mulExpression addExpressionOptional
addOps ADD_OP
addOps SUB_OP
mulExpression term mulExpressionOptional
mulExpressionOptional EPSILON
mulExpressionOptional mulOps term mulExpressionOptional
mulOps MUL_OP
mulOps DIV_OP
term NUM
term element