-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.grammar
305 lines (256 loc) · 4.89 KB
/
.grammar
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
#rules
Start Program
Program RProgram Program
Program None
RProgram ObjectDef
RProgram FunctionDef
RProgram PublicFunctionDef
RProgram NamespaceDef
RProgram UsingDef
RProgram VarDeclare Semi
RProgram Stmt
Typename TypeString
Typename TypeBoolean
Typename TypeNumber
Typename TypeArray
Typename TypeFunction
Typename Id
ObjectDef Object Id Lcurly MObjectVar Rcurly
MObjectVar ObjectVar MObjectVar
MObjectVar None
ObjectVar Id OTypename OExpr Semi
OTypename Colon Typename
OTypename None
OExpr Assign Expr
OExpr None
FunctionDef Definition Id Lparenthesis MFunctionVar Rparenthesis OTypename Scope
PublicFunctionDef Public FunctionDef
PublicFunctionDef PublicDef Id Lparenthesis MFunctionVar Rparenthesis OTypename Scope
NamespaceDef Extend Identifier Colon
UsingDef Using Identifier Colon
MFunctionVar FunctionVar Comma MFunctionVar
MFunctionVar FunctionVar
MFunctionVar None
FunctionVar Id OTypename
Scope Lcurly MStmt Rcurly
MStmt Stmt MStmt
MStmt Scope MStmt
MStmt None
Stmt Expr Semi
Stmt Flow
Stmt Setter Semi
Expr Expr Add Add
Expr Expr Sub Sub
Expr Expr Add Expr
Expr Expr Sub Expr
Expr Expr Div Expr
Expr Expr Mult Expr
Expr Expr NotEqual Expr
Expr Expr Equal Expr
Expr Expr And Expr
Expr Expr Or Expr
Expr Expr Less Expr
Expr Expr Larger Expr
Expr Expr LessEqual Expr
LessEqual Less Assign
Expr Expr LargerEqual Expr
LargerEqual Larger Assign
Expr Conditional
Conditional Expr Opt Expr Colon Expr
Expr Priority
Priority Lparenthesis Expr Rparenthesis
Expr Unary
Expr ValueId
Unary Value
Unary Add Add Expr
Unary Add Expr
Unary Sub Sub Expr
Unary Sub Expr
Unary Not Expr
Value True
Value False
Value FormatStr
Value Quote Literal Quote
Value Number
Value Identifier
Value Null
Identifier Id
Identifier Identifier Dot Id
Value Array
Array Lbracket CallParams Rbracket
Expr Expr Dot Id
OFormatArg StrDelimiterL Expr StrDelimiterR
OFormatArg Literal
FormatStr Quote OFormatArg Quote
OFormatArg OFormatArg OFormatArg
MPipe Pipe MPipe
MPipe Pipe
Pipe Router FunctionCall
Expr Expr Assign Expr
Expr Expr Add Assign Expr
Expr Expr Sub Assign Expr
Expr Expr Div Assign Expr
Expr Expr Mult Assign Expr
Expr VarDeclare
Expr FunctionCall
Expr Indexer
Expr Expr MPipe
Expr Control
Expr ObjectInit
ObjectInit Identifier Lcurly CallParams Rcurly
Setter Set ValueId
Control Return Expr
Control Return
Control Continue
Control Break
Flow IfFlow
Flow ForFlow
Flow WhileFlow
IfFlow If Lparenthesis Expr Rparenthesis FlowBlock ElseFlow
ForFlow For Lparenthesis Expr Semi Expr Semi Expr Rparenthesis FlowBlock ElseFlow
ForFlow For Lparenthesis Expr Rparenthesis FlowBlock ElseFlow
ForFlow For Lparenthesis Id In Expr Rparenthesis FlowBlock ElseFlow
WhileFlow While Lparenthesis Expr Rparenthesis FlowBlock
ElseFlow Else FlowBlock
ElseFlow None
FlowBlock Stmt
FlowBlock Scope
Indexer Expr Lbracket Expr Rbracket
Indexer Expr Lbracket Rbracket
VarDeclare Var Id OTypename OVarDeclare
VarDeclare Static Id OTypename OVarDeclare
VarDeclare Const Id OTypename OVarDeclare
OVarDeclare Assign Expr
OVarDeclare None
FunctionCall Expr Lparenthesis CallParams Rparenthesis
CallParams Expr
CallParams Expr Comma CallParams
CallParams None
#data
.
None None Program
.
None None ObjectDef
None None FunctionDef
None None PublicFunctionDef
None None NamespaceDef
None None UsingDef
None None VarDeclare
None None Stmt
None TypeString
None TypeBoolean
None TypeNumber
None TypeArray
None TypeFunction
Id Typename
Id None MObjectVar
None None MObjectVar
None ObjectDef
Id
None None Typename
None AnyType
None None Expr
.
Id
None PublicFunctionDef FunctionDef
Id PublicFunctionDef
Id
Id
None CallParams MFunctionVar
None CallParams
None CallParams
Id
None Scope MStmt
None Scope MStmt
None Scope MStmt
None Scope
None None Expr
None None Flow
None None Setter
None Increment
None Decrement
None Add
None Sub
None Div
None Mult
None NotEqual
None Equal
None And
None Or
None Less
None Larger
None None LessEqual
None LessEqual
None None LargerEqual
None LargerEqual
None None Conditional
.
None None Priority
None None Expr
None None Unary
ValueId ValueId
None None Value
None PreIncrement
None None Expr
None PreDecrement
None Negate
None Not
True True
False False
None None FormatStr
Literal Literal
Number Number
None None Identifier
None Null
Id Id
Id Id
None None Array
None Array CallParams
Id Property
None None Expr
Literal Literal
None Add OFormatArg
None Add
None None MPipe
None Pipe
None None FunctionCall
Assign Assign
None AssignAdd
None AssignSub
None AssignDiv
None AssignMult
None None VarDeclare
None None FunctionCall
None None Indexer
None None MPipe
None None Control
None None ObjectInit
.
ValueId
None Return
None Return
None Continue
None Break
None None IfFlow
None None ForFlow
None None WhileFlow
None If
None For
None For
Id For
None While
None Else
None Else
None None Stmt
None None Scope
.
.
Id None OVarDeclare
Id Static OVarDeclare
Id Const OVarDeclare
None VarDeclare
None VarDeclare
.
None None
None None CallParams
.