forked from jashkenas/coffeescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grammar.txt
76 lines (73 loc) · 2.15 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Body: Line | Body TERMINATOR Line | Body TERMINATOR
Block: INDENT OUTDENT | INDENT Body OUTDENT
Line: Expression Statement
Statement: Return | Comment | Break | Continue
Expression
Value | Operation | Invocation | Assign
If | While | For
Code
Try | Switch | Class | Throw
Value: Assignable | Literal | Parenthetical | Range | This
Assignable: SimpleAssignable | Array | Object
SimpleAssignable: Value Accessor | Invocation Accessor | ThisProperty | Identifier
Assign:
Assignable = Expression
Assignable = TERMINATOR Expression
Assignable = INDENT Expression OUTDENT
AssignObj:
ObjAssignable
ObjAssignable : Expression
ObjAssignable : INDENT Expression OUTDENT
Comment
ObjAssignable: Identifier | AlphaNumeric | ThisProperty
AssignList:
'' | AssignObj | AssignList , AssignObj
AssignList OptComma TERMINATOR AssignObj
AssignList OptComma INDENT AssignList OptComma OUTDENT'
Code: PARAM_START ParamList PARAM_END FuncGlyph Block
FuncGlyph Block
FuncGlyph: -> | =>
Splat: Expression ...
Index: INDEX_START IndexValue INDEX_END | INDEX_SOAK Index
IndexValue: Expression | Slice
Object: { AssignList OptComma }
Invocation:
Value OptFuncExist Arguments
Invocation OptFuncExist Arguments
SUPER
SUPER Arguments
For:
Statement ForBody
Expression ForBody
ForBody Block
ForBody:
FOR Range
ForStart ForSource
IfBlock:
IF Expression Block
IfBlock ELSE IF Expression Block
If:
IfBlock
IfBlock ELSE Block
Statement POST_IF Expression
Expression POST_IF Expression
Operation:
UNARY Expression
- Expression
+ Expression
-- SimpleAssignable
++ SimpleAssignable
SimpleAssignable --
SimpleAssignable ++
Expression ?
Expression + Expression
Expression - Expression
Expression MATH Expression
Expression SHIFT Expression
Expression COMPARE Expression
Expression LOGIC Expression
Expression RELATION Expression
SimpleAssignable COMPOUND_ASSIGN Expressio
SimpleAssignable COMPOUND_ASSIGN INDENT Expression OUTDENT
SimpleAssignable COMPOUND_ASSIGN TERMINATOR Expression
SimpleAssignable EXTENDS Expression