language Java { omit JavaLex.Omit; nonterminal { Java, CompilationUnit, PackageDeclaration, ImportDeclarations, ImportDeclaration, ImportName, TypeDeclarations, TypeDeclaration, InterfacesOpt, Interfaces, InterfaceTypeList, ClassType, InterfaceType, Modifiers, Modifier, ModifiersOpt, ClassDeclaration, SuperOpt, Super, ClassBody, ClassBodyDeclarations, ClassBodyDeclaration, ClassMemberDeclaration, StaticInitializer, InterfaceDeclaration, ExtendsInterfacesOpt, ExtendsInterfaces, ExtendsInterfacesRest, InterfaceBody, InterfaceMemberDeclarationsOpt, InterfaceMemberDeclarations, InterfaceMemberDeclaration, ConstantDeclaration, AbstractMethodDeclaration, FieldDeclaration, VariableDeclarators, VariableDeclarator, VariableDeclaratorId, VariableDeclaratorIdRest, VariableInitializer, ArrayInitializer, VariableInitializersOpt, VariableInitializers, MethodDeclaration, MethodHeader, MethodDeclarator, MethodDeclaratorRest, MethodBody, FormalParameterListOpt, FormalParameterList, FormalParameter, ThrowsOpt, Throws, ClassTypeList, ConstructorDeclaration, ConstructorDeclarator, ConstructorBody, ExplicitConstructorInvocationOpt, ExplicitConstructorInvocation, ConstructorModifier, Type, ReferenceType, ArrayTypeRest, PrimitiveType, NumericType, IntegralType, FloatingPointType, ResultType, Statement, LabeledStatement, Block, BlockStatements, BlockStatement, LocalVariableDeclaration, LocalVariableDeclarationRest, EmptyStatement, StatementExpression, SwitchStatement, SwitchBlocks, SwitchLabel, IfStatement, WhileStatement, DoStatement, ForStatement, ForInitOpt, ForInit, StatementExpressionList, ForUpdateOpt, ForUpdate, BreakStatement, ContinueStatement, ReturnStatement, ThrowStatement, SynchronizedStatement, TryStatement, Catchblock, ExpressionOpt, Expression, AssignmentOperator, ConditionalExpression, ConditionalOrExpression, ConditionalOrExpressionRest, ConditionalAndExpression, ConditionalAndExpressionRest, InclusiveOrExpression, InclusiveOrExpressionRest, ExclusiveOrExpression, ExclusiveOrExpressionRest, AndExpression, AndExpressionRest, EqualityExpression, EqualityExpressionRest, InstanceOfExpression, RelationalExpression, RelationalExpressionRest, ShiftExpression, ShiftExpressionRest, AdditiveExpression, AdditiveExpressionRest, MultiplicativeExpression, MultiplicativeExpressionRest, UnaryExpression, PreIncrementExpression, PreDecrementExpression, UnaryExpressionNotPlusMinus, PostfixExpression, CastExpression, PrimaryExpression, PrimaryExpressionRest, PrimaryPrefix, PrimarySuffix, Literal, BooleanLiteral, NullLiteral, Arguments, ArgumentList, AllocationExpression, ArrayDimsAndInits, ArrayDimsExpression, ArrayDims, Name, SimpleName, QualifiedName, IntegerLiteral; } Java[unit] --> [/] ; CompilationUnit[packagedecl] --> [/] [/] ; [nopackagedecl] --> [] ; PackageDeclaration[package] --> package [] ";" [/] ; ImportDeclarations[declarations] --> [] ; [empty] --> ; ImportDeclaration[import] --> import [] ";" [/] ; ImportName[identifierDot] --> [] . [] ; [identifierDotStar] --> [] . [] * ; [identifier] --> ; TypeDeclarations[declarations] --> ; [declaration] --> ; TypeDeclaration[class] --> ; [interface] --> [] ; [empty] --> ";" [/] ; InterfacesOpt[interfaces] --> ; [empty] --> ; Interfaces[implements] --> implements ; InterfaceTypeList[interfacetype] --> ; [interfacetypes] --> [] , ; ClassType[classtype] --> ; InterfaceType[interfacetype] --> ; // -- Declaration: -------------------------------------------------- Modifiers[modifiers] --> ; [modifier] --> ; Modifier[public] --> public ; [protected] --> protected ; [private] --> private ; [static] --> static ; [abstract] --> abstract ; [final] --> final ; [native] --> native ; [synchronized] --> synchronized ; [transient] --> transient ; [volatile] --> volatile ; ConstructorModifier[public] --> public ; [protected] --> protected ; [private] --> private ; [empty] --> ; ModifiersOpt[modifiers] --> ; [empty] --> ; ClassDeclaration[class] --> class ; SuperOpt[super] --> ; [empty] --> ; Super[extendstype] --> extends ; ClassBody[classbody] --> { [+/] [-/] } [/] ; ClassBodyDeclarations[declarations] --> [/] ; [empty] --> ; ClassBodyDeclaration[staticinit] --> [] ; [classdecl] --> [] ; [interfacedecl] --> [] ; [constructordecl] --> [] ; [memberdecl] --> ; ClassMemberDeclaration[field] --> [] ; ClassMemberDeclaration[method] --> ; StaticInitializer[static] --> static ; InterfaceDeclaration[interface] --> interface ; ExtendsInterfacesOpt[extendsinterfaces] --> ; [empty] --> ; ExtendsInterfaces[extendsinterfaces] --> extends ; ExtendsInterfacesRest[extendrest] --> , ; [empty] --> ; InterfaceBody[interfacebody] --> [/] { [+/] [-/] } [/] ; InterfaceMemberDeclarationsOpt[declarations] --> ; [empty] --> ; InterfaceMemberDeclarations[declaration] --> [/] ; [declarations] --> [/] ; InterfaceMemberDeclaration[constant] --> ; [abstractmethod] --> [] ; ConstantDeclaration[field] --> ; AbstractMethodDeclaration[abstractmethod] --> \; ; FieldDeclaration[fielddeclaration] --> [] ";" ; VariableDeclarators[variabledeclarator] --> ; [variabledeclarators] --> , ; VariableDeclarator[variabledeclarator] --> ; [initvariabledeclarator] --> = ; VariableDeclaratorId[variablearray] --> [] ; [variable] --> ; VariableDeclaratorIdRest[arrayrest] --> "[" [] "]" [] ; [array] --> "[" [] "]" ; VariableInitializer[expression] --> ; [arrayinitializer] --> ; ArrayInitializer[comma] --> { , } ; [nocomma] --> { } ; VariableInitializersOpt[variableinitialisers] --> ; [empty] --> ; VariableInitializers[VariableInitializer] --> ; [VariableInitializercomma] --> , ; [VariableInitializers] --> , ; MethodDeclaration[methoddeclaration] --> [/] ; MethodHeader[methodheader] --> ; MethodDeclarator[methoddeclarator] --> [] ( [] [] ) ; [methoddeclaratorrest] --> ( [] [] ) [] ; MethodDeclaratorRest[rest] --> "[" [] "]" [] ; [norest] --> "[" "]" ; MethodBody[block] --> ; [semicolon] --> \; ; FormalParameterListOpt[formalparameterlist] --> ; [empty] --> ; FormalParameterList[formalparameter] --> ; [formalparameters] --> , ; FormalParameter[formalparameter] --> ; ThrowsOpt[throws] --> ; [empty] --> ; Throws[throws] --> throws ; ClassTypeList[classtype] --> ; [classtypes] --> , ; ConstructorDeclaration[constructordeclaration] --> ; ConstructorDeclarator[constructordeclarator] --> ( ) ; ConstructorBody[constructorbody] --> { [+/] [-/] } ; ExplicitConstructorInvocationOpt[explicit] --> [] ; [empty] --> ; ExplicitConstructorInvocation[this] --> this [] \; [/] ; [super] --> super [] \; [/] ; // -- Type: -------------------------------------------------- Type[primitivetype] --> ; [referencetype] --> ; ReferenceType[primitivetypearray] --> ; [namearray] --> ; ArrayTypeRest[arrayrest] --> "[" [] "]" ; [empty] --> ; PrimitiveType[numerictype] --> ; [boolean] --> boolean ; NumericType[integral] --> ; [floatinpoint] --> ; IntegralType[byte] --> byte ; [short] --> short ; [int] --> int ; [long] --> long ; [char] --> char ; FloatingPointType[float] --> float ; [double] --> double ; ResultType[void] --> void ; [type] --> ; // -- Statement: -------------------------------------------------- Statement[label] --> [] ; [block] --> ; [empty] --> ; [expression] --> [] ";" ; [switch] --> ; [if] --> ; [while] --> ; [do] --> ; [for] --> ; [break] --> ; [continue] --> ; [return] --> ; [throw] --> ; //[synchronized] --> ; [try] --> ; LabeledStatement[labeled] --> : ; Block[block] --> { [+/] [-/] } ; BlockStatements[block] --> [/] ; [trap] --> [] ; [empty] --> ; BlockStatement[variabledeclaration] --> [] [] ";" ; [statement] --> ; [classdeclaration] --> ; LocalVariableDeclaration[final] --> final ; [notfinal] --> ; LocalVariableDeclarationRest[rest] --> , [] ; [empty] --> ; EmptyStatement[emptystatement] --> \; ; StatementExpression[preincrementexpression] --> ; [predecrementexpression] --> ; [primaryexpression] --> ; [plusplus] --> [] ++ ; [minusminus] --> [] -- ; [assignment] --> ; SwitchStatement[switch] --> switch ( ) { } ; SwitchBlocks[label] --> ; [empty] --> ; SwitchLabel[case] --> case : ; [default] --> default : ; IfStatement[ifelse] --> if ( [] [] ) else [+] [-] ; [if] --> if ( [] [] ) ; WhileStatement[while] --> while ( [] [] ) ; DoStatement[do] --> do while ( ) \; [/] ; ForStatement[for] --> for ( [] [] ";" [] ";" [] ) ; ForInitOpt[forinit] --> ; [empty] --> ; ForInit[localvariabledeclaration] --> [] ; [statementexpression] --> ; StatementExpressionList[expressions] --> , ; [expression] --> ; ForUpdateOpt[forupdate] --> ; [empty] --> ; ForUpdate[statementexpressions] --> ; BreakStatement[breakidentifier] --> break [] ";" [/] ; [break] --> break [] ";" [/] ; ContinueStatement[continueidentifier] --> continue [] ";" [/] ; [continue] --> continue [] ";" [/] ; ReturnStatement[returnexpression] --> return [] ";" [/] ; [return] --> return [] ";" [/] ; ThrowStatement[throw] --> throw \; ; SynchronizedStatement[synchronized] --> synchronized ( ) ; TryStatement[tryfinally] --> try finally ; [try] --> try [/] ; Catchblock[catch] --> catch ( [] [] ) ; [empty] --> ; // -- Expression: -------------------------------------------------- ExpressionOpt[expression] --> ; [empty] --> ; Expression[conditionalexpression] --> ; [assignment] --> ; AssignmentOperator --> "=" ; --> "*=" ; --> "/=" ; --> "%=" ; --> "+=" ; --> "-=" ; --> \<\<= ; --> \>\>= ; --> \>\>\>= ; --> "&=" ; --> "^=" ; --> "|=" ; ConditionalExpression[ifexpression] --> ? : ; [conditionalorexpression] --> ; ConditionalOrExpression[expression] --> ; ConditionalOrExpressionRest[rest] --> || ; [empty] --> ; ConditionalAndExpression[expression] --> ; ConditionalAndExpressionRest[rest] --> && ; [empty] --> ; InclusiveOrExpression[expression] --> ; InclusiveOrExpressionRest[expression] --> "|" ; [trap] --> [ ] ; [empty] --> ; ExclusiveOrExpression[expression] --> ; ExclusiveOrExpressionRest[rest] --> ^ ; [empty] --> ; AndExpression[expression] --> ; AndExpressionRest[rest] --> & ; [trap] --> [ ] ; [expty] --> ; EqualityExpression[expression] --> ; EqualityExpressionRest[equalrest] --> == ; [notequalrest] --> != ; [empty] --> ; InstanceOfExpression[instanceof] --> instanceof ; [expression] --> ; RelationalExpression[expression] --> ; RelationalExpressionRest[less] --> \< ; [greater] --> \> ; [lessequal] --> \<= ; [greaterequal] --> \>= ; [empty] --> ; ShiftExpression[expression] --> ; ShiftExpressionRest[leftshift] --> "<<" ; [rightshift] --> ">>" ; [rightshiftzero] --> ">>>" ; [empty] --> ; AdditiveExpression[expression] --> ; AdditiveExpressionRest[plus] --> + ; [minus] --> - ; [empty] --> ; MultiplicativeExpression[expression] --> ; MultiplicativeExpressionRest[multi] --> * ; [division] --> / ; [remainder] --> % ; [empty] --> ; UnaryExpression[plus] --> + ; [minus] --> - ; [preincrement] --> ; [predecrement] --> ; [expression] --> ; PreIncrementExpression[plusplus] --> ++ [] ; PreDecrementExpression[minusminus] --> -- [] ; UnaryExpressionNotPlusMinus[bitwise] --> ~ [] ; [logical] --> ! [] ; [cast] --> [] ; [postfix] --> ; PostfixExpression[plusplus] --> ++ ; [minusminus] --> -- ; [expression] --> ; CastExpression[cast] --> ( [] [] ) ; [castnotplusminus] --> ( [] [] ) ; PrimaryExpression[expression] --> ; PrimaryExpressionRest[rest] --> [] ; [empty] --> ; PrimaryPrefix[literal] --> ; [this] --> this ; [super] --> super [] . [] ; [expresion] --> ( [] [] ) ; [accocation] --> ; [resulttypedotclass] --> [] [] . [] class ; [name] --> ; PrimarySuffix[dotthis] --> .this ; [dotallocation] --> [] . [] ; [expression] --> "[" [] [] "]" ; [dotidentifier] --> [] . [] ; [arguments] --> ; Literal[integerliteral] --> ; [floatingpointliteral] --> ; [characterliteral] --> ; [stringliteral] --> ; [booleanliteral] --> ; [nullliteral] --> ; BooleanLiteral[true] --> true ; [false] --> false ; NullLiteral[null] --> null ; Arguments[argumentlist] --> ( [] [] ) ; [emptyargumentlist] --> ( [] ) ; ArgumentList[expressions] --> [] , ; [expression] --> ; AllocationExpression[primitivetype] --> new [] ; [arraydimsandinits] --> new [] ; [argumentsclassbody] --> new [] ; [arguments] --> new [] ; ArrayDimsAndInits[arraydimsexpressions] --> ; [arraydimsexpression] --> ; [arraydimsinitializer] --> [] ; ArrayDimsExpression[expressions] --> "[" [] [] "]" [] ; [expression] --> "[" [] [] "]" ; ArrayDims[arraydims] --> "[" "]" ; [empty] --> ; // -- Identifier: -------------------------------------------------- Name[name] --> ; SimpleName[simplename] --> ; QualifiedName[qualifiedname] --> [] . [] ; [empty] --> ; IntegerLiteral[decimalliteral] --> ; [hexliteral] --> ; [octalliteral] --> ; // -- Traps and Guards: -------------------------------------------- nonterminal { CaseTrap, AndAndTrap, OrOrTrap, ResultTypeDotClass, ArrayDimsAndInitializer, ConstructorDeclaratorAndDeclaration; } ArrayDimsAndInitializer[guard] --> ; ConstructorDeclaratorAndDeclaration[guard] --> ; ResultTypeDotClass[guard] --> [] . [] class ; CaseTrap[trap] --> case ; AndAndTrap[trap] --> && ; OrOrTrap[trap] --> || ; }