BNF for FunctorParser.jj
NON-TERMINALS
Functor
::=
Expression
<EOF>
Expression
::=
ConditionalExpression
ConditionalExpression
::=
(
ConditionalOrExpression
( "?"
Expression
":"
Expression
)? )
ConditionalOrExpression
::=
(
ConditionalAndExpression
( "||"
ConditionalAndExpression
)* )
ConditionalAndExpression
::=
(
OrExpression
( "&&"
OrExpression
)* )
OrExpression
::=
(
XorExpression
( "|"
XorExpression
)* )
XorExpression
::=
(
AndExpression
( "^"
AndExpression
)* )
AndExpression
::=
(
EqualityExpression
( ( "&" )
EqualityExpression
)* )
EqualityExpression
::=
(
InstanceOfExpression
( ( "==" | "!=" )
InstanceOfExpression
)* )
InstanceOfExpression
::=
(
RelationalExpression
( "instanceof"
ClassOrInterfaceType
)? )
RelationalExpression
::=
(
ShiftExpression
( ( "<" | ">" | "<=" | ">=" )
ShiftExpression
)* )
ShiftExpression
::=
(
AdditiveExpression
( ( "<<" | ">>" | ">>>" )
AdditiveExpression
)* )
AdditiveExpression
::=
(
MultiplicativeExpression
( ( "-" | "+" )
MultiplicativeExpression
)* )
MultiplicativeExpression
::=
(
UnaryExpression
( ( "*" | "/" | "%" )
UnaryExpression
)* )
UnaryExpression
::=
CastExpression
|
( ( "+" | "-" | "~" | "!" )?
PrimaryExpression
)
CastLookahead
::=
"("
ClassOrInterfaceType
")" ( "!" | "(" | <IDENTIFIER> | "this" | "new" |
Literal
)
CastExpression
::=
( "("
ClassOrInterfaceType
")"
UnaryExpression
)
PrimaryExpression
::=
(
PrimaryPrefix
(
PrimarySuffix
)* )
PrimaryPrefix
::=
(
Literal
| "this" | "("
Expression
")" | "new"
AllocationExpression
|
Name
)
AllocationExpression
::=
(
ClassOrInterfaceType
Arguments
)
ClassOrInterfaceType
::=
( <IDENTIFIER> ( "." <IDENTIFIER> )* )
PrimarySuffix
::=
( "." "class" | "." <IDENTIFIER>
Arguments
| "." <IDENTIFIER> )
Name
::=
( <IDENTIFIER> ( "." <IDENTIFIER> )* )
Arguments
::=
"(" (
ArgumentList
)? ")"
ArgumentList
::=
(
Expression
( ","
Expression
)* )
Literal
::=
(
Integer
|
Float
|
Boolean
|
Character
|
String
|
Null
)
Integer
::=
<INTEGER_LITERAL>
Float
::=
<FLOATING_POINT_LITERAL>
Boolean
::=
"true"
|
"false"
Character
::=
<CHARACTER_LITERAL>
String
::=
<STRING_LITERAL>
Null
::=
"null"