-
Notifications
You must be signed in to change notification settings - Fork 1
/
grammar.txt
53 lines (53 loc) · 1.82 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
module PROGRAM BROP BRCL CURLOP decStmtGrp assignStmtGrp CURLCL
decStmtGrp decStmt decStmtGrp
decStmtGrp decStmt
assignStmtGrp assignStmt assignStmtGrp
assignStmtGrp assignStmt
decStmt primitiveDecStmt
decStmt arrayDecStmt
decStmt jagArrDecStmt
primitiveDecStmt DECLARE ID COLON primitiveDataType SEMICOL
primitiveDecStmt DECLARE LIST OF VARIABLES multipleIdList COLON primitiveDataType SEMICOL
arrayDecStmt DECLARE ID COLON ARRAY arrayRangeList OF INTEGER SEMICOL
arrayDecStmt DECLARE LIST OF VARIABLES multipleIdList COLON ARRAY arrayRangeList OF INTEGER SEMICOL
jagArrDecStmt DECLARE ID COLON JAGGED ARRAY jagArrRange OF INTEGER SEMICOL jagArrInit
jagArrDecStmt DECLARE LIST OF VARIABLES multipleIdList COLON JAGGED ARRAY jagArrRange OF INTEGER SEMICOL jagArrInit
jagArrInit jagArrDimDec jagArrInit
jagArrInit jagArrDimDec
jagArrDimDec R1 SQOP NUM SQCL COLON SIZE NUM COLON VALUES CURLOP jagArrValues CURLCL
jagArrValues numList SEMICOL jagArrValues
jagArrValues numList
numList NUM numList
numList EPS
multipleIdList ID COMMA idList
multipleIdList ID idList
idList ID idList
idList ID
idList ID COMMA idList
primitiveDataType INTEGER
primitiveDataType REAL
primitiveDataType BOOLEAN
arrayRangeList arrayRange arrayRangeList
arrayRangeList arrayRange
arrayRange SQOP numOrId ELIP numOrId SQCL
numOrId NUM
numOrId ID
jagArrRange SQOP NUM ELIP NUM SQCL SQOP SQCL
jagArrRange SQOP NUM ELIP NUM SQCL SQOP SQCL SQOP SQCL
numOrIdList numOrId numOrIdList
numOrIdList numOrId
arrayElement ID SQOP numOrIdList SQCL
operand ID
operand NUM
operand arrayElement
assignLhs ID
assignLhs arrayElement
assignStmt assignLhs EQUALS arithExpression SEMICOL
arithExpression term PLUS arithExpression
arithExpression term MINUS arithExpression
arithExpression term OR arithExpression
arithExpression term
term operand MUL term
term operand DIV term
term operand AND term
term operand