-
Notifications
You must be signed in to change notification settings - Fork 0
/
zephir.bnf
96 lines (69 loc) · 5.18 KB
/
zephir.bnf
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
<zephir> ::= <top statement list>
<top statement list> ::= <top statement list> <top statement>
<top statement list> ::= <top statement>
<top statement> ::= <namespace definition>
<top statement> ::= <use aliases>
<top statement> ::= <function definition>
<top statement> ::= <class definition>
<top statement> ::= <interface definition>
<top statement> ::= <comment>
<top statement> ::= <cblock>
<namespace definition> ::= namespace <identifier> ;
<namespace definition> ::= use <use aliases-list> ;
<use aliases list> ::= <use aliases list> , <use aliases>
<use aliases list> ::= <use aliases>
<use aliases> ::= <identifier>
<use aliases> ::= <identifier> as <identifier>
<function definition> ::= <function label> <identifier> ( ) -> method-return-type { }
<function definition> ::= <function label> <identifier> ( ) -> method-return-type ;
<function definition> ::= <function label> <identifier> ( parameter-list ) -> method-return-type { }
<function definition> ::= <function label> <identifier> ( parameter-list ) -> method-return-type ;
<function definition> ::= <function label> <identifier> ( ) -> method-return-type { statement-list }
<function definition> ::= <function label> <identifier> ( parameter-list ) -> method-return-type { statement-list }
<function definition> ::= <function label> <identifier> ( ) { }
<function definition> ::= <function label> <identifier> ( ) ;
<function definition> ::= <function label> <identifier> ( parameter-list ) { }
<function definition> ::= <function label> <identifier> ( parameter-list ) ;
<function definition> ::= <function label> <identifier> ( ) { statement-list }
<function definition> ::= <function label> <identifier> ( parameter-list ) { statement-list }
<function label> ::= function | fn
<interface definition> ::= interface <identifier> <interface body definition>
<interface definition> ::= interface <identifier> extends <implements list> <interface body definition>
<class definition> ::= <class scope> class <identifier> <class body definition>
<class definition> ::= <class scope> class <identifier> extends <identifier> <class body definition>
<class definition> ::= <class scope> class <identifier> implements <implements list> <class body definition>
<class definition> ::= <class scope> class <identifier> extends <identifier> implements <implements list> <class body definition>
<class scope> ::= abstract | final | internal | <empty>
<empty> ::=
<class body definition> ::= { }
<class body definition> ::= { <class body> }
<implements list> ::= <implements list> , <implements>
<implements list> ::= <implements>
<implements> ::= <identifier>
<interface body definition> ::= { }
<interface body definition> ::= { <interface body> }
<class body> ::= <class properties definition>
<class body> ::= <class consts definition>
<class body> ::= <class methods definition>
<class body> ::= <class methods definition>
<class body> ::= <class properties definition> <class consts definition>
<class body> ::= <class consts definition> <class properties definition>
<class body> ::= <class consts definition> <class methods definition>
<class body> ::= <class properties definition> <class consts definition> <class methods definition>
<class body> ::= <class consts definition> <class properties definition> <class methods definition>
<interface body> ::= <class consts definition>
<interface body> ::= <interface methods definition>
<interface body> ::= <class consts definition> <interface methods definition>
<class properties definition> ::= <class properties definition> <class property definition>
<class properties definition> ::= <class property definition>
<class property definition> ::= <property comment> <visibility list> <identifier> ;
<class property definition> ::= <property comment> <visibility list> <identifier> = <literal expression> ;
<class property definition> ::= <property comment> <visibility list> <identifier> <class property shortcuts> ;
<class property definition> ::= <property comment> <visibility list> <identifier> = <literal expr> <class property shortcuts> ;
<property comment> ::= <comment> | <empty>
<class property shortcuts> ::= { }
<class property shortcuts> ::= { <class property shortcuts list> }
<class property shortcuts list> ::= <class property shortcuts list> , <class property shortcut>
<class property shortcuts list> ::= <class property shortcut>
<class property shortcut> ::= <property comment> <identifier>
; 409 constants definition