-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaw.english.txt
28 lines (28 loc) · 1.28 KB
/
law.english.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
PROGRAM→program IDENTIFIER ; PARTOFPROGRAM
PARTOFPROGRAM→VARIABLESTATEMENTS begin SENTENCEFORM end
VARIABLESTATEMENTS→var VARIABLESTATEMENTSFORM ;
VARIABLESTATEMENTSFORM→VARIABLEFORM : TYPE VARIABLESTATEMENTSFORM'
VARIABLESTATEMENTSFORM'→, VARIABLESTATEMENTSFORM|ε
TYPE→integer|real
VARIABLEFORM→VARIABLE VARIABLEFORM'
VARIABLEFORM'→, VARIABLEFORM|ε
SENTENCEFORM→SENTENCE SENTENCEFORM'
SENTENCEFORM'→; SENTENCEFORM|ε
SENTENCE→ASSIGNMENTSENTENCE|CONDITIONSENTENCE|WHILESENTENCE|COMPLEXSENTENCE
ASSIGNMENTSENTENCE→VARIABLE := OPERATIONEXPRESSION
CONDITIONSENTENCE→if REATIONSHIPEXPRESSION then SENTENCE else SENTENCE
WHILESENTENCE→while REATIONSHIPEXPRESSION do SENTENCE
COMPLEXSENTENCE→begin SENTENCEFORM end
OPERATIONEXPRESSION→TERM|+ TERM , OPERATIONEXPRESSION|- TERM , OPERATIONEXPRESSION
TERM→FACTOR|* FACTOR , TERM|/ FACTOR , TERM
FACTOR→VARIABLE|CONSTANT
REATIONSHIPEXPRESSION→OPERATIONEXPRESSION REATIONSHIPOPERATOR OPERATIONEXPRESSION
VARIABLE→IDENTIFIER
IDENTIFIER→ALPHABET
IDENTIFIER'→IDENTIFIER NUM|IDENTIFIER|ε
CONSTANT→WHOLENUM
WHOLENUM→NUM WHOLENUM'
WHOLENUM'→WHOLENUM|ε
REATIONSHIPOPERATOR→<|<=|=|>=
ALPHABET→A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z
NUM→0|1|2|3|4|5|6|7|8|9