BNF for XTDL2XML.jj (as of 2004-09-03)

NON-TERMINALS

Input ::= Rules
Rules ::= Rule ( Rule )*
Rule ::= <IDENTIFIER> ( <SEPARATOR> | <DR_SEPARATOR> ) Conc <ARROW> toplevelCfsRhs ( <COMMA> <FNMARKER> Functions )? <DOT>
Functions ::= Function ( <COMMA> Function )*
Function ::= ( Coref <EQUALS> )? <IDENTIFIER> <LEFTROUND> ( FnArgs )? <RIGHTROUND>
FnArgs ::= embeddedCfs ( <COMMA> embeddedCfs )*
Seek ::= <SEEK> <LEFTROUND> <IDENTIFIER> <RIGHTROUND>
toplevelCfsLhs ::= toplevelTerm ( <UNIFICATION> toplevelTerm )*
toplevelCfsRhs ::= toplevelTermRhs ( <UNIFICATION> toplevelTermRhs )*
embeddedCfs ::= embeddedTerm ( <UNIFICATION> embeddedTerm )*
toplevelTermRhs ::= ( ( FeatureStructure | List | Type | Coref | Collect ) )
toplevelTerm ::= ( ( <NEG> )? ( FeatureStructure | List | Type | Coref | Collect | Seek ) )
embeddedTerm ::= ( FeatureStructure | List | Type | Coref | Collect | Set )
Coref ::= <COREFMARKER> ( <IDENTIFIER> | <NUMBER> )
Collect ::= ( <COLLECT> ( ( CoName ) | <LEFTCURLY> ( CoName <RIGHTCURLY> ) | <LEFTANGLE> ( CoName <RIGHTANGLE> ) ) )
CoName ::= ( <IDENTIFIER> | <NUMBER> )
Type ::= ( <IDENTIFIER> | <ETC> | <STRING> )
FeatureStructure ::= <LEFTBRACKET> AttrValPair ( <COMMA> AttrValPair )* <RIGHTBRACKET>
AttrValPair ::= <IDENTIFIER> embeddedCfs
Set ::= ( <LEFTCURLY> embeddedCfs ( <COMMA> embeddedCfs )* <RIGHTCURLY> )
List ::= <LEFTANGLE> ( embeddedCfs ( <COMMA> embeddedCfs )* ( <DOT> embeddedCfs )? )? <RIGHTANGLE>
Conc ::= Disj ( Disj )*
Disj ::= Kleene ( <DISJ> Kleene )*
Kleene ::= Element ( ( <PLUS> | <STAR> | <ZERO_ONE> | ( <LEFTCURLY> <NUMBER> ( <COMMA> <NUMBER> )? <RIGHTCURLY> ) ) )?
Element ::= ( toplevelCfsLhs | <LEFTROUND> Conc <RIGHTROUND> )

TOKENS

TOKEN :
{
  < LEFTBRACKET:   "[" > 
| < RIGHTBRACKET:  "]" > 
| < LEFTROUND:     "(" > 
| < RIGHTROUND:    ")" >         
| < LEFTCURLY:     "{" > 
| < RIGHTCURLY:    "}" >
| < LEFTANGLE:     "<" >
| < RIGHTANGLE:    ">" >
| < ARROW:         "->" > 
| < DOT:           "." > 
| < ETC:           "..." > 
| < SEPARATOR:     ":>" > 
| < DR_SEPARATOR:  ":/" > 
| < FNMARKER:      ("where" | "WHERE" | "Where" ) >
| < COMMA:         "," > 
| < EQUALS:        "=" >
| < COREFMARKER:   "#" >
| < COLLECT:       "%" >
| < UNIFICATION:   "&" >
| < DISJ:          "|" > 
| < PLUS:          "+" > 
| < STAR:          "*" > 
| < ZERO_ONE:      "?" > 
| < NEG:           "~" >
| < SEEK:          ("@seek" | "@SEEK")>
| < NUMBER:        (< DIGIT >)+>
| < STRING: "\"" (~["\""] | "\\\"" | "\\\\" )* "\"" >
| < IDENTIFIER: 
       < LETTER >|
       ((< LETTER >|< DIGIT >|< SPECIAL >)+ < SPECIAL > (< LETTER >|< DIGIT >|< SPECIAL >)*) |
       ((< LETTER >|< DIGIT >|< SPECIAL >)* < SPECIAL > (< LETTER >|< DIGIT >|< SPECIAL >)+) |
       ((< LETTER >|< SPECIAL >)+ < DIGIT > (< LETTER >|< DIGIT >|< SPECIAL >)*) |
       ((< LETTER >|< DIGIT >|< SPECIAL >)* < DIGIT > (< LETTER >|< SPECIAL >)+) 
       >

| < #LETTER: ["A" - "Z", "a" - "z", "\u0370" - "\uFFFF"]>
| < #DIGIT: ["0"-"9"] >
| < #SPECIAL: [ "_", "+", "-", "*", "?" ]>
}