options { STATIC = false; JAVA_UNICODE_ESCAPE = true; } PARSER_BEGIN(Parser) package EDU.neu.ccs.demeter.tools.apstudio.graphedit; import java.awt.*; import java.io.*; import java.util.*; import EDU.neu.ccs.demeter.*; import EDU.neu.ccs.demeter.common.tg.*; import EDU.neu.ccs.demeter.*; public class Parser { // oit is uugly. Why isn't there a Character.valueOf(String)? static char unescapifyChar(String s) { char c = s.charAt(0); if (c == '\\') { switch (s.charAt(1)) { case 'n': c = '\n'; break; case 't': c = '\t'; break; case 'b': c = '\b'; break; case 'r': c = '\r'; break; case 'f': c = '\f'; break; case '\\': c = '\\'; break; case '\'': c = '\''; break; case '\"': c = '\"'; break; default: c = (char) Integer.parseInt(s.substring(2, s.length()), 8); break; } } return c; } // Even uglier... static String unescapify(String s) { char str[] = new char[s.length()]; int i = 0, o = 0; while (i < s.length()) { char c = s.charAt(i++); if (c == '\\') { int j = i + 1; while (j < s.length() && Character.digit(s.charAt(j), 8) != -1) { j++; } c = unescapifyChar(s.substring(i-1, j)); i = j; } str[o++] = c; } return String.valueOf(str, 0, o); } } PARSER_END(Parser) UGraph _UGraph() : { UGraph it; Package _pkg; Import_SList _imports; JavaCode _preamble; UVertex_List _vertices; Hashtable _idToVertexTable; UEdge_List _edges; Hashtable _idToEdgeTable; Hashtable _nameToIdVertexTable; UID _firstuid; } { { it=new UGraph(); } "#Class" "#Dictionary" "#Graph" [ _pkg=_Package() { it.set_pkg(_pkg); } ] [ _imports=_Import_SList() { it.set_imports(_imports); } ] [ _preamble=_JavaCode() { it.set_preamble(_preamble); } ] [ _vertices=_UVertex_List() { it.set_vertices(_vertices); } ] _idToVertexTable=_Hashtable() { it.set_idToVertexTable(_idToVertexTable); } [ _edges=_UEdge_List() { it.set_edges(_edges); } ] _idToEdgeTable=_Hashtable() { it.set_idToEdgeTable(_idToEdgeTable); } _nameToIdVertexTable=_Hashtable() { it.set_nameToIdVertexTable(_nameToIdVertexTable); } [ _firstuid=_UID() { it.set_firstuid(_firstuid); } ] { return it; } } UVertex_List _UVertex_List() : { UVertex_List it; Nonempty_UVertex_List _first; } { { it=new UVertex_List(); } "#Vertex" "#List" _first=_Nonempty_UVertex_List() { it.set_first(_first); } { return it; } } UVertex _UVertex() : { UVertex it; } { ( it=_UConstOrAltVertex() | it=_UTerm() | it=_UInterface() ) { return it; } } void common_UVertex(UVertex it) : { UID _vid; UVertexName _vertexname; Coordinates _position; IEdge_List _incoming; OEdge_List _outgoing; Vector _inArcIdList; Vector _outArcIdList; Decorator _vdeco; TGVertex _tgv; Perspective _persp; } { _vid=_UID() { it.set_vid(_vid); } _vertexname=_UVertexName() { it.set_vertexname(_vertexname); } _position=_Coordinates() { it.set_position(_position); } [ _incoming=_IEdge_List() { it.set_incoming(_incoming); } ] [ _outgoing=_OEdge_List() { it.set_outgoing(_outgoing); } ] _inArcIdList=_Vector() { it.set_inArcIdList(_inArcIdList); } _outArcIdList=_Vector() { it.set_outArcIdList(_outArcIdList); } [ _vdeco=_Decorator() { it.set_vdeco(_vdeco); } ] _tgv=_TGVertex() { it.set_tgv(_tgv); } _persp=_Perspective() { it.set_persp(_persp); } { } } UConstOrAltVertex _UConstOrAltVertex() : { UConstOrAltVertex it; } { ( it=_UConstVertex() | it=_UAltVertex() ) { return it; } } void common_UConstOrAltVertex(UConstOrAltVertex it) : { ParseOrNot _parse; Vector _outEdgeNameList; ScopeIdentifier_List _keywords; } { _parse=_ParseOrNot() { it.set_parse(_parse); } _outEdgeNameList=_Vector() { it.set_outEdgeNameList(_outEdgeNameList); } [ _keywords=_ScopeIdentifier_List() { it.set_keywords(_keywords); } ] { common_UVertex(it); } { } } ParseOrNot _ParseOrNot() : { ParseOrNot it; } { ( it=_YaParse() | it=_NopParse() ) { return it; } } void common_ParseOrNot(ParseOrNot it) : { } { { } } YaParse _YaParse() : { YaParse it; } { { it=new YaParse(); } "#parse" { common_ParseOrNot(it); } { return it; } } NopParse _NopParse() : { NopParse it; } { { it=new NopParse(); } "#noparse" { common_ParseOrNot(it); } { return it; } } UTerm _UTerm() : { UTerm it; } { ( it=_UTermConstVertex() | it=_UTermInterface() ) { return it; } } void common_UTerm(UTerm it) : { } { { common_UVertex(it); } { } } IEdge_List _IEdge_List() : { IEdge_List it; Nonempty_IEdge_List _first; } { { it=new IEdge_List(); } "#Incoming" _first=_Nonempty_IEdge_List() { it.set_first(_first); } { return it; } } OEdge_List _OEdge_List() : { OEdge_List it; Nonempty_OEdge_List _first; } { { it=new OEdge_List(); } "#Outgoing" _first=_Nonempty_OEdge_List() { it.set_first(_first); } { return it; } } UConstVertex _UConstVertex() : { UConstVertex it; UBefore _beFore; UAfter _afTer; } { { it=new UConstVertex(); } "#ConstVertex" [ _beFore=_UBefore() { it.set_beFore(_beFore); } ] [ _afTer=_UAfter() { it.set_afTer(_afTer); } ] { common_UConstOrAltVertex(it); } { return it; } } UBefore _UBefore() : { UBefore it; String _syntax; } { { it=new UBefore(); } "#Before" _syntax=_String() { it.set_syntax(_syntax); } { return it; } } UAfter _UAfter() : { UAfter it; String _syntax; } { { it=new UAfter(); } "#After" _syntax=_String() { it.set_syntax(_syntax); } { return it; } } UAltVertex _UAltVertex() : { UAltVertex it; } { { it=new UAltVertex(); } "#AltVertex" { common_UConstOrAltVertex(it); } { return it; } } UInterface _UInterface() : { UInterface it; InterfaceModifier_List _keywords; JavaCode _javacode; } { { it=new UInterface(); } "#Interface" [ _keywords=_InterfaceModifier_List() { it.set_keywords(_keywords); } ] _javacode=_JavaCode() { it.set_javacode(_javacode); } { common_UVertex(it); } { return it; } } InterfaceModifier_List _InterfaceModifier_List() : { InterfaceModifier_List it; Nonempty_InterfaceModifier_List _first; } { { it=new InterfaceModifier_List(); } _first=_Nonempty_InterfaceModifier_List() { it.set_first(_first); } { return it; } } InterfaceModifier _InterfaceModifier() : { InterfaceModifier it; } { ( it=_PublicModifier() ) { return it; } } void common_InterfaceModifier(InterfaceModifier it) : { } { { } } PublicModifier _PublicModifier() : { PublicModifier it; } { { it=new PublicModifier(); } "#public" { common_InterfaceModifier(it); } { return it; } } UTermConstVertex _UTermConstVertex() : { UTermConstVertex it; } { { it=new UTermConstVertex(); } "#TermConstVertex" { common_UTerm(it); } { return it; } } UTermInterface _UTermInterface() : { UTermInterface it; } { { it=new UTermInterface(); } "#TermInterface" { common_UTerm(it); } { return it; } } ScopeIdentifier_List _ScopeIdentifier_List() : { ScopeIdentifier_List it; Nonempty_ScopeIdentifier_List _first; } { { it=new ScopeIdentifier_List(); } _first=_Nonempty_ScopeIdentifier_List() { it.set_first(_first); } { return it; } } ScopeIdentifier _ScopeIdentifier() : { ScopeIdentifier it; } { ( it=_PublicIdentifier() | it=_FinalIdentifier() ) { return it; } } void common_ScopeIdentifier(ScopeIdentifier it) : { } { { } } PublicIdentifier _PublicIdentifier() : { PublicIdentifier it; } { { it=new PublicIdentifier(); } "#public" { common_ScopeIdentifier(it); } { return it; } } FinalIdentifier _FinalIdentifier() : { FinalIdentifier it; } { { it=new FinalIdentifier(); } "#final" { common_ScopeIdentifier(it); } { return it; } } UEdge_List _UEdge_List() : { UEdge_List it; Nonempty_UEdge_List _first; } { { it=new UEdge_List(); } "#Edge" "#List" _first=_Nonempty_UEdge_List() { it.set_first(_first); } { return it; } } UEdge _UEdge() : { UEdge it; } { ( it=_USuperEdge() | it=_UConstEdge() ) { return it; } } void common_UEdge(UEdge it) : { UID _eid; UID _fromVertex; UID _toVertex; Decorator _edeco; BendPoint _bendpoint; ArcPerspective _persp; } { _eid=_UID() { it.set_eid(_eid); } _fromVertex=_UID() { it.set_fromVertex(_fromVertex); } _toVertex=_UID() { it.set_toVertex(_toVertex); } [ _edeco=_Decorator() { it.set_edeco(_edeco); } ] [ _bendpoint=_BendPoint() { it.set_bendpoint(_bendpoint); } ] _persp=_ArcPerspective() { it.set_persp(_persp); } { } } USuperEdge _USuperEdge() : { USuperEdge it; } { ( it=_UAltEdge() | it=_UExtendEdge() | it=_UImplEdge() ) { return it; } } void common_USuperEdge(USuperEdge it) : { } { { common_UEdge(it); } { } } BendPoint _BendPoint() : { BendPoint it; Coordinates _position; } { { it=new BendPoint(); } _position=_Coordinates() { it.set_position(_position); } { return it; } } UAltEdge _UAltEdge() : { UAltEdge it; TGAEdge _tge; } { { it=new UAltEdge(); } "#AltEdge" _tge=_TGAEdge() { it.set_tge(_tge); } { common_USuperEdge(it); } { return it; } } UExtendEdge _UExtendEdge() : { UExtendEdge it; TGAEdge _tge; } { { it=new UExtendEdge(); } "#ExtendEdge" _tge=_TGAEdge() { it.set_tge(_tge); } { common_USuperEdge(it); } { return it; } } UImplEdge _UImplEdge() : { UImplEdge it; TGIEdge _tge; } { { it=new UImplEdge(); } "#ImplEdge" _tge=_TGIEdge() { it.set_tge(_tge); } { common_USuperEdge(it); } { return it; } } UConstEdge _UConstEdge() : { UConstEdge it; UEdgeName _edgename; Cardinality _card; UBefore _beFore; UAfter _afTer; PartModifier_List _keywords; TGCEdge _tge; } { { it=new UConstEdge(); } "#ConstEdge" [ _edgename=_UEdgeName() { it.set_edgename(_edgename); } ] _card=_Cardinality() { it.set_card(_card); } [ _beFore=_UBefore() { it.set_beFore(_beFore); } ] [ _afTer=_UAfter() { it.set_afTer(_afTer); } ] [ _keywords=_PartModifier_List() { it.set_keywords(_keywords); } ] _tge=_TGCEdge() { it.set_tge(_tge); } { common_UEdge(it); } { return it; } } PartModifier_List _PartModifier_List() : { PartModifier_List it; Nonempty_PartModifier_List _first; } { { it=new PartModifier_List(); } _first=_Nonempty_PartModifier_List() { it.set_first(_first); } { return it; } } PartModifier _PartModifier() : { PartModifier it; } { ( it=_FinalMod() | it=_StaticMod() | it=_ReadOnlyMod() | it=_PrivateMod() ) { return it; } } void common_PartModifier(PartModifier it) : { } { { } } FinalMod _FinalMod() : { FinalMod it; } { { it=new FinalMod(); } "#final" { common_PartModifier(it); } { return it; } } StaticMod _StaticMod() : { StaticMod it; } { { it=new StaticMod(); } "#static" { common_PartModifier(it); } { return it; } } ReadOnlyMod _ReadOnlyMod() : { ReadOnlyMod it; } { { it=new ReadOnlyMod(); } "#read-only" { common_PartModifier(it); } { return it; } } PrivateMod _PrivateMod() : { PrivateMod it; } { { it=new PrivateMod(); } "#private" { common_PartModifier(it); } { return it; } } Cardinality _Cardinality() : { Cardinality it; Lower _lower; Upper _upper; } { { it=new Cardinality(); } "#Cardinality" _lower=_Lower() { it.set_lower(_lower); } [ _upper=_Upper() { it.set_upper(_upper); } ] { return it; } } Lower _Lower() : { Lower it; Integer _l; } { { it=new Lower(); } _l=_Integer() { it.set_l(_l); } { return it; } } Upper _Upper() : { Upper it; String _u; } { { it=new Upper(); } "." "." _u=_String() { it.set_u(_u); } { return it; } } UID _UID() : { UID it; Integer _id; } { { it=new UID(); } _id=_Integer() { it.set_id(_id); } { return it; } } UEdgeName _UEdgeName() : { UEdgeName it; Ident _name; } { { it=new UEdgeName(); } _name=_Ident() { it.set_name(_name); } { return it; } } UVertexName _UVertexName() : { UVertexName it; Ident _name; } { { it=new UVertexName(); } _name=_Ident() { it.set_name(_name); } { return it; } } Coordinates _Coordinates() : { Coordinates it; X _x; Y _y; } { { it=new Coordinates(); } "{" _x=_X() { it.set_x(_x); } _y=_Y() { it.set_y(_y); } "}" { return it; } } X _X() : { X it; Integer _x; } { { it=new X(); } _x=_Integer() { it.set_x(_x); } { return it; } } Y _Y() : { Y it; Integer _y; } { { it=new Y(); } _y=_Integer() { it.set_y(_y); } { return it; } } Decorator _Decorator() : { Decorator it; Integer _travtag; Vector _travtaglist; } { { it=new Decorator(); } "travstat" _travtag=_Integer() { it.set_travtag(_travtag); } _travtaglist=_Vector() { it.set_travtaglist(_travtaglist); } { return it; } } UniqueIDGenerator _UniqueIDGenerator() : { UniqueIDGenerator it; } { { it=new UniqueIDGenerator(); } { return it; } } Program _Program() : { Program it; GlobalImports _globalimports; ClassGraph _cg; } { { it=new Program(); } _globalimports=_GlobalImports() { it.set_globalimports(_globalimports); } _cg=_ClassGraph() { it.set_cg(_cg); } { return it; } } GlobalImports _GlobalImports() : { GlobalImports it; Import_SList _imports; } { { it=new GlobalImports(); } [ _imports=_Import_SList() { it.set_imports(_imports); } ] { return it; } } Import _Import() : { Import it; PackageName _packagename; ImportAllClasses _importallclasses; } { { it=new Import(); } "import" _packagename=_PackageName() { it.set_packagename(_packagename); } [ _importallclasses=_ImportAllClasses() { it.set_importallclasses(_importallclasses); } ] ";" { return it; } } ImportAllClasses _ImportAllClasses() : { ImportAllClasses it; } { { it=new ImportAllClasses(); } ".*" { return it; } } ClassGraph _ClassGraph() : { ClassGraph it; Hashtable _defdict; ClassGraphEntry_DList _classes; TraversalGraph _tg; } { { it=new ClassGraph(); } _defdict=_Hashtable() { it.set_defdict(_defdict); } _classes=_ClassGraphEntry_DList() { it.set_classes(_classes); } [ "tg:" _tg=_TraversalGraph() { it.set_tg(_tg); } ] { return it; } } ClassGraphEntry _ClassGraphEntry() : { ClassGraphEntry it; } { ( it=_Directive() | it=_Definition() ) { return it; } } void common_ClassGraphEntry(ClassGraphEntry it) : { } { { } } Directive _Directive() : { Directive it; } { ( it=_ParseDirective() | it=_VisitorDirective() | it=_PackageDirective() ) { return it; } } void common_Directive(Directive it) : { } { { common_ClassGraphEntry(it); } { } } ParseDirective _ParseDirective() : { ParseDirective it; ParseKeyword _parsekeyword; } { { it=new ParseDirective(); } _parsekeyword=_ParseKeyword() { it.set_parsekeyword(_parsekeyword); } { common_Directive(it); } { return it; } } VisitorDirective _VisitorDirective() : { VisitorDirective it; VisitorKeyword _visitorkeyword; } { { it=new VisitorDirective(); } _visitorkeyword=_VisitorKeyword() { it.set_visitorkeyword(_visitorkeyword); } { common_Directive(it); } { return it; } } PackageDirective _PackageDirective() : { PackageDirective it; Package _pkg; LocalImports _localimports; } { { it=new PackageDirective(); } _pkg=_Package() { it.set_pkg(_pkg); } _localimports=_LocalImports() { it.set_localimports(_localimports); } { common_Directive(it); } { return it; } } Package _Package() : { Package it; PackageName _packagename; } { { it=new Package(); } "package" _packagename=_PackageName() { it.set_packagename(_packagename); } ";" { return it; } } LocalImports _LocalImports() : { LocalImports it; Import_SList _imports; } { { it=new LocalImports(); } [ _imports=_Import_SList() { it.set_imports(_imports); } ] { return it; } } Definition _Definition() : { Definition it; } { ( it=_ClassDef() ) { return it; } } void common_Definition(Definition it) : { } { { common_ClassGraphEntry(it); } { } } ClassDef _ClassDef() : { ClassDef it; ClassKeyword_List _keywords; ParamClassName _paramclassname; ParseDirective _parsedirective; ClassParts _classparts; ClassMethods _classmethods; EOFtoken _eoftoken; } { { it=new ClassDef(); } _keywords=_ClassKeyword_List() { it.set_keywords(_keywords); } _paramclassname=_ParamClassName() { it.set_paramclassname(_paramclassname); } [ _parsedirective=_ParseDirective() { it.set_parsedirective(_parsedirective); } ] _classparts=_ClassParts() { it.set_classparts(_classparts); } [ _classmethods=_ClassMethods() { it.set_classmethods(_classmethods); } ] [ _eoftoken=_EOFtoken() { it.set_eoftoken(_eoftoken); } ] "." { common_Definition(it); } { return it; } } ParamClassName _ParamClassName() : { ParamClassName it; ClassName _classname; ClassName_Commalist _parameters; } { { it=new ParamClassName(); } _classname=_ClassName() { it.set_classname(_classname); } [ "(" _parameters=_ClassName_Commalist() { it.set_parameters(_parameters); } ")" ] { return it; } } ClassParts _ClassParts() : { ClassParts it; } { ( it=_ConstOrAltClass() | it=_RepetitionClass() ) { return it; } } void common_ClassParts(ClassParts it) : { } { { } } ConstOrAltClass _ConstOrAltClass() : { ConstOrAltClass it; } { ( it=_ConstructionClass() | it=_AlternationClass() ) { return it; } } void common_ConstOrAltClass(ConstOrAltClass it) : { PartOrSyntax_List _parts; ClassParents _parents; } { _parts=_PartOrSyntax_List() { it.set_parts(_parts); } _parents=_ClassParents() { it.set_parents(_parents); } { common_ClassParts(it); } { } } PartOrSyntax _PartOrSyntax() : { PartOrSyntax it; } { ( it=_Part() | it=_OptionalPart() | it=_Syntax() ) { return it; } } void common_PartOrSyntax(PartOrSyntax it) : { } { { } } Part _Part() : { Part it; PartName _partname; PartKeyword_List _keywords; ClassSpec _classspec; PartInit _partinit; } { { it=new Part(); } [ "<" _partname=_PartName() { it.set_partname(_partname); } ">" ] _keywords=_PartKeyword_List() { it.set_keywords(_keywords); } _classspec=_ClassSpec() { it.set_classspec(_classspec); } [ _partinit=_PartInit() { it.set_partinit(_partinit); } ] { common_PartOrSyntax(it); } { return it; } } PartInit _PartInit() : { PartInit it; PartInitKeyword _partinitkeyword; JavaCode _javacode; } { { it=new PartInit(); } _partinitkeyword=_PartInitKeyword() { it.set_partinitkeyword(_partinitkeyword); } _javacode=_JavaCode() { it.set_javacode(_javacode); } { return it; } } OptionalPart _OptionalPart() : { OptionalPart it; LocalLookahead _locallookahead; Part_Sandwich _part; } { { it=new OptionalPart(); } "[" [ _locallookahead=_LocalLookahead() { it.set_locallookahead(_locallookahead); } ] _part=_Part_Sandwich() { it.set_part(_part); } "]" { common_PartOrSyntax(it); } { return it; } } ClassParents _ClassParents() : { ClassParents it; Superclasses _superclasses; Interfaces _interfaces; } { { it=new ClassParents(); } [ _superclasses=_Superclasses() { it.set_superclasses(_superclasses); } ] [ _interfaces=_Interfaces() { it.set_interfaces(_interfaces); } ] { return it; } } Superclasses _Superclasses() : { Superclasses it; ExtendsKeyword _extendskeyword; Superclass_Commalist _superclasses; } { { it=new Superclasses(); } _extendskeyword=_ExtendsKeyword() { it.set_extendskeyword(_extendskeyword); } _superclasses=_Superclass_Commalist() { it.set_superclasses(_superclasses); } { return it; } } Superclass _Superclass() : { Superclass it; ClassSpec _classspec; } { { it=new Superclass(); } _classspec=_ClassSpec() { it.set_classspec(_classspec); } { return it; } } Interfaces _Interfaces() : { Interfaces it; ImplementsKeyword _implementskeyword; Interface_Commalist _interfaces; } { { it=new Interfaces(); } _implementskeyword=_ImplementsKeyword() { it.set_implementskeyword(_implementskeyword); } _interfaces=_Interface_Commalist() { it.set_interfaces(_interfaces); } { return it; } } Interface _Interface() : { Interface it; ClassSpec _classspec; } { { it=new Interface(); } _classspec=_ClassSpec() { it.set_classspec(_classspec); } { return it; } } ConstructionClass _ConstructionClass() : { ConstructionClass it; } { { it=new ConstructionClass(); } "=" { common_ConstOrAltClass(it); } { return it; } } AlternationClass _AlternationClass() : { AlternationClass it; Subclass_Barlist _subclasses; CommonKeyword _commonkeyword; } { { it=new AlternationClass(); } ":" [ LOOKAHEAD ( _Subclass() ) _subclasses=_Subclass_Barlist() { it.set_subclasses(_subclasses); } ] [ _commonkeyword=_CommonKeyword() { it.set_commonkeyword(_commonkeyword); } ] { common_ConstOrAltClass(it); } { return it; } } Subclass _Subclass() : { Subclass it; LocalLookahead _locallookahead; ClassSpec _classspec; } { { it=new Subclass(); } [ _locallookahead=_LocalLookahead() { it.set_locallookahead(_locallookahead); } ] _classspec=_ClassSpec() { it.set_classspec(_classspec); } { return it; } } LocalLookahead _LocalLookahead() : { LocalLookahead it; LookaheadKeyword _lookaheadkeyword; JavaCode _javacode; } { { it=new LocalLookahead(); } _lookaheadkeyword=_LookaheadKeyword() { it.set_lookaheadkeyword(_lookaheadkeyword); } _javacode=_JavaCode() { it.set_javacode(_javacode); } { return it; } } RepetitionClass _RepetitionClass() : { RepetitionClass it; RepeatedPart_Sandwich _sandwiched; } { { it=new RepetitionClass(); } "~" _sandwiched=_RepeatedPart_Sandwich() { it.set_sandwiched(_sandwiched); } { common_ClassParts(it); } { return it; } } RepeatedPart _RepeatedPart() : { RepeatedPart it; ClassSpec _nonempty; LocalLookahead _locallookahead; ClassSpec_Sandwich _repeated; } { { it=new RepeatedPart(); } [ _nonempty=_ClassSpec() { it.set_nonempty(_nonempty); } ] "{" [ _locallookahead=_LocalLookahead() { it.set_locallookahead(_locallookahead); } ] _repeated=_ClassSpec_Sandwich() { it.set_repeated(_repeated); } "}" { return it; } } ClassSpec _ClassSpec() : { ClassSpec it; ClassName _classname; ClassSpec_Commalist _actual_parameters; } { { it=new ClassSpec(); } _classname=_ClassName() { it.set_classname(_classname); } [ "(" _actual_parameters=_ClassSpec_Commalist() { it.set_actual_parameters(_actual_parameters); } ")" ] { return it; } } Syntax _Syntax() : { Syntax it; } { ( it=_PlainSyntax() | it=_PrintCommand() ) { return it; } } void common_Syntax(Syntax it) : { } { { common_PartOrSyntax(it); } { } } PlainSyntax _PlainSyntax() : { PlainSyntax it; String _string; } { { it=new PlainSyntax(); } _string=_String() { it.set_string(_string); } { common_Syntax(it); } { return it; } } PrintCommand _PrintCommand() : { PrintCommand it; } { ( it=_PrintIndent() | it=_PrintUnindent() | it=_PrintSkip() | it=_PrintSpace() ) { return it; } } void common_PrintCommand(PrintCommand it) : { } { { common_Syntax(it); } { } } PrintIndent _PrintIndent() : { PrintIndent it; } { { it=new PrintIndent(); } "+" { common_PrintCommand(it); } { return it; } } PrintUnindent _PrintUnindent() : { PrintUnindent it; } { { it=new PrintUnindent(); } "-" { common_PrintCommand(it); } { return it; } } PrintSkip _PrintSkip() : { PrintSkip it; } { { it=new PrintSkip(); } "*l" { common_PrintCommand(it); } { return it; } } PrintSpace _PrintSpace() : { PrintSpace it; } { { it=new PrintSpace(); } "*s" { common_PrintCommand(it); } { return it; } } EOFtoken _EOFtoken() : { EOFtoken it; } { { it=new EOFtoken(); } "*EOF*" { return it; } } ProgramBehavior _ProgramBehavior() : { ProgramBehavior it; Behavior_DList _behavior; } { { it=new ProgramBehavior(); } [ _behavior=_Behavior_DList() { it.set_behavior(_behavior); } ] { return it; } } Behavior _Behavior() : { Behavior it; } { ( it=_StrategyDefinition() | it=_ClassBehavior() ) { return it; } } void common_Behavior(Behavior it) : { } { { } } StrategyDefinition _StrategyDefinition() : { StrategyDefinition it; StrategyName _strategyname; StrategyExpression _exp; } { { it=new StrategyDefinition(); } "strategy" _strategyname=_StrategyName() { it.set_strategyname(_strategyname); } "=" _exp=_StrategyExpression() { it.set_exp(_exp); } "." { common_Behavior(it); } { return it; } } StrategyExpression _StrategyExpression() : { StrategyExpression it; } { ( it=_StrategyGraph() | it=_PathDirective() | it=_StrategyVariable() | it=_CompoundStrategy() ) { return it; } } void common_StrategyExpression(StrategyExpression it) : { } { { } } StrategyGraph _StrategyGraph() : { StrategyGraph it; Vector _edgeVec; SGEdge_SList _edges; ClassGlobSpec _sources; Integer_NList _sourceEdges; ClassGlobSpec _targets; } { { it=new StrategyGraph(); } "{" [ "vec:" _edgeVec=_Vector() { it.set_edgeVec(_edgeVec); } ] _edges=_SGEdge_SList() { it.set_edges(_edges); } "}" [ "source:" _sources=_ClassGlobSpec() { it.set_sources(_sources); } ] [ "source-edge:" _sourceEdges=_Integer_NList() { it.set_sourceEdges(_sourceEdges); } ] [ "target:" _targets=_ClassGlobSpec() { it.set_targets(_targets); } ] { common_StrategyExpression(it); } { return it; } } SGEdge _SGEdge() : { SGEdge it; ClassGlobSpec _source; ClassGlobSpec _dest; NegativeConstraint _constraint; } { { it=new SGEdge(); } _source=_ClassGlobSpec() { it.set_source(_source); } "->" _dest=_ClassGlobSpec() { it.set_dest(_dest); } [ _constraint=_NegativeConstraint() { it.set_constraint(_constraint); } ] { return it; } } PathDirective _PathDirective() : { PathDirective it; NegativeConstraint _constraint; PathSegment_List _segments; TargetDirective _targetdirective; } { { it=new PathDirective(); } [ _constraint=_NegativeConstraint() { it.set_constraint(_constraint); } ] _segments=_PathSegment_List() { it.set_segments(_segments); } _targetdirective=_TargetDirective() { it.set_targetdirective(_targetdirective); } { common_StrategyExpression(it); } { return it; } } PathSegment _PathSegment() : { PathSegment it; PositiveConstraint _node; NegativeConstraint _constraint; } { { it=new PathSegment(); } _node=_PositiveConstraint() { it.set_node(_node); } [ _constraint=_NegativeConstraint() { it.set_constraint(_constraint); } ] { return it; } } Constraint _Constraint() : { Constraint it; } { ( it=_PositiveConstraint() | it=_NegativeConstraint() ) { return it; } } void common_Constraint(Constraint it) : { GlobSpec _glob; } { _glob=_GlobSpec() { it.set_glob(_glob); } { } } PositiveConstraint _PositiveConstraint() : { PositiveConstraint it; } { ( it=_Through() | it=_Via() ) { return it; } } void common_PositiveConstraint(PositiveConstraint it) : { } { { common_Constraint(it); } { } } Through _Through() : { Through it; } { { it=new Through(); } "through" { common_PositiveConstraint(it); } { return it; } } Via _Via() : { Via it; } { { it=new Via(); } "via" { common_PositiveConstraint(it); } { return it; } } NegativeConstraint _NegativeConstraint() : { NegativeConstraint it; } { ( it=_Bypassing() | it=_OnlyThrough() ) { return it; } } void common_NegativeConstraint(NegativeConstraint it) : { } { { common_Constraint(it); } { } } Bypassing _Bypassing() : { Bypassing it; } { { it=new Bypassing(); } "bypassing" { common_NegativeConstraint(it); } { return it; } } OnlyThrough _OnlyThrough() : { OnlyThrough it; } { { it=new OnlyThrough(); } "only-through" { common_NegativeConstraint(it); } { return it; } } TargetDirective _TargetDirective() : { TargetDirective it; } { ( it=_To() | it=_ToStop() ) { return it; } } void common_TargetDirective(TargetDirective it) : { ClassGlobSpec _targets; } { _targets=_ClassGlobSpec() { it.set_targets(_targets); } { } } To _To() : { To it; } { { it=new To(); } "to" { common_TargetDirective(it); } { return it; } } ToStop _ToStop() : { ToStop it; } { { it=new ToStop(); } "to-stop" { common_TargetDirective(it); } { return it; } } StrategyVariable _StrategyVariable() : { StrategyVariable it; StrategyName _strategyname; } { { it=new StrategyVariable(); } "do" _strategyname=_StrategyName() { it.set_strategyname(_strategyname); } { common_StrategyExpression(it); } { return it; } } CompoundStrategy _CompoundStrategy() : { CompoundStrategy it; } { ( it=_Join() | it=_Merge() | it=_Intersect() ) { return it; } } void common_CompoundStrategy(CompoundStrategy it) : { StrategyExpression_Commalist _args; } { "(" _args=_StrategyExpression_Commalist() { it.set_args(_args); } ")" { common_StrategyExpression(it); } { } } Join _Join() : { Join it; } { { it=new Join(); } "join" { common_CompoundStrategy(it); } { return it; } } Merge _Merge() : { Merge it; } { { it=new Merge(); } "merge" { common_CompoundStrategy(it); } { return it; } } Intersect _Intersect() : { Intersect it; } { { it=new Intersect(); } "intersect" { common_CompoundStrategy(it); } { return it; } } GlobSpec _GlobSpec() : { GlobSpec it; } { ( it=_OneGlob() | it=_GlobSet() ) { return it; } } void common_GlobSpec(GlobSpec it) : { } { { common_HostSpec(it); } { } } OneGlob _OneGlob() : { OneGlob it; Glob _glob; } { { it=new OneGlob(); } _glob=_Glob() { it.set_glob(_glob); } { common_GlobSpec(it); } { return it; } } GlobSet _GlobSet() : { GlobSet it; Glob_Commalist _globs; } { { it=new GlobSet(); } "{" [ _globs=_Glob_Commalist() { it.set_globs(_globs); } ] "}" { common_GlobSpec(it); } { return it; } } Glob _Glob() : { Glob it; } { ( it=_ClassGlob() | it=_EdgeGlob() ) { return it; } } void common_Glob(Glob it) : { } { { } } EdgeGlob _EdgeGlob() : { EdgeGlob it; } { ( it=_PartGlob() | it=_SubclassGlob() | it=_SuperclassGlob() ) { return it; } } void common_EdgeGlob(EdgeGlob it) : { } { { common_Glob(it); } { } } ClassGlob _ClassGlob() : { ClassGlob it; ClassNameGlob _name; } { { it=new ClassGlob(); } _name=_ClassNameGlob() { it.set_name(_name); } { common_Glob(it); } { return it; } } PartGlob _PartGlob() : { PartGlob it; SourceGlob _source; PartNameGlob _name; DestGlob _dest; } { { it=new PartGlob(); } "->" _source=_SourceGlob() { it.set_source(_source); } "," _name=_PartNameGlob() { it.set_name(_name); } "," _dest=_DestGlob() { it.set_dest(_dest); } { common_EdgeGlob(it); } { return it; } } SubclassGlob _SubclassGlob() : { SubclassGlob it; SourceGlob _source; DestGlob _dest; } { { it=new SubclassGlob(); } "=>" _source=_SourceGlob() { it.set_source(_source); } "," _dest=_DestGlob() { it.set_dest(_dest); } { common_EdgeGlob(it); } { return it; } } SuperclassGlob _SuperclassGlob() : { SuperclassGlob it; SourceGlob _source; DestGlob _dest; } { { it=new SuperclassGlob(); } ":>" _source=_SourceGlob() { it.set_source(_source); } "," _dest=_DestGlob() { it.set_dest(_dest); } { common_EdgeGlob(it); } { return it; } } SourceGlob _SourceGlob() : { SourceGlob it; ClassNameGlob _name; } { { it=new SourceGlob(); } _name=_ClassNameGlob() { it.set_name(_name); } { return it; } } DestGlob _DestGlob() : { DestGlob it; ClassNameGlob _name; } { { it=new DestGlob(); } _name=_ClassNameGlob() { it.set_name(_name); } { return it; } } ClassNameGlob _ClassNameGlob() : { ClassNameGlob it; } { ( it=_ClassNameExact() | it=_AnyClass() ) { return it; } } void common_ClassNameGlob(ClassNameGlob it) : { } { { } } ClassNameExact _ClassNameExact() : { ClassNameExact it; ClassName _classname; } { { it=new ClassNameExact(); } _classname=_ClassName() { it.set_classname(_classname); } { common_ClassNameGlob(it); } { return it; } } AnyClass _AnyClass() : { AnyClass it; } { { it=new AnyClass(); } "*" { common_ClassNameGlob(it); } { return it; } } PartNameGlob _PartNameGlob() : { PartNameGlob it; } { ( it=_PartNameExact() | it=_AnyPart() ) { return it; } } void common_PartNameGlob(PartNameGlob it) : { } { { } } PartNameExact _PartNameExact() : { PartNameExact it; PartName _partname; } { { it=new PartNameExact(); } _partname=_PartName() { it.set_partname(_partname); } { common_PartNameGlob(it); } { return it; } } AnyPart _AnyPart() : { AnyPart it; } { { it=new AnyPart(); } "*" { common_PartNameGlob(it); } { return it; } } ClassGlobSpec _ClassGlobSpec() : { ClassGlobSpec it; } { ( it=_OneClassGlob() | it=_ClassGlobSet() ) { return it; } } void common_ClassGlobSpec(ClassGlobSpec it) : { } { { } } OneClassGlob _OneClassGlob() : { OneClassGlob it; ClassGlob _classglob; } { { it=new OneClassGlob(); } _classglob=_ClassGlob() { it.set_classglob(_classglob); } { common_ClassGlobSpec(it); } { return it; } } ClassGlobSet _ClassGlobSet() : { ClassGlobSet it; ClassGlob_Commalist _globs; } { { it=new ClassGlobSet(); } "{" _globs=_ClassGlob_Commalist() { it.set_globs(_globs); } "}" { common_ClassGlobSpec(it); } { return it; } } ClassBehavior _ClassBehavior() : { ClassBehavior it; ClassGlobSpec _classes; ClassMethods _methods; } { { it=new ClassBehavior(); } _classes=_ClassGlobSpec() { it.set_classes(_classes); } _methods=_ClassMethods() { it.set_methods(_methods); } { common_Behavior(it); } { return it; } } ClassMethods _ClassMethods() : { ClassMethods it; Method_SList _methods; Hashtable _wrapperdict; } { { it=new ClassMethods(); } "{" [ _methods=_Method_SList() { it.set_methods(_methods); } ] "}" [ "wrappers:" _wrapperdict=_Hashtable() { it.set_wrapperdict(_wrapperdict); } ] { return it; } } HostSet _HostSet() : { HostSet it; Hashtable _exactHosts; Hashtable _partnames; GlobSet _globs; } { { it=new HostSet(); } [ "exact:" _exactHosts=_Hashtable() { it.set_exactHosts(_exactHosts); } ] [ "partnames:" _partnames=_Hashtable() { it.set_partnames(_partnames); } ] [ "globs:" _globs=_GlobSet() { it.set_globs(_globs); } ] { return it; } } Method _Method() : { Method it; } { ( it=_TraversalDef() | it=_MethodDef() | it=_Wrapper() | it=_Accessor() | it=_Constructor() | it=_Start() | it=_Finish() | it=_ReturnValue() | it=_Verbatim() ) { return it; } } void common_Method(Method it) : { } { { } } TraversalDef _TraversalDef() : { TraversalDef it; TraversalName _name; TraversalParms _parms; StrategyExpression _strat; } { { it=new TraversalDef(); } "traversal" _name=_TraversalName() { it.set_name(_name); } _parms=_TraversalParms() { it.set_parms(_parms); } "{" _strat=_StrategyExpression() { it.set_strat(_strat); } ";" "}" { common_Method(it); } { return it; } } TraversalParms _TraversalParms() : { TraversalParms it; Visitor_Commalist _visitors; } { { it=new TraversalParms(); } "(" [ _visitors=_Visitor_Commalist() { it.set_visitors(_visitors); } ] ")" { return it; } } Visitor _Visitor() : { Visitor it; ClassName _classname; VisitorName _visitorname; } { { it=new Visitor(); } _classname=_ClassName() { it.set_classname(_classname); } [ _visitorname=_VisitorName() { it.set_visitorname(_visitorname); } ] { return it; } } MethodDef _MethodDef() : { MethodDef it; MethodSignature _methodsignature; MethodBody _methodbody; } { { it=new MethodDef(); } _methodsignature=_MethodSignature() { it.set_methodsignature(_methodsignature); } _methodbody=_MethodBody() { it.set_methodbody(_methodbody); } { common_Method(it); } { return it; } } MethodSignature _MethodSignature() : { MethodSignature it; MethodKeyword_List _keywords; JavaType _returnType; MethodName _name; MethodParm_Commalist _parms; Throws _throwsclause; } { { it=new MethodSignature(); } _keywords=_MethodKeyword_List() { it.set_keywords(_keywords); } _returnType=_JavaType() { it.set_returnType(_returnType); } _name=_MethodName() { it.set_name(_name); } "(" [ _parms=_MethodParm_Commalist() { it.set_parms(_parms); } ] ")" _throwsclause=_Throws() { it.set_throwsclause(_throwsclause); } { return it; } } MethodKeyword _MethodKeyword() : { MethodKeyword it; } { ( it=_PublicMethod() | it=_ProtectedMethod() | it=_PrivateMethod() | it=_StaticMethod() | it=_FinalMethod() | it=_AbstractMethod() ) { return it; } } void common_MethodKeyword(MethodKeyword it) : { } { { } } PublicMethod _PublicMethod() : { PublicMethod it; } { { it=new PublicMethod(); } "public" { common_MethodKeyword(it); } { return it; } } ProtectedMethod _ProtectedMethod() : { ProtectedMethod it; } { { it=new ProtectedMethod(); } "protected" { common_MethodKeyword(it); } { return it; } } PrivateMethod _PrivateMethod() : { PrivateMethod it; } { { it=new PrivateMethod(); } "private" { common_MethodKeyword(it); } { return it; } } StaticMethod _StaticMethod() : { StaticMethod it; } { { it=new StaticMethod(); } "static" { common_MethodKeyword(it); } { return it; } } FinalMethod _FinalMethod() : { FinalMethod it; } { { it=new FinalMethod(); } "final" { common_MethodKeyword(it); } { return it; } } AbstractMethod _AbstractMethod() : { AbstractMethod it; } { { it=new AbstractMethod(); } "abstract" { common_MethodKeyword(it); } { return it; } } MethodParm _MethodParm() : { MethodParm it; JavaType _type; ArraySpec_List _array1; ParmName _name; ArraySpec_List _array2; } { { it=new MethodParm(); } _type=_JavaType() { it.set_type(_type); } _array1=_ArraySpec_List() { it.set_array1(_array1); } _name=_ParmName() { it.set_name(_name); } _array2=_ArraySpec_List() { it.set_array2(_array2); } { return it; } } ArraySpec _ArraySpec() : { ArraySpec it; } { { it=new ArraySpec(); } "[" "]" { return it; } } Throws _Throws() : { Throws it; ClassName_Commalist _exceptions; } { { it=new Throws(); } [ "throws" _exceptions=_ClassName_Commalist() { it.set_exceptions(_exceptions); } ] { return it; } } MethodBody _MethodBody() : { MethodBody it; } { ( it=_VerbatimMethodBody() | it=_AdaptiveMethodBody() | it=_NoMethodBody() ) { return it; } } void common_MethodBody(MethodBody it) : { } { { } } VerbatimMethodBody _VerbatimMethodBody() : { VerbatimMethodBody it; JavaCode _javacode; } { { it=new VerbatimMethodBody(); } _javacode=_JavaCode() { it.set_javacode(_javacode); } { common_MethodBody(it); } { return it; } } AdaptiveMethodBody _AdaptiveMethodBody() : { AdaptiveMethodBody it; TraversalExpression _trv; VisitorExpression _vis; } { { it=new AdaptiveMethodBody(); } _trv=_TraversalExpression() { it.set_trv(_trv); } _vis=_VisitorExpression() { it.set_vis(_vis); } { common_MethodBody(it); } { return it; } } NoMethodBody _NoMethodBody() : { NoMethodBody it; } { { it=new NoMethodBody(); } ";" { common_MethodBody(it); } { return it; } } TraversalExpression _TraversalExpression() : { TraversalExpression it; } { ( it=_TraversalRef() | it=_TraversalSpec() ) { return it; } } void common_TraversalExpression(TraversalExpression it) : { } { { } } TraversalRef _TraversalRef() : { TraversalRef it; Equals _equals; TraversalName _name; } { { it=new TraversalRef(); } [ _equals=_Equals() { it.set_equals(_equals); } ] _name=_TraversalName() { it.set_name(_name); } { common_TraversalExpression(it); } { return it; } } Equals _Equals() : { Equals it; } { { it=new Equals(); } "=" { return it; } } TraversalSpec _TraversalSpec() : { TraversalSpec it; StrategyExpression _strat; } { { it=new TraversalSpec(); } _strat=_StrategyExpression() { it.set_strat(_strat); } { common_TraversalExpression(it); } { return it; } } VisitorExpression _VisitorExpression() : { VisitorExpression it; } { ( it=_VisitorRef() | it=_VisitorSpec() ) { return it; } } void common_VisitorExpression(VisitorExpression it) : { } { { } } VisitorRef _VisitorRef() : { VisitorRef it; } { ( it=_WithVisitorRef() | it=_ParenVisitorRef() ) { return it; } } void common_VisitorRef(VisitorRef it) : { } { { common_VisitorExpression(it); } { } } WithVisitorRef _WithVisitorRef() : { WithVisitorRef it; ClassName_Commalist _visitorClasses; } { { it=new WithVisitorRef(); } "with" _visitorClasses=_ClassName_Commalist() { it.set_visitorClasses(_visitorClasses); } ";" { common_VisitorRef(it); } { return it; } } ParenVisitorRef _ParenVisitorRef() : { ParenVisitorRef it; ClassName_Commalist _visitorClasses; } { { it=new ParenVisitorRef(); } "(" _visitorClasses=_ClassName_Commalist() { it.set_visitorClasses(_visitorClasses); } ")" ";" { common_VisitorRef(it); } { return it; } } VisitorSpec _VisitorSpec() : { VisitorSpec it; ClassMethods _methods; } { { it=new VisitorSpec(); } _methods=_ClassMethods() { it.set_methods(_methods); } { common_VisitorExpression(it); } { return it; } } Wrapper _Wrapper() : { Wrapper it; WrapperKind _kind; HostSpec _hosts; JavaCode _javacode; } { { it=new Wrapper(); } _kind=_WrapperKind() { it.set_kind(_kind); } _hosts=_HostSpec() { it.set_hosts(_hosts); } _javacode=_JavaCode() { it.set_javacode(_javacode); } { common_Method(it); } { return it; } } WrapperKind _WrapperKind() : { WrapperKind it; } { ( it=_Before() | it=_Around() | it=_After() ) { return it; } } void common_WrapperKind(WrapperKind it) : { } { { } } Before _Before() : { Before it; } { { it=new Before(); } "before" { common_WrapperKind(it); } { return it; } } Around _Around() : { Around it; } { { it=new Around(); } "around" { common_WrapperKind(it); } { return it; } } After _After() : { After it; } { { it=new After(); } "after" { common_WrapperKind(it); } { return it; } } HostSpec _HostSpec() : { HostSpec it; } { ( it=_GlobSpec() ) { return it; } } void common_HostSpec(HostSpec it) : { } { { } } Accessor _Accessor() : { Accessor it; } { ( it=_Getter() | it=_Setter() ) { return it; } } void common_Accessor(Accessor it) : { PartName _partname; JavaCode _javacode; } { _partname=_PartName() { it.set_partname(_partname); } _javacode=_JavaCode() { it.set_javacode(_javacode); } { common_Method(it); } { } } Getter _Getter() : { Getter it; } { { it=new Getter(); } "get" { common_Accessor(it); } { return it; } } Setter _Setter() : { Setter it; } { { it=new Setter(); } "set" { common_Accessor(it); } { return it; } } Constructor _Constructor() : { Constructor it; JavaCode _javacode; } { { it=new Constructor(); } "init" _javacode=_JavaCode() { it.set_javacode(_javacode); } { common_Method(it); } { return it; } } Start _Start() : { Start it; JavaCode _javacode; } { { it=new Start(); } "start" _javacode=_JavaCode() { it.set_javacode(_javacode); } { common_Method(it); } { return it; } } Finish _Finish() : { Finish it; JavaCode _javacode; } { { it=new Finish(); } "finish" _javacode=_JavaCode() { it.set_javacode(_javacode); } { common_Method(it); } { return it; } } ReturnValue _ReturnValue() : { ReturnValue it; JavaType _type; JavaCode _exp; } { { it=new ReturnValue(); } "return" [ _type=_JavaType() { it.set_type(_type); } ] _exp=_JavaCode() { it.set_exp(_exp); } { common_Method(it); } { return it; } } Verbatim _Verbatim() : { Verbatim it; JavaCode _javacode; } { { it=new Verbatim(); } _javacode=_JavaCode() { it.set_javacode(_javacode); } { common_Method(it); } { return it; } } PackageName _PackageName() : { PackageName it; Nonempty_PackageName _first; } { { it=new PackageName(); } _first=_Nonempty_PackageName() { it.set_first(_first); } { return it; } } ClassName _ClassName() : { ClassName it; Name _name; } { { it=new ClassName(); } _name=_Name() { it.set_name(_name); } { return it; } } PartName _PartName() : { PartName it; IdentOrKeyword _name; } { { it=new PartName(); } _name=_IdentOrKeyword() { it.set_name(_name); } { return it; } } TraversalName _TraversalName() : { TraversalName it; Name _name; } { { it=new TraversalName(); } _name=_Name() { it.set_name(_name); } { return it; } } VisitorName _VisitorName() : { VisitorName it; Name _name; } { { it=new VisitorName(); } _name=_Name() { it.set_name(_name); } { return it; } } MethodName _MethodName() : { MethodName it; Ident _name; } { { it=new MethodName(); } _name=_Ident() { it.set_name(_name); } { return it; } } ParmName _ParmName() : { ParmName it; Ident _name; } { { it=new ParmName(); } _name=_Ident() { it.set_name(_name); } { return it; } } StrategyName _StrategyName() : { StrategyName it; Ident _name; } { { it=new StrategyName(); } _name=_Ident() { it.set_name(_name); } { return it; } } JavaType _JavaType() : { JavaType it; Name _type; } { { it=new JavaType(); } _type=_Name() { it.set_type(_type); } { return it; } } JavaCode _JavaCode() : { JavaCode it; Text _code; } { { it=new JavaCode(); } _code=_Text() { it.set_code(_code); } { return it; } } Name _Name() : { Name it; Nonempty_Name _first; } { { it=new Name(); } _first=_Nonempty_Name() { it.set_first(_first); } { return it; } } IdentOrKeyword _IdentOrKeyword() : { IdentOrKeyword it; } { ( it=_ParseIdent() | it=_NoParseIdent() | it=_VisitorsIdent() | it=_EndVisitorsIdent() | it=_VisitorIdent() | it=_NotParsedIdent() | it=_DerivedIdent() | it=_InitIdent() | it=_CommonIdent() | it=_LookaheadIdent() | it=_OtherIdent() ) { return it; } } void common_IdentOrKeyword(IdentOrKeyword it) : { } { { } } ParseIdent _ParseIdent() : { ParseIdent it; } { { it=new ParseIdent(); } "parse" { common_IdentOrKeyword(it); } { return it; } } NoParseIdent _NoParseIdent() : { NoParseIdent it; } { { it=new NoParseIdent(); } "noparse" { common_IdentOrKeyword(it); } { return it; } } VisitorsIdent _VisitorsIdent() : { VisitorsIdent it; } { { it=new VisitorsIdent(); } "visitors" { common_IdentOrKeyword(it); } { return it; } } EndVisitorsIdent _EndVisitorsIdent() : { EndVisitorsIdent it; } { { it=new EndVisitorsIdent(); } "endvisitors" { common_IdentOrKeyword(it); } { return it; } } VisitorIdent _VisitorIdent() : { VisitorIdent it; } { { it=new VisitorIdent(); } "visitor" { common_IdentOrKeyword(it); } { return it; } } NotParsedIdent _NotParsedIdent() : { NotParsedIdent it; } { { it=new NotParsedIdent(); } "notparsed" { common_IdentOrKeyword(it); } { return it; } } DerivedIdent _DerivedIdent() : { DerivedIdent it; } { { it=new DerivedIdent(); } "derived" { common_IdentOrKeyword(it); } { return it; } } InitIdent _InitIdent() : { InitIdent it; } { { it=new InitIdent(); } "init" { common_IdentOrKeyword(it); } { return it; } } CommonIdent _CommonIdent() : { CommonIdent it; } { { it=new CommonIdent(); } "common" { common_IdentOrKeyword(it); } { return it; } } LookaheadIdent _LookaheadIdent() : { LookaheadIdent it; } { { it=new LookaheadIdent(); } "lookahead" { common_IdentOrKeyword(it); } { return it; } } OtherIdent _OtherIdent() : { OtherIdent it; Ident _id; } { { it=new OtherIdent(); } _id=_Ident() { it.set_id(_id); } { common_IdentOrKeyword(it); } { return it; } } ParseKeyword _ParseKeyword() : { ParseKeyword it; } { ( it=_DoParse() | it=_DontParse() ) { return it; } } void common_ParseKeyword(ParseKeyword it) : { } { { } } DoParse _DoParse() : { DoParse it; } { ( it=_DoParseWithoutStars() | it=_DoParseWithStars() ) { return it; } } void common_DoParse(DoParse it) : { } { { common_ParseKeyword(it); } { } } DoParseWithoutStars _DoParseWithoutStars() : { DoParseWithoutStars it; } { { it=new DoParseWithoutStars(); } "parse" { common_DoParse(it); } { return it; } } DoParseWithStars _DoParseWithStars() : { DoParseWithStars it; } { { it=new DoParseWithStars(); } "*parse*" { common_DoParse(it); } { return it; } } DontParse _DontParse() : { DontParse it; } { ( it=_DontParseWithoutStars() | it=_DontParseWithStars() ) { return it; } } void common_DontParse(DontParse it) : { } { { common_ParseKeyword(it); } { } } DontParseWithoutStars _DontParseWithoutStars() : { DontParseWithoutStars it; } { { it=new DontParseWithoutStars(); } "noparse" { common_DontParse(it); } { return it; } } DontParseWithStars _DontParseWithStars() : { DontParseWithStars it; } { { it=new DontParseWithStars(); } "*noparse*" { common_DontParse(it); } { return it; } } VisitorKeyword _VisitorKeyword() : { VisitorKeyword it; } { ( it=_BeginVisitors() | it=_EndVisitors() ) { return it; } } void common_VisitorKeyword(VisitorKeyword it) : { } { { } } BeginVisitors _BeginVisitors() : { BeginVisitors it; } { ( it=_BeginVisitorsWithoutStars() | it=_BeginVisitorsWithStars() ) { return it; } } void common_BeginVisitors(BeginVisitors it) : { } { { common_VisitorKeyword(it); } { } } BeginVisitorsWithoutStars _BeginVisitorsWithoutStars() : { BeginVisitorsWithoutStars it; } { { it=new BeginVisitorsWithoutStars(); } "visitors" { common_BeginVisitors(it); } { return it; } } BeginVisitorsWithStars _BeginVisitorsWithStars() : { BeginVisitorsWithStars it; } { { it=new BeginVisitorsWithStars(); } "*visitors*" { common_BeginVisitors(it); } { return it; } } EndVisitors _EndVisitors() : { EndVisitors it; } { ( it=_EndVisitorsWithoutStars() | it=_EndVisitorsWithStars() ) { return it; } } void common_EndVisitors(EndVisitors it) : { } { { common_VisitorKeyword(it); } { } } EndVisitorsWithoutStars _EndVisitorsWithoutStars() : { EndVisitorsWithoutStars it; } { { it=new EndVisitorsWithoutStars(); } "endvisitors" { common_EndVisitors(it); } { return it; } } EndVisitorsWithStars _EndVisitorsWithStars() : { EndVisitorsWithStars it; } { { it=new EndVisitorsWithStars(); } "*endvisitors*" { common_EndVisitors(it); } { return it; } } ClassKeyword _ClassKeyword() : { ClassKeyword it; } { ( it=_PublicClass() | it=_FinalClass() | it=_InterfaceClass() | it=_VisitorClass() | it=_NotParsedClass() ) { return it; } } void common_ClassKeyword(ClassKeyword it) : { } { { } } PublicClass _PublicClass() : { PublicClass it; } { ( it=_PublicClassWithoutStars() | it=_PublicClassWithStars() ) { return it; } } void common_PublicClass(PublicClass it) : { } { { common_ClassKeyword(it); } { } } PublicClassWithoutStars _PublicClassWithoutStars() : { PublicClassWithoutStars it; } { { it=new PublicClassWithoutStars(); } "public" { common_PublicClass(it); } { return it; } } PublicClassWithStars _PublicClassWithStars() : { PublicClassWithStars it; } { { it=new PublicClassWithStars(); } "*public*" { common_PublicClass(it); } { return it; } } FinalClass _FinalClass() : { FinalClass it; } { ( it=_FinalClassWithoutStars() | it=_FinalClassWithStars() ) { return it; } } void common_FinalClass(FinalClass it) : { } { { common_ClassKeyword(it); } { } } FinalClassWithoutStars _FinalClassWithoutStars() : { FinalClassWithoutStars it; } { { it=new FinalClassWithoutStars(); } "final" { common_FinalClass(it); } { return it; } } FinalClassWithStars _FinalClassWithStars() : { FinalClassWithStars it; } { { it=new FinalClassWithStars(); } "*final*" { common_FinalClass(it); } { return it; } } InterfaceClass _InterfaceClass() : { InterfaceClass it; } { ( it=_InterfaceClassWithoutStars() | it=_InterfaceClassWithStars() ) { return it; } } void common_InterfaceClass(InterfaceClass it) : { } { { common_ClassKeyword(it); } { } } InterfaceClassWithoutStars _InterfaceClassWithoutStars() : { InterfaceClassWithoutStars it; } { { it=new InterfaceClassWithoutStars(); } "interface" { common_InterfaceClass(it); } { return it; } } InterfaceClassWithStars _InterfaceClassWithStars() : { InterfaceClassWithStars it; } { { it=new InterfaceClassWithStars(); } "*interface*" { common_InterfaceClass(it); } { return it; } } VisitorClass _VisitorClass() : { VisitorClass it; } { ( it=_VisitorClassWithoutStars() | it=_VisitorClassWithStars() ) { return it; } } void common_VisitorClass(VisitorClass it) : { } { { common_ClassKeyword(it); } { } } VisitorClassWithoutStars _VisitorClassWithoutStars() : { VisitorClassWithoutStars it; } { { it=new VisitorClassWithoutStars(); } "visitor" { common_VisitorClass(it); } { return it; } } VisitorClassWithStars _VisitorClassWithStars() : { VisitorClassWithStars it; } { { it=new VisitorClassWithStars(); } "*visitor*" { common_VisitorClass(it); } { return it; } } NotParsedClass _NotParsedClass() : { NotParsedClass it; } { ( it=_NotParsedClassWithoutStars() | it=_NotParsedClassWithStars() ) { return it; } } void common_NotParsedClass(NotParsedClass it) : { } { { common_ClassKeyword(it); } { } } NotParsedClassWithoutStars _NotParsedClassWithoutStars() : { NotParsedClassWithoutStars it; } { { it=new NotParsedClassWithoutStars(); } "notparsed" { common_NotParsedClass(it); } { return it; } } NotParsedClassWithStars _NotParsedClassWithStars() : { NotParsedClassWithStars it; } { { it=new NotParsedClassWithStars(); } "*notparsed*" { common_NotParsedClass(it); } { return it; } } PartKeyword _PartKeyword() : { PartKeyword it; } { ( it=_FinalPart() | it=_StaticPart() | it=_ReadOnlyPart() | it=_PrivatePart() | it=_DerivedPart() ) { return it; } } void common_PartKeyword(PartKeyword it) : { } { { } } FinalPart _FinalPart() : { FinalPart it; } { ( it=_FinalPartWithoutStars() | it=_FinalPartWithStars() ) { return it; } } void common_FinalPart(FinalPart it) : { } { { common_PartKeyword(it); } { } } FinalPartWithoutStars _FinalPartWithoutStars() : { FinalPartWithoutStars it; } { { it=new FinalPartWithoutStars(); } "final" { common_FinalPart(it); } { return it; } } FinalPartWithStars _FinalPartWithStars() : { FinalPartWithStars it; } { { it=new FinalPartWithStars(); } "*final*" { common_FinalPart(it); } { return it; } } StaticPart _StaticPart() : { StaticPart it; } { ( it=_StaticPartWithoutStars() | it=_StaticPartWithStars() ) { return it; } } void common_StaticPart(StaticPart it) : { } { { common_PartKeyword(it); } { } } StaticPartWithoutStars _StaticPartWithoutStars() : { StaticPartWithoutStars it; } { { it=new StaticPartWithoutStars(); } "static" { common_StaticPart(it); } { return it; } } StaticPartWithStars _StaticPartWithStars() : { StaticPartWithStars it; } { { it=new StaticPartWithStars(); } "*static*" { common_StaticPart(it); } { return it; } } ReadOnlyPart _ReadOnlyPart() : { ReadOnlyPart it; } { ( it=_ReadOnlyPartWithoutStars() | it=_ReadOnlyPartWithStars() ) { return it; } } void common_ReadOnlyPart(ReadOnlyPart it) : { } { { common_PartKeyword(it); } { } } ReadOnlyPartWithoutStars _ReadOnlyPartWithoutStars() : { ReadOnlyPartWithoutStars it; } { { it=new ReadOnlyPartWithoutStars(); } "read-only" { common_ReadOnlyPart(it); } { return it; } } ReadOnlyPartWithStars _ReadOnlyPartWithStars() : { ReadOnlyPartWithStars it; } { { it=new ReadOnlyPartWithStars(); } "*read-only*" { common_ReadOnlyPart(it); } { return it; } } PrivatePart _PrivatePart() : { PrivatePart it; } { ( it=_PrivatePartWithoutStars() | it=_PrivatePartWithStars() ) { return it; } } void common_PrivatePart(PrivatePart it) : { } { { common_PartKeyword(it); } { } } PrivatePartWithoutStars _PrivatePartWithoutStars() : { PrivatePartWithoutStars it; } { { it=new PrivatePartWithoutStars(); } "private" { common_PrivatePart(it); } { return it; } } PrivatePartWithStars _PrivatePartWithStars() : { PrivatePartWithStars it; } { { it=new PrivatePartWithStars(); } "*private*" { common_PrivatePart(it); } { return it; } } DerivedPart _DerivedPart() : { DerivedPart it; } { ( it=_DerivedPartWithoutStars() | it=_DerivedPartWithStars() ) { return it; } } void common_DerivedPart(DerivedPart it) : { } { { common_PartKeyword(it); } { } } DerivedPartWithoutStars _DerivedPartWithoutStars() : { DerivedPartWithoutStars it; } { { it=new DerivedPartWithoutStars(); } "derived" { common_DerivedPart(it); } { return it; } } DerivedPartWithStars _DerivedPartWithStars() : { DerivedPartWithStars it; } { { it=new DerivedPartWithStars(); } "*derived*" { common_DerivedPart(it); } { return it; } } PartInitKeyword _PartInitKeyword() : { PartInitKeyword it; } { ( it=_PartInitKeywordWithoutStars() | it=_PartInitKeywordWithStars() ) { return it; } } void common_PartInitKeyword(PartInitKeyword it) : { } { { } } PartInitKeywordWithoutStars _PartInitKeywordWithoutStars() : { PartInitKeywordWithoutStars it; } { { it=new PartInitKeywordWithoutStars(); } "init" { common_PartInitKeyword(it); } { return it; } } PartInitKeywordWithStars _PartInitKeywordWithStars() : { PartInitKeywordWithStars it; } { { it=new PartInitKeywordWithStars(); } "*init*" { common_PartInitKeyword(it); } { return it; } } ExtendsKeyword _ExtendsKeyword() : { ExtendsKeyword it; } { ( it=_ExtendsKeywordWithoutStars() | it=_ExtendsKeywordWithStars() ) { return it; } } void common_ExtendsKeyword(ExtendsKeyword it) : { } { { } } ExtendsKeywordWithoutStars _ExtendsKeywordWithoutStars() : { ExtendsKeywordWithoutStars it; } { { it=new ExtendsKeywordWithoutStars(); } "extends" { common_ExtendsKeyword(it); } { return it; } } ExtendsKeywordWithStars _ExtendsKeywordWithStars() : { ExtendsKeywordWithStars it; } { { it=new ExtendsKeywordWithStars(); } "*extends*" { common_ExtendsKeyword(it); } { return it; } } ImplementsKeyword _ImplementsKeyword() : { ImplementsKeyword it; } { ( it=_ImplementsKeywordWithoutStars() | it=_ImplementsKeywordWithStars() ) { return it; } } void common_ImplementsKeyword(ImplementsKeyword it) : { } { { } } ImplementsKeywordWithoutStars _ImplementsKeywordWithoutStars() : { ImplementsKeywordWithoutStars it; } { { it=new ImplementsKeywordWithoutStars(); } "implements" { common_ImplementsKeyword(it); } { return it; } } ImplementsKeywordWithStars _ImplementsKeywordWithStars() : { ImplementsKeywordWithStars it; } { { it=new ImplementsKeywordWithStars(); } "*implements*" { common_ImplementsKeyword(it); } { return it; } } CommonKeyword _CommonKeyword() : { CommonKeyword it; } { ( it=_CommonWithoutStars() | it=_CommonWithStars() ) { return it; } } void common_CommonKeyword(CommonKeyword it) : { } { { } } CommonWithoutStars _CommonWithoutStars() : { CommonWithoutStars it; } { { it=new CommonWithoutStars(); } "common" { common_CommonKeyword(it); } { return it; } } CommonWithStars _CommonWithStars() : { CommonWithStars it; } { { it=new CommonWithStars(); } "*common*" { common_CommonKeyword(it); } { return it; } } LookaheadKeyword _LookaheadKeyword() : { LookaheadKeyword it; } { ( it=_LookaheadKeywordWithoutStars() | it=_LookaheadKeywordWithStars() ) { return it; } } void common_LookaheadKeyword(LookaheadKeyword it) : { } { { } } LookaheadKeywordWithoutStars _LookaheadKeywordWithoutStars() : { LookaheadKeywordWithoutStars it; } { { it=new LookaheadKeywordWithoutStars(); } "lookahead" { common_LookaheadKeyword(it); } { return it; } } LookaheadKeywordWithStars _LookaheadKeywordWithStars() : { LookaheadKeywordWithStars it; } { { it=new LookaheadKeywordWithStars(); } "*lookahead*" { common_LookaheadKeyword(it); } { return it; } } Import_SList _Import_SList() : { Import_SList it; Nonempty_Import_SList _first; } { { it=new Import_SList(); } _first=_Nonempty_Import_SList() { it.set_first(_first); } { return it; } } ClassGraphEntry_DList _ClassGraphEntry_DList() : { ClassGraphEntry_DList it; Nonempty_ClassGraphEntry_DList _first; } { { it=new ClassGraphEntry_DList(); } _first=_Nonempty_ClassGraphEntry_DList() { it.set_first(_first); } { return it; } } ClassKeyword_List _ClassKeyword_List() : { ClassKeyword_List it; Nonempty_ClassKeyword_List _first; } { { it=new ClassKeyword_List(); } [ _first=_Nonempty_ClassKeyword_List() { it.set_first(_first); } ] { return it; } } ClassName_Commalist _ClassName_Commalist() : { ClassName_Commalist it; Nonempty_ClassName_Commalist _first; } { { it=new ClassName_Commalist(); } _first=_Nonempty_ClassName_Commalist() { it.set_first(_first); } { return it; } } PartOrSyntax_List _PartOrSyntax_List() : { PartOrSyntax_List it; Nonempty_PartOrSyntax_List _first; } { { it=new PartOrSyntax_List(); } [ _first=_Nonempty_PartOrSyntax_List() { it.set_first(_first); } ] { return it; } } PartKeyword_List _PartKeyword_List() : { PartKeyword_List it; Nonempty_PartKeyword_List _first; } { { it=new PartKeyword_List(); } [ _first=_Nonempty_PartKeyword_List() { it.set_first(_first); } ] { return it; } } Part_Sandwich _Part_Sandwich() : { Part_Sandwich it; Syntax_List _first; Part _inner; Syntax_List _second; } { { it=new Part_Sandwich(); } _first=_Syntax_List() { it.set_first(_first); } _inner=_Part() { it.set_inner(_inner); } _second=_Syntax_List() { it.set_second(_second); } { return it; } } Superclass_Commalist _Superclass_Commalist() : { Superclass_Commalist it; Nonempty_Superclass_Commalist _first; } { { it=new Superclass_Commalist(); } _first=_Nonempty_Superclass_Commalist() { it.set_first(_first); } { return it; } } Interface_Commalist _Interface_Commalist() : { Interface_Commalist it; Nonempty_Interface_Commalist _first; } { { it=new Interface_Commalist(); } _first=_Nonempty_Interface_Commalist() { it.set_first(_first); } { return it; } } Subclass_Barlist _Subclass_Barlist() : { Subclass_Barlist it; Nonempty_Subclass_Barlist _first; } { { it=new Subclass_Barlist(); } _first=_Nonempty_Subclass_Barlist() { it.set_first(_first); } { return it; } } RepeatedPart_Sandwich _RepeatedPart_Sandwich() : { RepeatedPart_Sandwich it; Syntax_List _first; RepeatedPart _inner; Syntax_List _second; } { { it=new RepeatedPart_Sandwich(); } _first=_Syntax_List() { it.set_first(_first); } _inner=_RepeatedPart() { it.set_inner(_inner); } _second=_Syntax_List() { it.set_second(_second); } { return it; } } ClassSpec_Sandwich _ClassSpec_Sandwich() : { ClassSpec_Sandwich it; Syntax_List _first; ClassSpec _inner; Syntax_List _second; } { { it=new ClassSpec_Sandwich(); } _first=_Syntax_List() { it.set_first(_first); } _inner=_ClassSpec() { it.set_inner(_inner); } _second=_Syntax_List() { it.set_second(_second); } { return it; } } Syntax_List _Syntax_List() : { Syntax_List it; Nonempty_Syntax_List _first; } { { it=new Syntax_List(); } [ _first=_Nonempty_Syntax_List() { it.set_first(_first); } ] { return it; } } ClassSpec_Commalist _ClassSpec_Commalist() : { ClassSpec_Commalist it; Nonempty_ClassSpec_Commalist _first; } { { it=new ClassSpec_Commalist(); } _first=_Nonempty_ClassSpec_Commalist() { it.set_first(_first); } { return it; } } Behavior_DList _Behavior_DList() : { Behavior_DList it; Nonempty_Behavior_DList _first; } { { it=new Behavior_DList(); } _first=_Nonempty_Behavior_DList() { it.set_first(_first); } { return it; } } SGEdge_SList _SGEdge_SList() : { SGEdge_SList it; Nonempty_SGEdge_SList _first; } { { it=new SGEdge_SList(); } _first=_Nonempty_SGEdge_SList() { it.set_first(_first); } { return it; } } Integer_NList _Integer_NList() : { Integer_NList it; Nonempty_Integer_NList _first; } { { it=new Integer_NList(); } _first=_Nonempty_Integer_NList() { it.set_first(_first); } { return it; } } PathSegment_List _PathSegment_List() : { PathSegment_List it; Nonempty_PathSegment_List _first; } { { it=new PathSegment_List(); } [ _first=_Nonempty_PathSegment_List() { it.set_first(_first); } ] { return it; } } StrategyExpression_Commalist _StrategyExpression_Commalist() : { StrategyExpression_Commalist it; Nonempty_StrategyExpression_Commalist _first; } { { it=new StrategyExpression_Commalist(); } _first=_Nonempty_StrategyExpression_Commalist() { it.set_first(_first); } { return it; } } Glob_Commalist _Glob_Commalist() : { Glob_Commalist it; Nonempty_Glob_Commalist _first; } { { it=new Glob_Commalist(); } _first=_Nonempty_Glob_Commalist() { it.set_first(_first); } { return it; } } ClassGlob_Commalist _ClassGlob_Commalist() : { ClassGlob_Commalist it; Nonempty_ClassGlob_Commalist _first; } { { it=new ClassGlob_Commalist(); } _first=_Nonempty_ClassGlob_Commalist() { it.set_first(_first); } { return it; } } Method_SList _Method_SList() : { Method_SList it; Nonempty_Method_SList _first; } { { it=new Method_SList(); } _first=_Nonempty_Method_SList() { it.set_first(_first); } { return it; } } Visitor_Commalist _Visitor_Commalist() : { Visitor_Commalist it; Nonempty_Visitor_Commalist _first; } { { it=new Visitor_Commalist(); } _first=_Nonempty_Visitor_Commalist() { it.set_first(_first); } { return it; } } MethodKeyword_List _MethodKeyword_List() : { MethodKeyword_List it; Nonempty_MethodKeyword_List _first; } { { it=new MethodKeyword_List(); } [ _first=_Nonempty_MethodKeyword_List() { it.set_first(_first); } ] { return it; } } MethodParm_Commalist _MethodParm_Commalist() : { MethodParm_Commalist it; Nonempty_MethodParm_Commalist _first; } { { it=new MethodParm_Commalist(); } _first=_Nonempty_MethodParm_Commalist() { it.set_first(_first); } { return it; } } ArraySpec_List _ArraySpec_List() : { ArraySpec_List it; Nonempty_ArraySpec_List _first; } { { it=new ArraySpec_List(); } [ _first=_Nonempty_ArraySpec_List() { it.set_first(_first); } ] { return it; } } Nonempty_UVertex_List _Nonempty_UVertex_List() : { Nonempty_UVertex_List it; UVertex _it; Nonempty_UVertex_List _next; } { { it=new Nonempty_UVertex_List(); } _it=_UVertex() { it.set_it(_it); } [ _next=_Nonempty_UVertex_List() { it.set_next(_next); } ] { return it; } } Nonempty_IEdge_List _Nonempty_IEdge_List() : { Nonempty_IEdge_List it; UID _it; Nonempty_IEdge_List _next; } { { it=new Nonempty_IEdge_List(); } _it=_UID() { it.set_it(_it); } [ "," _next=_Nonempty_IEdge_List() { it.set_next(_next); } ] { return it; } } Nonempty_OEdge_List _Nonempty_OEdge_List() : { Nonempty_OEdge_List it; UID _it; Nonempty_OEdge_List _next; } { { it=new Nonempty_OEdge_List(); } _it=_UID() { it.set_it(_it); } [ "," _next=_Nonempty_OEdge_List() { it.set_next(_next); } ] { return it; } } Nonempty_InterfaceModifier_List _Nonempty_InterfaceModifier_List() : { Nonempty_InterfaceModifier_List it; InterfaceModifier _it; Nonempty_InterfaceModifier_List _next; } { { it=new Nonempty_InterfaceModifier_List(); } _it=_InterfaceModifier() { it.set_it(_it); } [ _next=_Nonempty_InterfaceModifier_List() { it.set_next(_next); } ] { return it; } } Nonempty_ScopeIdentifier_List _Nonempty_ScopeIdentifier_List() : { Nonempty_ScopeIdentifier_List it; ScopeIdentifier _it; Nonempty_ScopeIdentifier_List _next; } { { it=new Nonempty_ScopeIdentifier_List(); } _it=_ScopeIdentifier() { it.set_it(_it); } [ _next=_Nonempty_ScopeIdentifier_List() { it.set_next(_next); } ] { return it; } } Nonempty_UEdge_List _Nonempty_UEdge_List() : { Nonempty_UEdge_List it; UEdge _it; Nonempty_UEdge_List _next; } { { it=new Nonempty_UEdge_List(); } _it=_UEdge() { it.set_it(_it); } [ _next=_Nonempty_UEdge_List() { it.set_next(_next); } ] { return it; } } Nonempty_PartModifier_List _Nonempty_PartModifier_List() : { Nonempty_PartModifier_List it; PartModifier _it; Nonempty_PartModifier_List _next; } { { it=new Nonempty_PartModifier_List(); } _it=_PartModifier() { it.set_it(_it); } [ _next=_Nonempty_PartModifier_List() { it.set_next(_next); } ] { return it; } } Nonempty_PackageName _Nonempty_PackageName() : { Nonempty_PackageName it; IdentOrKeyword _it; Nonempty_PackageName _next; } { { it=new Nonempty_PackageName(); } _it=_IdentOrKeyword() { it.set_it(_it); } [ LOOKAHEAD ( 2 ) "." _next=_Nonempty_PackageName() { it.set_next(_next); } ] { return it; } } Nonempty_Name _Nonempty_Name() : { Nonempty_Name it; Ident _it; Nonempty_Name _next; } { { it=new Nonempty_Name(); } _it=_Ident() { it.set_it(_it); } [ LOOKAHEAD ( "." _Ident(),{ "=:~(".indexOf(getToken(3).image) == -1 } ) "." _next=_Nonempty_Name() { it.set_next(_next); } ] { return it; } } Nonempty_Import_SList _Nonempty_Import_SList() : { Nonempty_Import_SList it; Import _it; Nonempty_Import_SList _next; } { { it=new Nonempty_Import_SList(); } _it=_Import() { it.set_it(_it); } [ _next=_Nonempty_Import_SList() { it.set_next(_next); } ] { return it; } } Nonempty_ClassGraphEntry_DList _Nonempty_ClassGraphEntry_DList() : { Nonempty_ClassGraphEntry_DList it; ClassGraphEntry _it; Nonempty_ClassGraphEntry_DList _next; } { { it=new Nonempty_ClassGraphEntry_DList(); } _it=_ClassGraphEntry() { it.set_it(_it); } [ _next=_Nonempty_ClassGraphEntry_DList() { it.set_next(_next); } ] { return it; } } Nonempty_ClassKeyword_List _Nonempty_ClassKeyword_List() : { Nonempty_ClassKeyword_List it; ClassKeyword _it; Nonempty_ClassKeyword_List _next; } { { it=new Nonempty_ClassKeyword_List(); } _it=_ClassKeyword() { it.set_it(_it); } [ _next=_Nonempty_ClassKeyword_List() { it.set_next(_next); } ] { return it; } } Nonempty_ClassName_Commalist _Nonempty_ClassName_Commalist() : { Nonempty_ClassName_Commalist it; ClassName _it; Nonempty_ClassName_Commalist _next; } { { it=new Nonempty_ClassName_Commalist(); } _it=_ClassName() { it.set_it(_it); } [ "," _next=_Nonempty_ClassName_Commalist() { it.set_next(_next); } ] { return it; } } Nonempty_PartOrSyntax_List _Nonempty_PartOrSyntax_List() : { Nonempty_PartOrSyntax_List it; PartOrSyntax _it; Nonempty_PartOrSyntax_List _next; } { { it=new Nonempty_PartOrSyntax_List(); } _it=_PartOrSyntax() { it.set_it(_it); } [ _next=_Nonempty_PartOrSyntax_List() { it.set_next(_next); } ] { return it; } } Nonempty_PartKeyword_List _Nonempty_PartKeyword_List() : { Nonempty_PartKeyword_List it; PartKeyword _it; Nonempty_PartKeyword_List _next; } { { it=new Nonempty_PartKeyword_List(); } _it=_PartKeyword() { it.set_it(_it); } [ _next=_Nonempty_PartKeyword_List() { it.set_next(_next); } ] { return it; } } Nonempty_Superclass_Commalist _Nonempty_Superclass_Commalist() : { Nonempty_Superclass_Commalist it; Superclass _it; Nonempty_Superclass_Commalist _next; } { { it=new Nonempty_Superclass_Commalist(); } _it=_Superclass() { it.set_it(_it); } [ "," _next=_Nonempty_Superclass_Commalist() { it.set_next(_next); } ] { return it; } } Nonempty_Interface_Commalist _Nonempty_Interface_Commalist() : { Nonempty_Interface_Commalist it; Interface _it; Nonempty_Interface_Commalist _next; } { { it=new Nonempty_Interface_Commalist(); } _it=_Interface() { it.set_it(_it); } [ "," _next=_Nonempty_Interface_Commalist() { it.set_next(_next); } ] { return it; } } Nonempty_Subclass_Barlist _Nonempty_Subclass_Barlist() : { Nonempty_Subclass_Barlist it; Subclass _it; Nonempty_Subclass_Barlist _next; } { { it=new Nonempty_Subclass_Barlist(); } _it=_Subclass() { it.set_it(_it); } [ "|" _next=_Nonempty_Subclass_Barlist() { it.set_next(_next); } ] { return it; } } Nonempty_Syntax_List _Nonempty_Syntax_List() : { Nonempty_Syntax_List it; Syntax _it; Nonempty_Syntax_List _next; } { { it=new Nonempty_Syntax_List(); } _it=_Syntax() { it.set_it(_it); } [ _next=_Nonempty_Syntax_List() { it.set_next(_next); } ] { return it; } } Nonempty_ClassSpec_Commalist _Nonempty_ClassSpec_Commalist() : { Nonempty_ClassSpec_Commalist it; ClassSpec _it; Nonempty_ClassSpec_Commalist _next; } { { it=new Nonempty_ClassSpec_Commalist(); } _it=_ClassSpec() { it.set_it(_it); } [ "," _next=_Nonempty_ClassSpec_Commalist() { it.set_next(_next); } ] { return it; } } Nonempty_Behavior_DList _Nonempty_Behavior_DList() : { Nonempty_Behavior_DList it; Behavior _it; Nonempty_Behavior_DList _next; } { { it=new Nonempty_Behavior_DList(); } _it=_Behavior() { it.set_it(_it); } [ _next=_Nonempty_Behavior_DList() { it.set_next(_next); } ] { return it; } } Nonempty_SGEdge_SList _Nonempty_SGEdge_SList() : { Nonempty_SGEdge_SList it; SGEdge _it; Nonempty_SGEdge_SList _next; } { { it=new Nonempty_SGEdge_SList(); } _it=_SGEdge() { it.set_it(_it); } [ _next=_Nonempty_SGEdge_SList() { it.set_next(_next); } ] { return it; } } Nonempty_Integer_NList _Nonempty_Integer_NList() : { Nonempty_Integer_NList it; Integer _it; Nonempty_Integer_NList _next; } { { it=new Nonempty_Integer_NList(); } _it=_Integer() { it.set_it(_it); } [ _next=_Nonempty_Integer_NList() { it.set_next(_next); } ] { return it; } } Nonempty_PathSegment_List _Nonempty_PathSegment_List() : { Nonempty_PathSegment_List it; PathSegment _it; Nonempty_PathSegment_List _next; } { { it=new Nonempty_PathSegment_List(); } _it=_PathSegment() { it.set_it(_it); } [ _next=_Nonempty_PathSegment_List() { it.set_next(_next); } ] { return it; } } Nonempty_StrategyExpression_Commalist _Nonempty_StrategyExpression_Commalist() : { Nonempty_StrategyExpression_Commalist it; StrategyExpression _it; Nonempty_StrategyExpression_Commalist _next; } { { it=new Nonempty_StrategyExpression_Commalist(); } _it=_StrategyExpression() { it.set_it(_it); } [ "," _next=_Nonempty_StrategyExpression_Commalist() { it.set_next(_next); } ] { return it; } } Nonempty_Glob_Commalist _Nonempty_Glob_Commalist() : { Nonempty_Glob_Commalist it; Glob _it; Nonempty_Glob_Commalist _next; } { { it=new Nonempty_Glob_Commalist(); } _it=_Glob() { it.set_it(_it); } [ "," _next=_Nonempty_Glob_Commalist() { it.set_next(_next); } ] { return it; } } Nonempty_ClassGlob_Commalist _Nonempty_ClassGlob_Commalist() : { Nonempty_ClassGlob_Commalist it; ClassGlob _it; Nonempty_ClassGlob_Commalist _next; } { { it=new Nonempty_ClassGlob_Commalist(); } _it=_ClassGlob() { it.set_it(_it); } [ "," _next=_Nonempty_ClassGlob_Commalist() { it.set_next(_next); } ] { return it; } } Nonempty_Method_SList _Nonempty_Method_SList() : { Nonempty_Method_SList it; Method _it; Nonempty_Method_SList _next; } { { it=new Nonempty_Method_SList(); } _it=_Method() { it.set_it(_it); } [ _next=_Nonempty_Method_SList() { it.set_next(_next); } ] { return it; } } Nonempty_Visitor_Commalist _Nonempty_Visitor_Commalist() : { Nonempty_Visitor_Commalist it; Visitor _it; Nonempty_Visitor_Commalist _next; } { { it=new Nonempty_Visitor_Commalist(); } _it=_Visitor() { it.set_it(_it); } [ "," _next=_Nonempty_Visitor_Commalist() { it.set_next(_next); } ] { return it; } } Nonempty_MethodKeyword_List _Nonempty_MethodKeyword_List() : { Nonempty_MethodKeyword_List it; MethodKeyword _it; Nonempty_MethodKeyword_List _next; } { { it=new Nonempty_MethodKeyword_List(); } _it=_MethodKeyword() { it.set_it(_it); } [ _next=_Nonempty_MethodKeyword_List() { it.set_next(_next); } ] { return it; } } Nonempty_MethodParm_Commalist _Nonempty_MethodParm_Commalist() : { Nonempty_MethodParm_Commalist it; MethodParm _it; Nonempty_MethodParm_Commalist _next; } { { it=new Nonempty_MethodParm_Commalist(); } _it=_MethodParm() { it.set_it(_it); } [ "," _next=_Nonempty_MethodParm_Commalist() { it.set_next(_next); } ] { return it; } } Nonempty_ArraySpec_List _Nonempty_ArraySpec_List() : { Nonempty_ArraySpec_List it; ArraySpec _it; Nonempty_ArraySpec_List _next; } { { it=new Nonempty_ArraySpec_List(); } _it=_ArraySpec() { it.set_it(_it); } [ _next=_Nonempty_ArraySpec_List() { it.set_next(_next); } ] { return it; } } Vector _Vector() : { } { { return new Vector(); } } TGIEdge _TGIEdge() : { } { { return new TGIEdge(); } } ArcPerspective _ArcPerspective() : { } { { return new ArcPerspective(); } } TGCEdge _TGCEdge() : { } { { return new TGCEdge(); } } TGAEdge _TGAEdge() : { } { { return new TGAEdge(); } } Perspective _Perspective() : { } { { return new Perspective(); } } TGVertex _TGVertex() : { } { { return new TGVertex(); } } Hashtable _Hashtable() : { } { { return new Hashtable(); } } TraversalGraph _TraversalGraph() : { } { { return new TraversalGraph(); } } boolean _boolean() : { Token t; } { ( t= { return true; } | t= { return false; } ) } char _char() : { Token t; } { t= { String s = t.image; return unescapifyChar(s.substring(1, s.length()-1)); } } byte _byte() : { int i; } { i=_int() { return (byte) i; } } short _short() : { int i; } { i=_int() { return (short) i; } } int _int() : { Number num; } { num=_Number() { return num.intValue(); } } long _long() : { Number num; } { num=_Number() { return num.longValue(); } } float _float() : { Number num; } { num=_Number() { return num.floatValue(); } } double _double() : { Number num; } { num=_Number() { return num.doubleValue(); } } Boolean _Boolean() : { Token t; } { ( t= { return Boolean.TRUE; } | t= { return Boolean.FALSE; } ) } Character _Character() : { char c; } { c=_char() { return new Character(c); } } Integer _Integer() : { int i; } { i = _int() { return new Integer(i); } } Long _Long() : { long l; } { l=_long() { return new Long(l); } } Float _Float() : { float f; } { f=_float() { return new Float(f); } } Double _Double() : { double d; } { d=_double() { return new Double(d); } } Number _Number() : { Token t; String s; int radix; Number num; } { ( ( t= { s = t.image; radix = 10; } | t= { // Strip off the "0x". s = t.image.substring(2, t.image.length()); radix = 16; } | t= { s = t.image; radix = 8; } ) { switch (s.charAt(s.length()-1)) { case 'l': case 'L': num = Long.valueOf(s.substring(0, s.length()-1), radix); break; default: num = Integer.valueOf(s, radix); break; } } | t= { s = t.image; switch (s.charAt(s.length()-1)) { case 'd': case 'D': num = Double.valueOf(s.substring(0, s.length()-1)); break; case 'f': case 'F': num = Float.valueOf(s.substring(0, s.length()-1)); break; default: num = Float.valueOf(s); break; } } ) { return num; } } String _String() : { Token t; } { t= { String s = t.image; return unescapify(s.substring(1, s.length()-1)); } } StringBuffer _StringBuffer() : { String s; } { s=_String() { return new StringBuffer(s); } } Ident _Ident() : { Token t; } { t= { return new Ident(t.image); } } Text _Text() : { Token t; } { t= { String s = t.image; return new Text(s.substring(2, s.length()-2)); } } Line _Line() : { Token t; } { { token_source.SwitchTo(1); } t= { return new Line(t.image); } } Word _Word() : { Token t; } { { token_source.SwitchTo(2); } t= { return new Word(t.image); } } // Lexical specification (largely taken from Java.jack): SKIP : { " " | "\t" | "\n" | "\r" | <"//" (~["\n","\r"])* ("\n"|"\r\n")> | <"/*" (~["*"])* "*" (~["/"] (~["*"])* "*")* "/"> } TOKEN : /* LITERALS */ { < DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* (["l","L"])? > | < HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ (["l","L"])? > | < OCTAL_LITERAL: "0" (["0"-"7"])* (["l","L"])? > | < FLOATING_POINT_LITERAL: (["0"-"9"])+ "." (["0"-"9"])+ ()? (["f","F","d","D"])? | "." (["0"-"9"])+ ()? (["f","F","d","D"])? | (["0"-"9"])+ (["f","F","d","D"])? | (["0"-"9"])+ ()? ["f","F","d","D"] > | < #EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ > | < CHARACTER_LITERAL: "'" ( (~["'","\\","\n","\r"]) | ("\\" ( ["n","t","b","r","f","\\","'","\""] | ["0"-"7"] ( ["0"-"7"] )? | ["0"-"3"] ["0"-"7"] ["0"-"7"] ) ) ) "'" > | < STRING_LITERAL: "\"" ( (~["\"","\\","\n","\r"]) | ("\\" ( ["n","t","b","r","f","\\","'","\""] | ["0"-"7"] ( ["0"-"7"] )? | ["0"-"3"] ["0"-"7"] ["0"-"7"] ) ) )* "\"" > | < TEXT_LITERAL: "(@" (~["@"])* ( "@" ~[")"] (~["@"])* )* "@)" > | < TRUE: "true" > | < FALSE: "false" > } TOKEN : /* IDENTIFIERS */ { < IDENTIFIER: (|)* > | < #LETTER: [ "\u0024", "\u0041"-"\u005a", "\u005f", "\u0061"-"\u007a", "\u00c0"-"\u00d6", "\u00d8"-"\u00f6", "\u00f8"-"\u00ff", "\u0100"-"\u1fff", "\u3040"-"\u318f", "\u3300"-"\u337f", "\u3400"-"\u3d2d", "\u4e00"-"\u9fff", "\uf900"-"\ufaff" ] > | < #DIGIT: [ "\u0030"-"\u0039", "\u0660"-"\u0669", "\u06f0"-"\u06f9", "\u0966"-"\u096f", "\u09e6"-"\u09ef", "\u0a66"-"\u0a6f", "\u0ae6"-"\u0aef", "\u0b66"-"\u0b6f", "\u0be7"-"\u0bef", "\u0c66"-"\u0c6f", "\u0ce6"-"\u0cef", "\u0d66"-"\u0d6f", "\u0e50"-"\u0e59", "\u0ed0"-"\u0ed9", "\u1040"-"\u1049" ] > } TOKEN : { < LINE: (~["\n","\r"])* > : DEFAULT } SKIP : { " " | "\t" | "\n" | "\r" } TOKEN : { < WORD: (~[" ","\t","\n","\r"])* > : DEFAULT }