Program:
Expression
EOF
Program
::=
Expression
*
|
EOF
no references
Expression:
Comment
Block
Statement
Operation
Expression
::=
Comment
|
Block
|
Statement
|
Operation
referenced by:
Arguments
Block
Case
Catch
Column
Default
Do
Element
Else
Export
For
ForEach
FunctionDeclaration
Global
If
Import
Include
Local
ParenthesizedExpression
Program
Return
Switch
Test
Throw
Try
While
Block:
{
Expression
}
Block
::= '{'
Expression
* '}'
referenced by:
Expression
FunctionDeclaration
NamespaceDeclaration
Operation:
VariableAssignment
Operation
::=
VariableAssignment
referenced by:
Expression
VariableAssignment:
ConditionalExpression
=
*=
/=
%=
+=
-=
<<=
>>=
&=
^=
|=
?=
:=
VariableAssignment
::=
ConditionalExpression
( ( '=' | '*=' | '/=' | '%=' | '+=' | '-=' | '<<=' | '>>=' | '&=' | '^=' | '|=' | '?=' | ':=' )
ConditionalExpression
)*
referenced by:
ConditionalExpression
Operation
ConditionalExpression:
LogicalORExpression
?
VariableAssignment
:
VariableAssignment
ConditionalExpression
::=
LogicalORExpression
( '?'
VariableAssignment
':'
VariableAssignment
)?
referenced by:
VariableAssignment
LogicalORExpression:
LogicalANDExpression
||
LogicalORExpression
::=
LogicalANDExpression
( '||'
LogicalANDExpression
)*
referenced by:
ConditionalExpression
LogicalANDExpression:
BitwiseORExpression
&&
LogicalANDExpression
::=
BitwiseORExpression
( '&&'
BitwiseORExpression
)*
referenced by:
LogicalORExpression
BitwiseORExpression:
BitwiseXORExpression
|
BitwiseORExpression
::=
BitwiseXORExpression
( '|'
BitwiseXORExpression
)*
referenced by:
LogicalANDExpression
BitwiseXORExpression:
BitwiseANDExpression
^
BitwiseXORExpression
::=
BitwiseANDExpression
( '^'
BitwiseANDExpression
)*
referenced by:
BitwiseORExpression
BitwiseANDExpression:
EqualityExpression
&
BitwiseANDExpression
::=
EqualityExpression
( '&'
EqualityExpression
)*
referenced by:
BitwiseXORExpression
EqualityExpression:
RelationalExpression
==
!=
EqualityExpression
::=
RelationalExpression
( ( '==' | '!=' )
RelationalExpression
)*
referenced by:
BitwiseANDExpression
RelationalExpression:
ShiftExpression
<
>
<=
>=
RelationalExpression
::=
ShiftExpression
( ( '<' | '>' | '<=' | '>=' )
ShiftExpression
)*
referenced by:
EqualityExpression
ShiftExpression:
AdditiveExpression
<<
>>
ShiftExpression
::=
AdditiveExpression
( ( '<<' | '>>' )
AdditiveExpression
)*
referenced by:
RelationalExpression
AdditiveExpression:
PowerExpression
+
-
AdditiveExpression
::=
PowerExpression
( ( '+' | '-' )
PowerExpression
)*
referenced by:
ShiftExpression
PowerExpression:
MultiplicativeExpression
**
PowerExpression
::=
MultiplicativeExpression
( '**'
MultiplicativeExpression
)*
referenced by:
AdditiveExpression
MultiplicativeExpression:
UnaryExpression
*
/
%
MultiplicativeExpression
::=
UnaryExpression
( ( '*' | '/' | '%' )
UnaryExpression
)*
referenced by:
PowerExpression
UnaryExpression:
Primary
++
--
++
--
+
-
~
!
Primary
UnaryExpression
::=
Primary
( '++' | '--' )?
| ( '++' | '--' | '+' | '-' | '~' | '!' )
Primary
referenced by:
MultiplicativeExpression
Primary:
Type
Member
Value
ParenthesizedExpression
Primary
::=
Type
?
Member
|
Value
|
ParenthesizedExpression
referenced by:
UnaryExpression
Statement:
Do
While
For
ForEach
break
continue
If
Switch
Try
Test
NamespaceDeclaration
FunctionDeclaration
Return
Export
Import
Include
Global
Local
Throw
;
Statement
::=
Do
|
While
|
For
|
ForEach
| 'break'
| 'continue'
|
If
|
Switch
|
Try
|
Test
|
NamespaceDeclaration
|
FunctionDeclaration
|
Return
|
Export
|
Import
|
Include
|
Global
|
Local
|
Throw
| ';'
referenced by:
Expression
Do:
do
Expression
while
(
Expression
)
Do
::= 'do'
Expression
'while' '('
Expression
')'
referenced by:
Statement
While:
while
(
Expression
)
Expression
While
::= 'while' '('
Expression
')'
Expression
referenced by:
Statement
For:
for
(
Expression
;
Expression
;
Expression
)
Expression
For
::= 'for' '('
Expression
';'
Expression
';'
Expression
')'
Expression
referenced by:
Statement
ForEach:
foreach
(
Expression
;
Expression
;
Expression
)
Expression
ForEach
::= 'foreach' '('
Expression
';'
Expression
';'
Expression
')'
Expression
referenced by:
Statement
If:
if
(
Expression
)
Expression
Else
If
::= 'if' '('
Expression
')'
Expression
Else
?
referenced by:
Statement
Else:
else
Expression
Else
::= 'else'
Expression
referenced by:
If
Switch:
switch
(
Expression
)
{
Case
Default
}
Switch
::= 'switch' '('
Expression
')' '{'
Case
+
Default
? '}'
referenced by:
Statement
Case:
case
Expression
:
Expression
Case
::= 'case'
Expression
':'
Expression
*
referenced by:
Switch
Default:
default
:
Expression
Default
::= 'default' ':'
Expression
*
referenced by:
Switch
Try:
try
Expression
Catch
Try
::= 'try'
Expression
Catch
?
referenced by:
Statement
Test:
test
(
Expression
;
Expression
;
Expression
)
Expression
Catch
Test
::= 'test' '('
Expression
? ( ';'
Expression
? ( ';'
Expression
? )? )? ')'
Expression
Catch
?
referenced by:
Statement
Catch:
catch
(
Expression
)
Expression
Catch
::= 'catch' '('
Expression
')'
Expression
referenced by:
Test
Try
NamespaceDeclaration:
Identifier
.
Block
NamespaceDeclaration
::=
Identifier
( '.'
Identifier
)*
Block
referenced by:
Statement
FunctionDeclaration:
Identifier
.
(
Arguments
)
=
Expression
?=
#=
:=
Block
Type
Identifier
.
(
Arguments
)
Block
Script
FunctionDeclaration
::=
Identifier
( '.'
Identifier
)* '('
Arguments
? ')' ( '='
Expression
| ( '?=' | '#=' | ':=' )
Block
)
|
Type
?
Identifier
( '.'
Identifier
)* '('
Arguments
? ')' (
Block
|
Script
)
referenced by:
Statement
Return:
return
Expression
Return
::= 'return'
Expression
referenced by:
Statement
Export:
export
Expression
Export
::= 'export'
Expression
referenced by:
Statement
Import:
import
Expression
Import
::= 'import'
Expression
referenced by:
Statement
Include:
include
Expression
Include
::= 'include'
Expression
referenced by:
Statement
Global:
global
Expression
Global
::= 'global'
Expression
referenced by:
Statement
Local:
local
Expression
Local
::= 'local'
Expression
referenced by:
Statement
Throw:
throw
Expression
Throw
::= 'throw'
Expression
referenced by:
Statement
Type:
i32
i64
f32
f64
Type
::= 'i32'
| 'i64'
| 'f32'
| 'f64'
referenced by:
FunctionDeclaration
Primary
Arguments:
Expression
,
Arguments
::=
Expression
( ','
Expression
)*
referenced by:
FunctionDeclaration
Member
Member:
Identifier
.
(
Arguments
)
[
Arguments
]
Member
::=
Identifier
( '.'
Identifier
)* ( '('
Arguments
? ')' | ( '['
Arguments
? ']' )* )
referenced by:
Primary
Array:
{
Element
,
Element
}
Array
::= '{'
Element
? ( ','
Element
)* '}'
referenced by:
Value
Matrix:
[
Row
;
Row
]
Matrix
::= '['
Row
? ( ';'
Row
)* ']'
referenced by:
Value
Element:
Key
:
Expression
Element
::= (
Key
':' )?
Expression
referenced by:
Array
Key:
Identifier
String
Key
::=
Identifier
|
String
referenced by:
Element
Row:
Column
,
Row
::=
Column
( ','
Column
)*
referenced by:
Matrix
Column:
Expression
Column
::=
Expression
referenced by:
Row
ParenthesizedExpression:
(
Expression
)
ParenthesizedExpression
::= '('
Expression
')'
referenced by:
Primary
Value:
Integer
Real
Complex
Character
String
Array
Matrix
null
true
false
Value
::=
Integer
|
Real
|
Complex
|
Character
|
String
|
Array
|
Matrix
| 'null'
| 'true'
| 'false'
referenced by:
Primary
WhiteSpace:
WhiteSpace
WhiteSpace
::=
WhiteSpace^token
/* ws: definition */
referenced by:
WhiteSpace
EOF:
$
EOF
::= $
referenced by:
Program
Identifier:
( FirstIdentifierChar IdentifierChar* ) - ReservedWord
Identifier
::= (
FirstIdentifierChar
IdentifierChar
* ) -
ReservedWord
referenced by:
FunctionDeclaration
Key
Member
NamespaceDeclaration
ReservedWord:
break
case
catch
continue
default
do
else
export
f32
f64
false
for
foreach
global
i32
i64
if
import
include
local
return
null
switch
test
throw
true
try
while
ReservedWord
::= 'break'
| 'case'
| 'catch'
| 'continue'
| 'default'
| 'do'
| 'else'
| 'export'
| 'f32'
| 'f64'
| 'false'
| 'for'
| 'foreach'
| 'global'
| 'i32'
| 'i64'
| 'if'
| 'import'
| 'include'
| 'local'
| 'return'
| 'null'
| 'switch'
| 'test'
| 'throw'
| 'true'
| 'try'
| 'while'
referenced by:
Identifier
FirstIdentifierChar:
$
_
[A-Z]
[a-z]
FirstIdentifierChar
::= [$_A-Za-z]
referenced by:
Identifier
IdentifierChar:
$
_
[0-9]
[A-Z]
[a-z]
IdentifierChar
::= [$_0-9A-Za-z]
referenced by:
Identifier
Character:
'
SingleCharacter
EscapeSequence
'
Character
::= "'" (
SingleCharacter
|
EscapeSequence
) "'"
referenced by:
Value
SingleCharacter:
InputCharacter - ( "'" | '\' )
SingleCharacter
::=
InputCharacter
- ( "'" | '\' )
referenced by:
Character
String:
"
StringCharacters
"
String
::= '"'
StringCharacters
? '"'
referenced by:
Key
Value
StringCharacters:
StringCharacter
StringCharacters
::=
StringCharacter
+
referenced by:
String
StringCharacter:
InputCharacter - ( '"' | '\' )
EscapeSequence
StringCharacter
::=
InputCharacter
- ( '"' | '\' )
|
EscapeSequence
referenced by:
StringCharacters
EscapeSequence:
BackSlash
b
t
n
f
r
"
'
BackSlash
OctalEscape
HexEscapeSequence
EscapeSequence
::=
BackSlash
( 'b' | 't' | 'n' | 'f' | 'r' | '"' | "'" |
BackSlash
)
|
OctalEscape
|
HexEscapeSequence
referenced by:
Character
StringCharacter
OctalEscape:
\
OctalDigit
OctalEscape
::= '\'
OctalDigit
+
referenced by:
EscapeSequence
HexEscapeSequence:
\x
HexDigit
HexEscapeSequence
::= '\x'
HexDigit
+
referenced by:
EscapeSequence
OctalDigit:
0
1
2
3
4
5
6
7
OctalDigit
::= '0'
| '1'
| '2'
| '3'
| '4'
| '5'
| '6'
| '7'
referenced by:
Octal
OctalEscape
HexDigit:
[0-9]
[a-f]
[A-F]
HexDigit
::= [0-9a-fA-F]
referenced by:
HexEscapeSequence
Hexadecimal
UnicodeEscape
BackSlash:
\
UnicodeMarker
005
c
C
BackSlash
::= '\' (
UnicodeMarker
'005' [cC] )?
referenced by:
EscapeSequence
InputCharacter:
UnicodeInputCharacter - ( CR | LF )
InputCharacter
::=
UnicodeInputCharacter
- (
CR
|
LF
)
referenced by:
SingleCharacter
StringCharacter
UnicodeInputCharacter:
UnicodeEscape
RawInputCharacter
UnicodeInputCharacter
::=
UnicodeEscape
|
RawInputCharacter
referenced by:
InputCharacter
UnicodeEscape:
\
UnicodeMarker
HexDigit
HexDigit
HexDigit
HexDigit
UnicodeEscape
::= '\'
UnicodeMarker
HexDigit
HexDigit
HexDigit
HexDigit
referenced by:
UnicodeInputCharacter
UnicodeMarker:
u
U
UnicodeMarker
::= 'u'
| 'U'
referenced by:
BackSlash
UnicodeEscape
RawInputCharacter:
[#x0001-#xD7FF]
[#xE000-#xFFFD]
[#x10000-#x10FFFF]
RawInputCharacter
::= [#x0001-#xD7FF#xE000-#xFFFD#x10000-#x10FFFF]
referenced by:
UnicodeInputCharacter
Integer:
0
Digit
u
U
l
ll
L
LL
f
F
Octal
Hexadecimal
Integer
::= '0'
|
Digit
+ ( 'u' | 'U' )? ( 'l' | 'll' | 'L' | 'LL' | 'f' | 'F' )?
|
Octal
|
Hexadecimal
referenced by:
Value
Complex:
Real
Imaginary
Complex
::=
Real
?
Imaginary
referenced by:
Value
Real:
-
Digit
.
Digit
e
E
p
P
+
-
Digit
Real
::= '-'?
Digit
+ '.'
Digit
+ ( ( 'e' | 'E' | 'p' | 'P' ) ( '+' | '-' )?
Digit
+ )?
referenced by:
Complex
Imaginary
Value
Imaginary:
+
-
Real
*
i
Imaginary
::= ( '+' | '-' )?
Real
'*' 'i'
referenced by:
Complex
Digit:
[0-9]
Digit
::= [0-9]
referenced by:
Integer
Real
Octal:
0
OctalDigit
Octal
::= '0'
OctalDigit
+
referenced by:
Integer
Hexadecimal:
0x
HexDigit
Hexadecimal
::= '0x'
HexDigit
+
referenced by:
Integer
Comment:
SingleLineComment
MultiLineComment
Comment
::=
SingleLineComment
|
MultiLineComment
referenced by:
Expression
SingleLineComment:
//
#
SourceCharacter - LineTerminator
SingleLineComment
::= ( '//' | '#' ) (
SourceCharacter
-
LineTerminator
)*
referenced by:
Comment
MultiLineComment:
/*
SourceCharacter* - ( SourceCharacter* '*/' SourceCharacter* )
*/
MultiLineComment
::= '/*' (
SourceCharacter
* - (
SourceCharacter
* '*/'
SourceCharacter
* ) ) '*/'
referenced by:
Comment
Script:
/{
SourceCharacter* - ( SourceCharacter* '}/' SourceCharacter* )
}/
Script
::= '/{' (
SourceCharacter
* - (
SourceCharacter
* '}/'
SourceCharacter
* ) ) '}/'
referenced by:
FunctionDeclaration
SourceCharacter:
.
SourceCharacter
::=
.
referenced by:
MultiLineComment
Script
SingleLineComment
LineTerminator:
LF
CR
LF
LineTerminator
::=
LF
|
CR
LF
?
referenced by:
SingleLineComment
LF:
[#x000A]
LF
::= #x000A
referenced by:
InputCharacter
LineTerminator
CR:
[#x000D]
CR
::= #x000D
referenced by:
InputCharacter
LineTerminator
WhiteSpace:
[#x0009]
[#x000A]
[#x000D]
[#x0020]
WhiteSpace
::= [#x0009#x000A#x000D#x0020]+
referenced by:
WhiteSpace
... generated by
RR - Railroad Diagram Generator
R
R