| _MultiPhaseTransducer | ::= | ( <multiphase> <ident> )? ( ( ( JavaImportBlock ) ( ( ControllerStartedBlock ) | ( ControllerFinishedBlock ) | ( ControllerAbortedBlock ) )* ( SinglePhaseTransducer )+ ) | ( <phases> ( <path> )+ ) ) <EOF> |
| SinglePhaseTransducer | ::= | <phase> <ident> ( ( <input> ( <ident> )* ) | ( <option> ( <ident> <assign> ( <ident> | <bool> ) )* ) )* ( ( Rule ) | MacroDef | TemplateDef )* |
| JavaImportBlock | ::= | ( <javaimport> <leftBrace> ConsumeBlock )? |
| ControllerStartedBlock | ::= | ( <controllerstarted> <leftBrace> ConsumeBlock ) |
| ControllerFinishedBlock | ::= | ( <controllerfinished> <leftBrace> ConsumeBlock ) |
| ControllerAbortedBlock | ::= | ( <controlleraborted> <leftBrace> ConsumeBlock ) |
| Rule | ::= | <rule> <ident> ( <priority> <integer> )? LeftHandSide "-->" RightHandSide |
| MacroDef | ::= | <macro> <ident> ( PatternElement | Action ) |
| TemplateDef | ::= | <template> <ident> <assign> AttrVal |
| LeftHandSide | ::= | ConstraintGroup |
| ConstraintGroup | ::= | ( PatternElement )+ ( <bar> ( PatternElement )+ )* |
| PatternElement | ::= | ( <ident> | BasicPatternElement | ComplexPatternElement ) |
| BasicPatternElement | ::= | ( ( <leftBrace> Constraint ( <comma> Constraint )* <rightBrace> ) | ( <string> ) ) |
| ComplexPatternElement | ::= | <leftBracket> ConstraintGroup <rightBracket> ( KleeneOperator )? ( <colon> ( <ident> | <integer> ) )? |
| KleeneOperator | ::= | ( <kleeneOp> ) |
| | | ( <leftSquare> ( <integer> ( <comma> <integer> )? ) <rightSquare> ) | |
| Constraint | ::= | ( <pling> )? <ident> ( ( FeatureAccessor <attrOp> AttrVal ) | ( <metaPropOp> <ident> <attrOp> AttrVal ) | ( <ident> ( ( <leftBrace> Constraint <rightBrace> ) | ( Constraint ) ) ) )? |
| FeatureAccessor | ::= | ( <period> <ident> ) |
| AttrVal | ::= | ( ( <string> | <ident> | <integer> | <floatingPoint> | <bool> ) ) |
| | | ( TemplateCall ) | |
| TemplateCall | ::= | <leftSquare> <ident> ( <ident> <assign> AttrVal ( <comma> )? )* <rightSquare> |
| RightHandSide | ::= | Action ( <comma> Action )* |
| Action | ::= | ( NamedJavaBlock | AnonymousJavaBlock | AssignmentExpression | <ident> ) |
| NamedJavaBlock | ::= | <colon> <ident> <leftBrace> ConsumeBlock |
| AnonymousJavaBlock | ::= | <leftBrace> ConsumeBlock |
| AssignmentExpression | ::= | ( <colon> | <colonplus> ) <ident> <period> <ident> <assign> <leftBrace> ( <ident> <assign> ( AttrVal | ( <colon> <ident> ( ( <period> <ident> ( <period> | <metaPropOp> ) <ident> ) | ( <metaPropOp> <ident> ) ) ) ) ( <comma> )? )* <rightBrace> |
| appendSpecials | ::= | java code |
| ConsumeBlock | ::= | java code |