-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfinalgm.txt
More file actions
87 lines (87 loc) · 3.22 KB
/
finalgm.txt
File metadata and controls
87 lines (87 loc) · 3.22 KB
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
<mainFunction> ===> MAIN SQO SQC <stmtsAndFunctionDefs> END
<stmtsAndFunctionDefs> ===> <stmtOrFunctionDef> <stmtExt>
<stmtExt> ===> <stmtsAndFunctionDefs>
<stmtExt> ===> eps
<stmtOrFunctionDef> ===> <stmt>
<stmtOrFunctionDef> ===> <functionDef>
<stmt> ===> <declarationStmt>
<stmt> ===> <assignmentStmt_type1>
<stmt> ===> <assignmentStmt_type2>
<stmt> ===> <ifStmt>
<stmt> ===> <ioStmt>
<stmt> ===> <funCallStmt> SEMICOLON
<functionDef> ===> FUNCTION SQO <parameter_list> SQC ASSIGNOP FUNID SQO <parameter_list> SQC <stmtsAndFunctionDefs> END SEMICOLON
<parameter_list> ===> <type> ID <remainingList>
<type> ===> INT
<type> ===> REAL
<type> ===> STRING
<type> ===> MATRIX
<remainingList> ===> COMMA <parameter_list>
<remainingList> ===> eps
<declarationStmt> ===> <type> <var_list> SEMICOLON
<var_list> ===> ID <more_ids>
<more_ids> ===> COMMA <var_list>
<more_ids> ===> eps
<assignmentStmt_type1> ===> <leftHandSide_singleVar> ASSIGNOP <rightHandSide_type1> SEMICOLON
<assignmentStmt_type2> ===> <leftHandSide_listVar> ASSIGNOP <rightHandSide_type2> SEMICOLON
<leftHandSide_singleVar> ===> ID
<leftHandSide_listVar> ===> SQO <var_list> SQC
<rightHandSide_type1> ===> <arithmeticExpression>
<rightHandSide_type1> ===> <sizeExpression>
<rightHandSide_type1> ===> <funCallStmt>
<rightHandSide_type2> ===> <sizeExpression>
<rightHandSide_type2> ===> <funCallStmt>
<sizeExpression> ===> SIZE ID
<ifStmt> ===> IF OP <booleanExpression> CL <stmt> <otherStmts> <ifStmtFactored>
<ifStmtFactored> ===> ELSE <stmt> <otherStmts> ENDIF SEMICOLON
<ifStmtFactored> ===> ENDIF SEMICOLON
<otherStmts> ===> <stmt> <otherStmts>
<otherStmts> ===> eps
<ioStmt> ===> READ OP ID CL SEMICOLON
<ioStmt> ===> PRINT OP ID CL SEMICOLON
<funCallStmt> ===> FUNID OP <inputParameterList> CL
<inputParameterList> ===> <var> <listVar>
<listVar> ===> COMMA <inputParameterList>
<listVar> ===> eps
<arithmeticExpression> ===> <arithmeticTerm> <ArithExpFactored>
<ArithExpFactored> ===> <operator_lowPrecedence> <arithmeticExpression>
<ArithExpFactored> ===> eps
<arithmeticTerm> ===> <factor> <ArithTermFactored>
<ArithTermFactored> ===> <operator_highPrecedence> <arithmeticTerm>
<ArithTermFactored> ===> eps
<factor> ===> OP <arithmeticExpression> CL
<factor> ===> <var>
<operator_lowPrecedence> ===> PLUS
<operator_lowPrecedence> ===> MINUS
<operator_highPrecedence> ===> MUL
<operator_highPrecedence> ===> DIV
<booleanExpression> ===> OP <booleanExpression> CL <logicalOp> OP <booleanExpression> CL
<booleanExpression> ===> <constrainedVars> <relationalOp> <constrainedVars>
<constrainedVars> ===> ID
<constrainedVars> ===> NUM
<constrainedVars> ===> RNUM
<var> ===> ID <MatLit>
<var> ===> NUM
<var> ===> RNUM
<var> ===> STR
<var> ===> <matrix>
<var> ===> <funCallStmt>
<MatLit> ===> <matrixElement>
<MatLit> ===> eps
<matrix> ===> SQO <rows> SQC
<rows> ===> <row> <RowLit>
<RowLit> ===> SEMICOLON <rows>
<RowLit> ===> eps
<row> ===> NUM <remainingColElements>
<remainingColElements> ===> COMMA NUM <remainingColElements>
<remainingColElements> ===> eps
<matrixElement> ===> SQO NUM COMMA NUM SQC
<logicalOp> ===> AND
<logicalOp> ===> OR
<booleanExpression> ===> NOT OP <booleanExpression> CL
<relationalOp> ===> LT
<relationalOp> ===> LE
<relationalOp> ===> EQ
<relationalOp> ===> GT
<relationalOp> ===> GE
<relationalOp> ===> NE