BNF for propagation.jj

TOKENS

<DEFAULT> SKIP : {
" "
| "\t"
| "\n"
| "\r"
| "\r\n"
| <"/*" (~["*"])* "*" ("*" | ~["*","/"] (~["*"])* "*")* "/">
}

   
<DEFAULT> TOKEN : {
<CLASS: "class">
| <MODIFIER: "mod">
| <TYPE: "type">
| <ARGUMENT: "argument">
| <COPY: "copy">
| <LBRACKET: "[">
| <RBRACKET: "]">
| <INIT: "<init>">
| <CLINIT: "<clinit>">
| <QUERY: "query">
| <SUPER: "super">
| <INLINE: "inline">
| <EXCLUDE: "exclude">
| <GEN: "gen">
| <SOURCE: "source">
| <STATICFIELD: "staticfield">
| <COLON: ":">
| <EQUALS: "=">
| <PROPERTIES: "prop">
| <COUNT: "count">
}

   
<DEFAULT> TOKEN : {
<INTEGER: (["+","-"])? (<DIGIT>)+>
| <SHORT_SIGNATURE: <TYPE_DESCRIPTOR> " " ((<LETTER> | <DIGIT>)+ | <INIT> | <CLINIT>) "(" (<TYPE_DESCRIPTOR> | ",")* ")">
| <SIGNATURE: "<" <TYPE_DESCRIPTOR> ": " <SHORT_SIGNATURE> ">">
| <IDENTIFIER: <LETTER> (<LETTER> | <DIGIT> | "_")*>
| <TYPE_DESCRIPTOR: <LETTER> (<LETTER> | <DIGIT> | <IDENTIFIER> | <LBRACKET> | <RBRACKET> | "." | "$")*>
| <STATIC_FIELD_SIGNATURE: "<" <TYPE_DESCRIPTOR> ": " <TYPE_DESCRIPTOR> " " <IDENTIFIER> ">">
| <STRING_LITERAL: "\"" (~["\"","\\","\n","\r"] | "\\" (["n","t","b","r","f","\\","\'","\""] | ["0"-"7"] (["0"-"7"])? | ["0"-"3"] ["0"-"7"] ["0"-"7"] | ["\n","\r"] | "\r\n"))* "\"">
| <#LETTER: ["a"-"z","A"-"Z"]>
| <#DIGIT: ["0"-"9"]>
}

   

NON-TERMINALS

start ::= ( object )+
object ::= <CLASS> classIdentifier "{" classDeclaration "}"
classIdentifier ::= typeDescriptor
classDeclaration ::= ( fieldDeclaration | argument | modifier | copy | superclassDeclaration | query | exclude | source | staticField )*
fieldDeclaration ::= <IDENTIFIER> ( "<" <IDENTIFIER> ">" )? <IDENTIFIER> ( count )? ";"
typeDescriptor ::= ( <TYPE_DESCRIPTOR> | <IDENTIFIER> )
argument ::= <ARGUMENT> <IDENTIFIER> <EQUALS> argumentDeclaration
argumentDeclaration ::= ( argumentWithNumbers | argumentWithoutNumbers )
argumentWithNumbers ::= numbers ( ";" | <COLON> actionAndField ( "," argumentDeclarationElement )* ";" | <COLON> argumentDeclarationElement ( "," argumentDeclarationElement )* ";" )
argumentWithoutNumbers ::= ( field ";" | actionAndField ( "," argumentDeclarationElement )* ";" )
actionAndField ::= actions field ( inlineValues )?
argumentDeclarationElement ::= ( type | properties )
numbers ::= ( singleNumber | multipleNumbers )
singleNumber ::= <INTEGER>
multipleNumbers ::= "(" multipleNumbersElement ( "," multipleNumbersElement )* ")"
multipleNumbersElement ::= <INTEGER>
field ::= <IDENTIFIER>
type ::= <TYPE> typeDescriptor ( <COLON> <IDENTIFIER> )?
inlineValues ::= ( singleInlineValue | multipleInlineValues )
singleInlineValue ::= inlineValue
multipleInlineValues ::= "(" inlineValue ( "," inlineValue )* ")"
inlineValue ::= ( <STRING_LITERAL> | <INTEGER> )
actions ::= ( singleAction | multipleActions )
singleAction ::= <IDENTIFIER>
multipleActions ::= "(" <IDENTIFIER> ( "," <IDENTIFIER> )* ")"
properties ::= <PROPERTIES> ( singleProperty | multipleProperties )
singleProperty ::= inlineValue <COLON> inlineValue
multipleProperties ::= "(" inlineValue <COLON> inlineValue ( "," inlineValue <COLON> inlineValue )* ")"
count ::= "(" <INTEGER> ")"
modifier ::= <MODIFIER> modifierModifier extendedSignature "{" modifierOrQueryOrFieldDeclaration "}"
modifierModifier ::= ( ( <GEN> | <COPY> ) )?
extendedSignature ::= ( queryOrModifierSignature | superclass <COLON> queryShortSignature )
modifierOrQueryOrFieldDeclaration ::= ( ( namedArgument | argumentDeclaration ) )*
namedArgument ::= <ARGUMENT> <IDENTIFIER> ";"
copy ::= <COPY> <SIGNATURE> "{" modifierOrQueryOrFieldDeclaration "}"
query ::= <QUERY> extendedSignature "{" modifierOrQueryOrFieldDeclaration "}"
queryOrModifierSignature ::= <SIGNATURE>
superclassDeclaration ::= <SUPER> <IDENTIFIER> <EQUALS> typeDescriptor ";"
superclass ::= namedSuperclass
namedSuperclass ::= <IDENTIFIER>
queryShortSignature ::= <SHORT_SIGNATURE>
exclude ::= <EXCLUDE> <TYPE_DESCRIPTOR> ";"
source ::= <SOURCE> <SIGNATURE> "{" modifierOrQueryOrFieldDeclaration "}"
staticField ::= <STATICFIELD> ( shortStaticField | extendedStaticField )
shortStaticField ::= <IDENTIFIER> <STATIC_FIELD_SIGNATURE> <EQUALS> inlineValues ";"
extendedStaticField ::= <STATIC_FIELD_SIGNATURE> "{" modifierOrQueryOrFieldDeclaration "}"