/** formatfrontends/parser/custom.g contains that part of format.g which is specific to ALL of tdom, umod, dynamic java, etc. A SEPARATION into different files is MISSING (FIXME ( )), but requires inheritance among the corresponding tdom models: GenericCompiler.java is currently an specialization of the tdom generated Visitor. */ header { package eu.bandm.tools.formatfrontends.parser ; import eu.bandm.tools.xantlr.* ; } options { dtdMode = tdom ; // not inherited, according to ANTLR documentation. } class Format_custom_parser extends Format_common_parser ; options { defaultErrorHandler = false ; // importVocab = Format_custom_parser ; = default ! } // ----------------------------------------------------- // special for TDOM2Format : public tdomRules : (Whitespace)? (tdomRule)+ ; public tdomRule : t_object Equ pattern Dot (Whitespace)? ; public t_object : ref (t_seq|t_alt|Whitespace)* ; // ----------------------------------------------------- top // must be present and may not be referred !!! // propagates "EOF" to follow-set of "pattern". : pattern ; // ----------------------------------------------------- // special for umod : protected supr : SUPER ; protected clss: Clss ; protected clssUPCASE: CLSS ; protected from: From ; protected too: Too ; protected instanceTest : Is Whitespace ref Whitespace (ref | Thiz) ; // ----------------------------------------------------- // special for TDOM2Format : protected numberedref: ref (Dollar number)? ; protected t_seq: t_LSeq number ; protected t_choice: t_LChoice number ; protected t_alt: t_LChoice number t_LAlt number ; protected t_LSeq: Seq ; protected t_LChoice: Choice ; protected t_LAlt: Alt ; protected t_pcdata: Pcdata ; // ----------------------------------------------------- protected generic_SUBSTRUCTURE_SELECTOR options { xmlNodeType = content ; } : from | too // special for TDOM2Format // ATTENTION alt needs priority because it starts also with a "t_LChoice" !! | numberedref | t_seq | t_alt | t_choice ; protected generic_SUBSTRUCTURE_SELECTOR_NON_AGGREGATE options { xmlNodeType = abstract; } : supr | clss | clssUPCASE | instanceTest | t_pcdata ; protected generic_SWITCH_SELECTOR options { xmlNodeType = content; } : from | too | thiz | clss | clssUPCASE // . ATTENTION alt needs priority because it starts also with a "t_LChoice" !! | numberedref | t_seq | t_alt | t_choice ; // ----------------------------------------------------- class Format_custom_lexer extends Format_common_lexer ; options { importVocab = Format_common_parser ; exportVocab = Format_custom_parser ; } // special for umod SUPER: "$super" ; Clss: "$Class" | "$class" ; CLSS: "$CLASS" ; From: "$from" ; Too: "$to" ; Is: "$is" ; // special for TDOM2Format : Pcdata: "$pcdata" ; Seq: "$S" | "$Seq" ; Choice: "$C" | "$Choice" ; Alt: "$A" | "$Alt" ; Dot: '.' ; Equ: '=' ; Dollar: '$' ; /* eof */