-
Notifications
You must be signed in to change notification settings - Fork 2
/
syntax-rules.txt
90 lines (71 loc) · 1.43 KB
/
syntax-rules.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#statement (
#block
#expression
#if_statement
#return_statement
#while_statement
#do_while_statement)
#block(indent=+1) =
[ #statement
*]
#expression (
#modifying_expression
#pure_expression)
#modifying_expression (
#function_call_expression
#variable_assignment_expression)
#pure_expression (
#binary_operator_expression
#cast_expression
#literal_expression
#variable_declaration_expression
#variable_expression)
#binary_operator_expression =
[#expression ${operator} #expression]
[#expression ${operator} #expression]
[#expression ${operator} #expression]
[#expression ${operator} #expression]
#cast_expression (
#bitcast_expression)
#literal_expression =
[${sign=+} <value:[0..9]*> $<type>]
#variable_declaration_expression =
[variable ${type} <name:[a-zA-Z]*> (#expression)]
#variable_expression =
[${variable}]
#bitcast_expression =
[(cast #expression to #type)]
#type =
[void]
[boolean]
[unsignedByte]
[signedByte]
[unsignedShort]
[signedShort]
[unsignedInt]
[signedInt]
[unsignedLong]
[signedLong]
[unsignedLongLong]
[signedLongLong]
[char]
#function_call_expression =
[call ${function}]
#variable_assignment_expression =
[${variable} = #expression]
#if_statement =
[if (#expression) {
#block
} else {
#block
}]
#return_statement =
[return #expression]
#while_statement =
[while (#expression) {
#block
}]
#do_while_statement =
[do {
#block
} while (#expression)]