Skip to content

Instantly share code, notes, and snippets.

@abcarroll
Created October 28, 2021 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abcarroll/4e70f2f3c0362c942d0cc9f8030a07d9 to your computer and use it in GitHub Desktop.
Save abcarroll/4e70f2f3c0362c942d0cc9f8030a07d9 to your computer and use it in GitHub Desktop.
Compilation
<- Spacing CompilationUnit SUB? EOT;
_ <- [\u0000-\uFFFF] ;
SUB <- '\u001a' ;
EOT <- !_ ;
WS <- [ \t\r\n\u000C] ;
Spacing
<- ( WS+
/ "/**/"
/ "/*" (_ !"*/")* _ "*/"
/ "//" [^\r\n]*
)* ;
Identifier <- !Keyword Letter LetterOrDigit* Spacing ;
Letter <- [a-z] / [A-Z] / [_$] ;
LetterOrDigit <- [a-z] / [A-Z] / [0-9] / [_$] ;
Keyword
<- ( "abstract"
/ "assert"
/ "boolean"
/ "break"
/ "byte"
/ "case"
/ "catch"
/ "char"
/ "class"
/ "const"
/ "continue"
/ "default"
/ "double"
/ "do"
/ "else"
/ "enum"
/ "extends"
/ "false"
/ "finally"
/ "final"
/ "float"
/ "for"
/ "goto"
/ "if"
/ "implements"
/ "import"
/ "interface"
/ "int"
/ "instanceof"
/ "long"
/ "native"
/ "new"
/ "null"
/ "package"
/ "private"
/ "protected"
/ "public"
/ "return"
/ "short"
/ "static"
/ "strictfp"
/ "super"
/ "switch"
/ "synchronized"
/ "this"
/ "throws"
/ "throw"
/ "transient"
/ "true"
/ "try"
/ "void"
/ "volatile"
/ "while"
) !LetterOrDigit
;
ABSTRACT <- "abstract" !LetterOrDigit Spacing ;
ASSERT <- "assert" !LetterOrDigit Spacing ;
BOOLEAN <- "boolean" !LetterOrDigit Spacing ;
BREAK <- "break" !LetterOrDigit Spacing ;
BYTE <- "byte" !LetterOrDigit Spacing ;
CASE <- "case" !LetterOrDigit Spacing ;
CATCH <- "catch" !LetterOrDigit Spacing ;
CHAR <- "char" !LetterOrDigit Spacing ;
CLASS <- "class" !LetterOrDigit Spacing ;
CONTINUE <- "continue" !LetterOrDigit Spacing ;
DEFAULT <- "default" !LetterOrDigit Spacing ;
DOUBLE <- "double" !LetterOrDigit Spacing ;
DO <- "do" !LetterOrDigit Spacing ;
ELSE <- "else" !LetterOrDigit Spacing ;
ENUM <- "enum" !LetterOrDigit Spacing ;
EXTENDS <- "extends" !LetterOrDigit Spacing ;
FALSE <- "false" !LetterOrDigit Spacing ;
FINALLY <- "finally" !LetterOrDigit Spacing ;
FINAL <- "final" !LetterOrDigit Spacing ;
FLOAT <- "float" !LetterOrDigit Spacing ;
FOR <- "for" !LetterOrDigit Spacing ;
IF <- "if" !LetterOrDigit Spacing ;
IMPLEMENTS <- "implements" !LetterOrDigit Spacing ;
IMPORT <- "import" !LetterOrDigit Spacing ;
INTERFACE <- "interface" !LetterOrDigit Spacing ;
INT <- "int" !LetterOrDigit Spacing ;
INSTANCEOF <- "instanceof" !LetterOrDigit Spacing ;
LONG <- "long" !LetterOrDigit Spacing ;
NATIVE <- "native" !LetterOrDigit Spacing ;
NEW <- "new" !LetterOrDigit Spacing ;
NULL <- "null" !LetterOrDigit Spacing ;
PACKAGE <- "package" !LetterOrDigit Spacing ;
PRIVATE <- "private" !LetterOrDigit Spacing ;
PROTECTED <- "protected" !LetterOrDigit Spacing ;
PUBLIC <- "public" !LetterOrDigit Spacing ;
RETURN <- "return" !LetterOrDigit Spacing ;
SHORT <- "short" !LetterOrDigit Spacing ;
STATIC <- "static" !LetterOrDigit Spacing ;
STRICTFP <- "strictfp" !LetterOrDigit Spacing ;
SUPER <- "super" !LetterOrDigit Spacing ;
SWITCH <- "switch" !LetterOrDigit Spacing ;
SYNCHRONIZED <- "synchronized" !LetterOrDigit Spacing ;
THIS <- "this" !LetterOrDigit Spacing ;
THROWS <- "throws" !LetterOrDigit Spacing ;
THROW <- "throw" !LetterOrDigit Spacing ;
TRANSIENT <- "transient" !LetterOrDigit Spacing ;
TRUE <- "true" !LetterOrDigit Spacing ;
TRY <- "try" !LetterOrDigit Spacing ;
VOID <- "void" !LetterOrDigit Spacing ;
VOLATILE <- "volatile" !LetterOrDigit Spacing ;
WHILE <- "while" !LetterOrDigit Spacing ;
Literal
<- FloatLiteral
/ IntegerLiteral
/ BooleanLiteral
/ CharLiteral
/ StringLiteral
/ NullLiteral
;
IntegerLiteral
<- ( HexNumeral
/ BinaryNumeral
/ OctalNumeral
/ DecimalNumeral
) [lL]? Spacing
;
DecimalNumeral
<- "0"
/ [1-9]([_]*[0-9])*
;
HexNumeral
<- ("0x" / "0X") HexDigits ;
OctalNumeral
<- "0" ([_]*[0-7])+ ;
BinaryNumeral
<- ("0b" / "0B") [01]([_]*[01])* ;
FloatLiteral
<- ( HexadecimalFloatingPointLiteral
/ DecimalFloatingPointLiteral
) Spacing
;
DecimalFloatingPointLiteral
<- Digits "." Digits? Exponent? [fFdD]?
/ "." Digits Exponent? [fFdD]?
/ Digits Exponent [fFdD]?
/ Digits Exponent? [fFdD]
;
Exponent
<- [eE] [+\-]? Digits ;
HexadecimalFloatingPointLiteral
<- HexSignificand BinaryExponent [fFdD]? ;
HexSignificand
<- ("0x" / "0X") HexDigits? "." HexDigits
/ HexNumeral "."?
;
HexDigits
<- HexDigit ([_]*HexDigit)* ;
HexDigit
<- [a-f] / [A-F] / [0-9] ;
BinaryExponent
<- [pP] [+\-]? Digits ;
Digits
<- [0-9]([_]*[0-9])* ;
BooleanLiteral
<- TRUE
/ FALSE
;
CharLiteral
<- "'" (Escape / !['\\\n\r] _) "'" Spacing
;
StringLiteral
<- "\"" (Escape / !["\\\n\r] _)* "\"" Spacing
;
Escape
<- "\\" ([btnfr"'\\] / OctalEscape / UnicodeEscape)
;
OctalEscape
<- [0-3][0-7][0-7]
/ [0-7][0-7]
/ [0-7]
;
UnicodeEscape
<- "u"+ HexDigit HexDigit HexDigit HexDigit ;
NullLiteral <- NULL ;
AT <- "@" Spacing ;
COLONCOLON <- "::" Spacing ;
COMMA <- "," Spacing ;
DOT <- "." Spacing ;
ELLIPSIS <- "..." Spacing ;
LPAR <- "(" Spacing ;
LBRK <- "[" Spacing ;
RBRK <- "]" Spacing ;
RPAR <- ")" Spacing ;
LWING <- "{" Spacing ;
RWING <- "}" Spacing ;
SEMI <- ";" Spacing ;
AND <- "&"![=&] Spacing ;
ANDAND <- "&&" Spacing ;
ANDEQU <- "&=" Spacing ;
ARROW <- "->" Spacing ;
BANG <- "!" ![=] Spacing ;
BSR <- ">>>"![=] Spacing ;
BSREQU <- ">>>=" Spacing ;
COLON <- ":" ![:] Spacing ;
DEC <- "--" Spacing ;
DIV <- "/" ![=] Spacing ;
DIVEQU <- "/=" Spacing ;
EQU <- "=" ![=] Spacing ;
EQUAL <- "==" Spacing ;
GE <- ">=" Spacing ;
GT <- ">"![=>] Spacing ;
HAT <- "^"![=] Spacing ;
HATEQU <- "^=" Spacing ;
INC <- "++" Spacing ;
LE <- "<=" Spacing ;
LPOINT <- "<" Spacing ;
LT <- "<"![=<] Spacing ;
MINUS <- "-"![=\->]Spacing ;
MINUSEQU <- "-=" Spacing ;
MOD <- "%"![=] Spacing ;
MODEQU <- "%=" Spacing ;
NOTEQUAL <- "!=" Spacing ;
OR <- "|"![=|] Spacing ;
OREQU <- "|=" Spacing ;
OROR <- "||" Spacing ;
PLUS <- "+"![=+] Spacing ;
PLUSEQU <- "+=" Spacing ;
QUERY <- "?" Spacing ;
RPOINT <- ">" Spacing ;
SL <- "<<"![=] Spacing ;
SLEQU <- "<<=" Spacing ;
SR <- ">>"![=>] Spacing ;
SREQU <- ">>=" Spacing ;
STAR <- "*"![=] Spacing ;
STAREQU <- "*=" Spacing ;
TILDE <- "~" Spacing ;
BasicType
<- BYTE
/ SHORT
/ INT
/ LONG
/ CHAR
/ FLOAT
/ DOUBLE
/ BOOLEAN
;
PrimitiveType
<- Annotation* BasicType ;
ReferenceType
<- PrimitiveType Dim+
/ ClassType Dim*
;
ClassType
<- Annotation* Identifier TypeArguments?
(DOT Annotation* Identifier TypeArguments?)* ;
Type
<- PrimitiveType
/ ClassType
;
ArrayType
<- PrimitiveType Dim+
/ ClassType Dim+
;
TypeVariable
<- Annotation* Identifier ;
Dim
<- Annotation* LBRK RBRK ;
TypeParameter
<- TypeParameterModifier* Identifier TypeBound? ;
TypeParameterModifier
<- Annotation ;
TypeBound
<- EXTENDS (ClassType AdditionalBound* / TypeVariable) ;
AdditionalBound
<- AND ClassType ;
TypeArguments
<- LPOINT TypeArgumentList RPOINT ;
TypeArgumentList
<- TypeArgument (COMMA TypeArgument)* ;
TypeArgument
<- ReferenceType
/ Wildcard
;
Wildcard
<- Annotation* QUERY WildcardBounds? ;
WildcardBounds
<- EXTENDS ReferenceType
/ SUPER ReferenceType
;
QualIdent
<- Identifier (DOT Identifier)* ;
CompilationUnit
<- PackageDeclaration? ImportDeclaration* TypeDeclaration* ;
PackageDeclaration
<- PackageModifier* PACKAGE Identifier (DOT Identifier)* SEMI ;
PackageModifier
<- Annotation ;
ImportDeclaration
<- IMPORT STATIC? QualIdent (DOT STAR)? SEMI
/ SEMI
;
TypeDeclaration
<- ClassDeclaration
/ InterfaceDeclaration
/ SEMI
;
ClassDeclaration
<- NormalClassDeclaration
/ EnumDeclaration
;
NormalClassDeclaration
<- ClassModifier* CLASS Identifier TypeParameters?
Superclass? Superinterfaces? ClassBody
;
ClassModifier
<- Annotation
/ PUBLIC
/ PROTECTED
/ PRIVATE
/ ABSTRACT
/ STATIC
/ FINAL
/ STRICTFP
;
TypeParameters
<- LPOINT TypeParameterList RPOINT ;
TypeParameterList
<- TypeParameter (COMMA TypeParameter)* ;
Superclass
<- EXTENDS ClassType ;
Superinterfaces
<- IMPLEMENTS InterfaceTypeList ;
InterfaceTypeList
<- ClassType (COMMA ClassType)* ;
ClassBody
<- LWING ClassBodyDeclaration* RWING ;
ClassBodyDeclaration
<- ClassMemberDeclaration
/ InstanceInitializer
/ StaticInitializer
/ ConstructorDeclaration
;
ClassMemberDeclaration
<- FieldDeclaration
/ MethodDeclaration
/ ClassDeclaration
/ InterfaceDeclaration
/ SEMI
;
FieldDeclaration
<- FieldModifier* UnannType VariableDeclaratorList SEMI ;
VariableDeclaratorList
<- VariableDeclarator (COMMA VariableDeclarator)* ;
VariableDeclarator
<- VariableDeclaratorId (EQU VariableInitializer)? ;
VariableDeclaratorId
<- Identifier Dim* ;
VariableInitializer
<- Expression
/ ArrayInitializer
;
UnannClassType
<- Identifier TypeArguments?
(DOT Annotation* Identifier TypeArguments?)* ;
UnannType
<- BasicType Dim*
/ UnannClassType Dim*
;
FieldModifier
<- Annotation
/ PUBLIC
/ PROTECTED
/ PRIVATE
/ STATIC
/ FINAL
/ TRANSIENT
/ VOLATILE
;
MethodDeclaration
<- MethodModifier* MethodHeader MethodBody ;
MethodHeader
<- Result MethodDeclarator Throws?
/ TypeParameters Annotation* Result MethodDeclarator Throws?
;
MethodDeclarator
<- Identifier LPAR FormalParameterList? RPAR Dim* ;
FormalParameterList
<- (ReceiverParameter / FormalParameter)(COMMA FormalParameter)* ;
FormalParameter
<- VariableModifier* UnannType VariableDeclaratorId
/ VariableModifier* UnannType Annotation* ELLIPSIS VariableDeclaratorId !COMMA
;
VariableModifier
<- Annotation
/ FINAL
;
ReceiverParameter
<- VariableModifier* UnannType (Identifier DOT)? THIS ;
Result
<- UnannType
/ VOID
;
MethodModifier
<- Annotation
/ PUBLIC
/ PROTECTED
/ PRIVATE
/ ABSTRACT
/ STATIC
/ FINAL
/ SYNCHRONIZED
/ NATIVE
/ STRICTFP
;
Throws
<- THROWS ExceptionTypeList ;
ExceptionTypeList
<- ExceptionType (COMMA ExceptionType)* ;
ExceptionType
<- ClassType
/ TypeVariable
;
MethodBody
<- Block
/ SEMI
;
InstanceInitializer
<- Block ;
StaticInitializer
<- STATIC Block ;
ConstructorDeclaration
<- ConstructorModifier* ConstructorDeclarator Throws? ConstructorBody ;
ConstructorDeclarator
<- TypeParameters? Identifier LPAR FormalParameterList? RPAR ;
ConstructorModifier
<- Annotation
/ PUBLIC
/ PROTECTED
/ PRIVATE
;
ConstructorBody
<- LWING ExplicitConstructorInvocation? BlockStatements? RWING ;
ExplicitConstructorInvocation
<- TypeArguments? THIS Arguments SEMI
/ TypeArguments? SUPER Arguments SEMI
/ Primary DOT TypeArguments? SUPER Arguments SEMI
/ QualIdent DOT TypeArguments? SUPER Arguments SEMI
;
EnumDeclaration
<- ClassModifier* ENUM Identifier Superinterfaces? EnumBody ;
EnumBody
<- LWING EnumConstantList? COMMA? EnumBodyDeclarations? RWING ;
EnumConstantList
<- EnumConstant (COMMA EnumConstant)* ;
EnumConstant
<- EnumConstantModifier* Identifier Arguments? ClassBody? ;
EnumConstantModifier
<- Annotation ;
EnumBodyDeclarations
<- SEMI ClassBodyDeclaration* ;
InterfaceDeclaration
<- NormalInterfaceDeclaration
/ AnnotationTypeDeclaration
;
NormalInterfaceDeclaration
<- InterfaceModifier* INTERFACE Identifier TypeParameters?
ExtendsInterfaces? InterfaceBody ;
InterfaceModifier
<- Annotation
/ PUBLIC
/ PROTECTED
/ PRIVATE
/ ABSTRACT
/ STATIC
/ STRICTFP
;
ExtendsInterfaces
<- EXTENDS InterfaceTypeList ;
InterfaceBody
<- LWING InterfaceMemberDeclaration* RWING ;
InterfaceMemberDeclaration
<- ConstantDeclaration
/ InterfaceMethodDeclaration
/ ClassDeclaration
/ InterfaceDeclaration
/ SEMI
;
ConstantDeclaration
<- ConstantModifier* UnannType VariableDeclaratorList SEMI ;
ConstantModifier
<- Annotation
/ PUBLIC
/ STATIC
/ FINAL
;
InterfaceMethodDeclaration
<- InterfaceMethodModifier* MethodHeader MethodBody ;
InterfaceMethodModifier
<- Annotation
/ PUBLIC
/ ABSTRACT
/ DEFAULT
/ STATIC
/ STRICTFP
;
AnnotationTypeDeclaration
<- InterfaceModifier* AT INTERFACE Identifier AnnotationTypeBody ;
AnnotationTypeBody
<- LWING AnnotationTypeMemberDeclaration* RWING ;
AnnotationTypeMemberDeclaration
<- AnnotationTypeElementDeclaration
/ ConstantDeclaration
/ ClassDeclaration
/ InterfaceDeclaration
/ SEMI
;
AnnotationTypeElementDeclaration
<- AnnotationTypeElementModifier* UnannType Identifier LPAR RPAR Dim*
DefaultValue? SEMI ;
AnnotationTypeElementModifier
<- Annotation
/ PUBLIC
/ ABSTRACT
;
DefaultValue
<- DEFAULT ElementValue ;
Annotation
<- AT
( NormalAnnotation
/ SingleElementAnnotation
/ MarkerAnnotation
)
;
NormalAnnotation
<- QualIdent LPAR ElementValuePairList* RPAR ;
ElementValuePairList
<- ElementValuePair (COMMA ElementValuePair)* ;
ElementValuePair
<- Identifier EQU ElementValue ;
ElementValue
<- ConditionalExpression
/ ElementValueArrayInitializer
/ Annotation
;
ElementValueArrayInitializer
<- LWING ElementValueList? COMMA? RWING ;
ElementValueList
<- ElementValue (COMMA ElementValue)* ;
MarkerAnnotation
<- QualIdent ;
SingleElementAnnotation
<- QualIdent LPAR ElementValue RPAR ;
ArrayInitializer
<- LWING VariableInitializerList? COMMA? RWING ;
VariableInitializerList
<- VariableInitializer (COMMA VariableInitializer)* ;
Block
<- LWING BlockStatements? RWING ;
BlockStatements
<- BlockStatement BlockStatement* ;
BlockStatement
<- LocalVariableDeclarationStatement
/ ClassDeclaration
/ Statement
;
LocalVariableDeclarationStatement
<- LocalVariableDeclaration SEMI ;
LocalVariableDeclaration
<- VariableModifier* UnannType VariableDeclaratorList ;
Statement
<- Block
/ IF ParExpression Statement (ELSE Statement)?
/ BasicForStatement
/ EnhancedForStatement
/ WHILE ParExpression Statement
/ DO Statement WHILE ParExpression SEMI
/ TryStatement
/ SWITCH ParExpression SwitchBlock
/ SYNCHRONIZED ParExpression Block
/ RETURN Expression? SEMI
/ THROW Expression SEMI
/ BREAK Identifier? SEMI
/ CONTINUE Identifier? SEMI
/ ASSERT Expression (COLON Expression)? SEMI
/ SEMI
/ StatementExpression SEMI
/ Identifier COLON Statement
;
StatementExpression
<- Assignment
/ (INC / DEC)(Primary / QualIdent)
/ (Primary / QualIdent)(INC / DEC)
/ Primary
;
SwitchBlock
<- LWING SwitchBlockStatementGroup* SwitchLabel* RWING ;
SwitchBlockStatementGroup
<- SwitchLabels BlockStatements ;
SwitchLabels
<- SwitchLabel SwitchLabel* ;
SwitchLabel
<- CASE (ConstantExpression / EnumConstantName) COLON
/ DEFAULT COLON
;
EnumConstantName
<- Identifier ;
BasicForStatement
<- FOR LPAR ForInit? SEMI Expression? SEMI ForUpdate? RPAR Statement ;
ForInit
<- LocalVariableDeclaration
/ StatementExpressionList
;
ForUpdate
<- StatementExpressionList ;
StatementExpressionList
<- StatementExpression (COMMA StatementExpression)* ;
EnhancedForStatement
<- FOR LPAR VariableModifier* UnannType VariableDeclaratorId COLON
Expression RPAR Statement ;
TryStatement
<- TRY
( Block (CatchClause* Finally / CatchClause+)
/ ResourceSpecification Block CatchClause* Finally?
)
;
CatchClause
<- CATCH LPAR CatchFormalParameter RPAR Block ;
CatchFormalParameter
<- VariableModifier* CatchType VariableDeclaratorId ;
CatchType
<- UnannClassType (OR ClassType)* ;
Finally
<- FINALLY Block ;
ResourceSpecification
<- LPAR ResourceList SEMI? RPAR ;
ResourceList
<- Resource (SEMI Resource)* ;
Resource
<- VariableModifier* UnannType VariableDeclaratorId EQU Expression ;
Expression
<- LambdaExpression
/ AssignmentExpression
;
Primary
<- PrimaryBase PrimaryRest* ;
PrimaryBase
<- THIS
/ Literal
/ ParExpression
/ SUPER
( DOT TypeArguments? Identifier Arguments
/ DOT Identifier
/ COLONCOLON TypeArguments? Identifier
)
/ NEW
( ClassCreator
/ ArrayCreator
)
/ QualIdent
( LBRK Expression RBRK
/ Arguments
/ DOT
( THIS
/ NEW ClassCreator
/ TypeArguments Identifier Arguments
/ SUPER DOT TypeArguments? Identifier Arguments
/ SUPER DOT Identifier
/ SUPER COLONCOLON TypeArguments? Identifier
)
/ (LBRK RBRK)* DOT CLASS
/ COLONCOLON TypeArguments? Identifier
)
/ VOID DOT CLASS
/ BasicType (LBRK RBRK)* DOT CLASS
/ ReferenceType COLONCOLON TypeArguments? Identifier
/ ClassType COLONCOLON TypeArguments? NEW
/ ArrayType COLONCOLON NEW
;
PrimaryRest
<- DOT
( TypeArguments? Identifier Arguments
/ Identifier
/ NEW ClassCreator
)
/ LBRK Expression RBRK
/ COLONCOLON TypeArguments? Identifier
;
ParExpression
<- LPAR Expression RPAR ;
ClassCreator
<- TypeArguments? Annotation* ClassTypeWithDiamond
Arguments ClassBody? ;
ClassTypeWithDiamond
<- Annotation* Identifier TypeArgumentsOrDiamond?
(DOT Annotation* Identifier TypeArgumentsOrDiamond?)* ;
TypeArgumentsOrDiamond
<- TypeArguments
/ LPOINT RPOINT !DOT
;
ArrayCreator
<- Type DimExpr+ Dim*
/ Type Dim+ ArrayInitializer
;
DimExpr
<- Annotation* LBRK Expression RBRK ;
Arguments
<- LPAR ArgumentList? RPAR ;
ArgumentList
<- Expression (COMMA Expression)* ;
UnaryExpression
<- (INC / DEC)(Primary / QualIdent)
/ PLUS UnaryExpression
/ MINUS UnaryExpression
/ UnaryExpressionNotPlusMinus
;
UnaryExpressionNotPlusMinus
<- TILDE UnaryExpression
/ BANG UnaryExpression
/ CastExpression
/ (Primary / QualIdent) (INC / DEC)?
;
CastExpression
<- LPAR PrimitiveType RPAR UnaryExpression
/ LPAR ReferenceType AdditionalBound* RPAR LambdaExpression
/ LPAR ReferenceType AdditionalBound* RPAR UnaryExpressionNotPlusMinus
;
InfixExpression
<- UnaryExpression
((InfixOperator UnaryExpression) / (INSTANCEOF ReferenceType))* ;
InfixOperator
<- OROR
/ ANDAND
/ OR
/ HAT
/ AND
/ EQUAL
/ NOTEQUAL
/ LT
/ GT
/ LE
/ GE
/ SL
/ SR
/ BSR
/ PLUS
/ MINUS
/ STAR
/ DIV
/ MOD
;
ConditionalExpression
<- InfixExpression (QUERY Expression COLON Expression)* ;
AssignmentExpression
<- Assignment
/ ConditionalExpression
;
Assignment
<- LeftHandSide AssignmentOperator Expression ;
LeftHandSide
<- Primary
/ QualIdent
;
AssignmentOperator
<- EQU
/ STAREQU
/ DIVEQU
/ MODEQU
/ PLUSEQU
/ MINUSEQU
/ SLEQU
/ SREQU
/ BSREQU
/ ANDEQU
/ HATEQU
/ OREQU
;
LambdaExpression
<- LambdaParameters ARROW LambdaBody ;
LambdaParameters
<- Identifier
/ LPAR FormalParameterList? RPAR
/ LPAR InferredFormalParameterList RPAR
;
InferredFormalParameterList
<- Identifier (COMMA Identifier)* ;
LambdaBody
<- Expression
/ Block
;
ConstantExpression
<- Expression ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment