package uci.graphedit; import java.awt.*; import java.io.*; import java.util.*; import java.lang.Math ; import demeter.*; class UGraph implements Cloneable { private UVertex_List vertices; public UVertex_List get_vertices() { return vertices; } public void set_vertices(UVertex_List new_vertices) { vertices = new_vertices; } private UEdge_List edges; public UEdge_List get_edges() { return edges; } public void set_edges(UEdge_List new_edges) { edges = new_edges; } UGraph() { } public UGraph(UVertex_List vertices, UEdge_List edges) { super(); set_vertices(vertices); set_edges(edges); } public static UGraph parse(java.io.InputStream in) throws ParseError { return new Parser(in)._UGraph(); } public static UGraph parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } //add a UVertex into the UVertex_List public void add_uvertex(UVertex uvertex) { if(get_vertices() != null ) { Nonempty_UVertex_List newlist = new Nonempty_UVertex_List( uvertex , get_vertices().get_first()); get_vertices().set_first(newlist); //get a UVertexList, get a Nonempty_UvertexList , replace // old one with new one, it=uvertex , next = old_Ne_V_L } else { Nonempty_UVertex_List newlist = new Nonempty_UVertex_List( uvertex , null); set_vertices(new UVertex_List(newlist)); } } //add a UEdge into the UEdge_Lis public void add_uedge(UEdge uedge) { if(get_edges() != null ) { Nonempty_UEdge_List newlist = new Nonempty_UEdge_List( uedge , get_edges().get_first()); get_edges().set_first(newlist); //get a UEdgeList, get its Nonempty_UEdgeList , replace // old one with new one, it=uedge , next = old_Ne_V_L } else { // System.out.println("NULL edges"); Nonempty_UEdge_List newlist = new Nonempty_UEdge_List( uedge , null); set_edges(new UEdge_List(newlist)); } } public VertexContainer GetAllVertices() { ReadVertexVisitor rvv = new ReadVertexVisitor( new VertexContainer(new Vector(),new Vector(),new Vector())); this.ReadAllVertices(rvv); return rvv.get_elements(); } public EdgeContainer GetAllEdges() { ReadEdgeVisitor rev= new ReadEdgeVisitor( new EdgeContainer(new Vector(),new Vector())); this.ReadAllEdges(rev); return rev.get_elements(); } public String GetGraphString() { SaveGraphVisitor sgv= new SaveGraphVisitor(new String()); this.saveGraph(sgv); return sgv.get_graphString(); } public void ReadAllVertices(ReadVertexVisitor rvv) { ReadAllVertices_trv1(rvv); } public void ReadAllVertices_trv1(ReadVertexVisitor rvv) { if (vertices != null) { vertices.ReadAllVertices_trv1(rvv); } } public void ReadAllEdges(ReadEdgeVisitor rev) { ReadAllEdges_trv2(rev); } public void ReadAllEdges_trv2(ReadEdgeVisitor rev) { if (edges != null) { edges.ReadAllEdges_trv2(rev); } } public void saveGraph(SaveGraphVisitor sgv) { saveGraph_trv3(sgv); } public void saveGraph_trv3(SaveGraphVisitor sgv) { sgv.before(this); if (vertices != null) { vertices.saveGraph_trv3(sgv); } if (edges != null) { edges.saveGraph_trv3(sgv); } } } class UVertex_List implements Cloneable { private Nonempty_UVertex_List first; public Nonempty_UVertex_List get_first() { return first; } public void set_first(Nonempty_UVertex_List new_first) { first = new_first; } UVertex_List() { } public UVertex_List(Nonempty_UVertex_List first) { super(); set_first(first); } public static UVertex_List parse(java.io.InputStream in) throws ParseError { return new Parser(in)._UVertex_List(); } public static UVertex_List parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void ReadAllVertices_trv1(ReadVertexVisitor rvv) { if (first != null) { first.ReadAllVertices_trv1(rvv); } } public void saveGraph_trv3(SaveGraphVisitor sgv) { sgv.before(this); if (first != null) { first.saveGraph_trv3(sgv); } } } abstract class UVertex implements Cloneable { private UID id; public UID get_id() { return id; } public void set_id(UID new_id) { id = new_id; } private UVertexName vertexname; public UVertexName get_vertexname() { return vertexname; } public void set_vertexname(UVertexName new_vertexname) { vertexname = new_vertexname; } private Coordinates position; public Coordinates get_position() { return position; } public void set_position(Coordinates new_position) { position = new_position; } private IEdge_List incoming; public IEdge_List get_incoming() { return incoming; } public void set_incoming(IEdge_List new_incoming) { incoming = new_incoming; } private OEdge_List outgoing; public OEdge_List get_outgoing() { return outgoing; } public void set_outgoing(OEdge_List new_outgoing) { outgoing = new_outgoing; } UVertex() { } public UVertex(UID id, UVertexName vertexname, Coordinates position, IEdge_List incoming, OEdge_List outgoing) { super(); set_id(id); set_vertexname(vertexname); set_position(position); set_incoming(incoming); set_outgoing(outgoing); } UVertex(Ident name) { set_id(new UID(new Integer(0))); set_vertexname(new UVertexName(name)); //magic numbers 600 & 400 = screen x y max set_position(new Coordinates(new X(new Integer((int)(600 * Math.random()))),new Y(new Integer((int)(400 * Math.random()))))); set_incoming(new IEdge_List()); set_outgoing(new OEdge_List()); } //add a incoming UID into the UVetex::IEdge_List public void add_incoming(UID uid) { if(get_incoming() != null ) { Nonempty_IEdge_List newlist = new Nonempty_IEdge_List ( uid , get_incoming().get_first()); get_incoming().set_first(newlist); } else { Nonempty_IEdge_List newlist = new Nonempty_IEdge_List( uid , null); set_incoming(new IEdge_List(newlist)); } } //add a outgoing UID into the UVertex::OEdge_List public void add_outgoing(UID uid) { if(get_outgoing() != null ) { Nonempty_OEdge_List newlist = new Nonempty_OEdge_List ( uid , get_outgoing().get_first()); get_outgoing().set_first(newlist); } else { Nonempty_OEdge_List newlist = new Nonempty_OEdge_List( uid , null); set_outgoing(new OEdge_List(newlist)); } } public void ReadAllVertices_trv1(ReadVertexVisitor rvv) { } public void saveGraph_trv3(SaveGraphVisitor sgv) { id.saveGraph_trv3(sgv); vertexname.saveGraph_trv3(sgv); position.saveGraph_trv3(sgv); if (incoming != null) { incoming.saveGraph_trv3(sgv); } if (outgoing != null) { outgoing.saveGraph_trv3(sgv); } } } class IEdge_List implements Cloneable { private Nonempty_IEdge_List first; public Nonempty_IEdge_List get_first() { return first; } public void set_first(Nonempty_IEdge_List new_first) { first = new_first; } IEdge_List() { } public IEdge_List(Nonempty_IEdge_List first) { super(); set_first(first); } public static IEdge_List parse(java.io.InputStream in) throws ParseError { return new Parser(in)._IEdge_List(); } public static IEdge_List parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void saveGraph_trv3(SaveGraphVisitor sgv) { sgv.before(this); if (first != null) { first.saveGraph_trv3(sgv); } } } class OEdge_List implements Cloneable { private Nonempty_OEdge_List first; public Nonempty_OEdge_List get_first() { return first; } public void set_first(Nonempty_OEdge_List new_first) { first = new_first; } OEdge_List() { } public OEdge_List(Nonempty_OEdge_List first) { super(); set_first(first); } public static OEdge_List parse(java.io.InputStream in) throws ParseError { return new Parser(in)._OEdge_List(); } public static OEdge_List parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void saveGraph_trv3(SaveGraphVisitor sgv) { sgv.before(this); if (first != null) { first.saveGraph_trv3(sgv); } } } class UConstVertex extends UVertex implements Cloneable { UConstVertex() { } public UConstVertex(UID id, UVertexName vertexname, Coordinates position, IEdge_List incoming, OEdge_List outgoing) { super(id, vertexname, position, incoming, outgoing); } public static UConstVertex parse(java.io.InputStream in) throws ParseError { return new Parser(in)._UConstVertex(); } public static UConstVertex parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } UConstVertex(Ident name) { super(name); } public void ReadAllVertices_trv1(ReadVertexVisitor rvv) { rvv.before(this); } public void saveGraph_trv3(SaveGraphVisitor sgv) { sgv.before(this); super.saveGraph_trv3(sgv); } } class UAltVertex extends UVertex implements Cloneable { UAltVertex() { } public UAltVertex(UID id, UVertexName vertexname, Coordinates position, IEdge_List incoming, OEdge_List outgoing) { super(id, vertexname, position, incoming, outgoing); } public static UAltVertex parse(java.io.InputStream in) throws ParseError { return new Parser(in)._UAltVertex(); } public static UAltVertex parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } UAltVertex(Ident name) { super(name); } public void ReadAllVertices_trv1(ReadVertexVisitor rvv) { rvv.before(this); } public void saveGraph_trv3(SaveGraphVisitor sgv) { sgv.before(this); super.saveGraph_trv3(sgv); } } class UTerm extends UVertex implements Cloneable { UTerm() { } public UTerm(UID id, UVertexName vertexname, Coordinates position, IEdge_List incoming, OEdge_List outgoing) { super(id, vertexname, position, incoming, outgoing); } public static UTerm parse(java.io.InputStream in) throws ParseError { return new Parser(in)._UTerm(); } public static UTerm parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } UTerm(Ident name) { super(name); } public void ReadAllVertices_trv1(ReadVertexVisitor rvv) { rvv.before(this); } public void saveGraph_trv3(SaveGraphVisitor sgv) { sgv.before(this); super.saveGraph_trv3(sgv); } } class UEdge_List implements Cloneable { private Nonempty_UEdge_List first; public Nonempty_UEdge_List get_first() { return first; } public void set_first(Nonempty_UEdge_List new_first) { first = new_first; } UEdge_List() { } public UEdge_List(Nonempty_UEdge_List first) { super(); set_first(first); } public static UEdge_List parse(java.io.InputStream in) throws ParseError { return new Parser(in)._UEdge_List(); } public static UEdge_List parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void ReadAllEdges_trv2(ReadEdgeVisitor rev) { if (first != null) { first.ReadAllEdges_trv2(rev); } } public void saveGraph_trv3(SaveGraphVisitor sgv) { sgv.before(this); if (first != null) { first.saveGraph_trv3(sgv); } } } abstract class UEdge implements Cloneable { private UID id; public UID get_id() { return id; } public void set_id(UID new_id) { id = new_id; } private UVertex fromVertex; public UVertex get_fromVertex() { return fromVertex; } public void set_fromVertex(UVertex new_fromVertex) { fromVertex = new_fromVertex; } private UVertex toVertex; public UVertex get_toVertex() { return toVertex; } public void set_toVertex(UVertex new_toVertex) { toVertex = new_toVertex; } UEdge() { } public UEdge(UID id, UVertex fromVertex, UVertex toVertex) { super(); set_id(id); set_fromVertex(fromVertex); set_toVertex(toVertex); } public void ReadAllEdges_trv2(ReadEdgeVisitor rev) { } public void saveGraph_trv3(SaveGraphVisitor sgv) { id.saveGraph_trv3(sgv); fromVertex.saveGraph_trv3(sgv); toVertex.saveGraph_trv3(sgv); } } class UAltEdge extends UEdge implements Cloneable { UAltEdge() { } public UAltEdge(UID id, UVertex fromVertex, UVertex toVertex) { super(id, fromVertex, toVertex); } public static UAltEdge parse(java.io.InputStream in) throws ParseError { return new Parser(in)._UAltEdge(); } public static UAltEdge parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } UAltEdge(Ident source , Ident dest) { super.set_fromVertex((UVertex)new UAltVertex(source)); super.set_toVertex((UVertex)new UConstVertex(dest)); //hey, the dest can be alt } public void ReadAllEdges_trv2(ReadEdgeVisitor rev) { rev.before(this); } public void saveGraph_trv3(SaveGraphVisitor sgv) { sgv.before(this); super.saveGraph_trv3(sgv); } } class UConstEdge extends UEdge implements Cloneable { private UEdgeName edgename; public UEdgeName get_edgename() { return edgename; } public void set_edgename(UEdgeName new_edgename) { edgename = new_edgename; } private Cardinality card; public Cardinality get_card() { return card; } public void set_card(Cardinality new_card) { card = new_card; } UConstEdge() { } public UConstEdge(UID id, UVertex fromVertex, UVertex toVertex, UEdgeName edgename, Cardinality card) { super(id, fromVertex, toVertex); set_edgename(edgename); set_card(card); } public static UConstEdge parse(java.io.InputStream in) throws ParseError { return new Parser(in)._UConstEdge(); } public static UConstEdge parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } UConstEdge(Ident source , Ident dest , Ident partname ) { if(partname == null) partname = new Ident(" "); super.set_fromVertex((UVertex)new UConstVertex(source)); super.set_toVertex((UVertex)new UConstVertex(dest)); set_edgename(new UEdgeName(partname)); } public void ReadAllEdges_trv2(ReadEdgeVisitor rev) { rev.before(this); } public void saveGraph_trv3(SaveGraphVisitor sgv) { sgv.before(this); edgename.saveGraph_trv3(sgv); card.saveGraph_trv3(sgv); super.saveGraph_trv3(sgv); } } class Cardinality implements Cloneable { private Lower lower; public Lower get_lower() { return lower; } public void set_lower(Lower new_lower) { lower = new_lower; } private Upper upper; public Upper get_upper() { return upper; } public void set_upper(Upper new_upper) { upper = new_upper; } Cardinality() { } public Cardinality(Lower lower, Upper upper) { super(); set_lower(lower); set_upper(upper); } public static Cardinality parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Cardinality(); } public static Cardinality parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void saveGraph_trv3(SaveGraphVisitor sgv) { lower.saveGraph_trv3(sgv); if (upper != null) { upper.saveGraph_trv3(sgv); } } } class Lower implements Cloneable { private Integer l; public Integer get_l() { return l; } public void set_l(Integer new_l) { l = new_l; } Lower() { } public Lower(Integer l) { super(); set_l(l); } public static Lower parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Lower(); } public static Lower parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void saveGraph_trv3(SaveGraphVisitor sgv) { sgv.before(this); } } class Upper implements Cloneable { private String u; public String get_u() { return u; } public void set_u(String new_u) { u = new_u; } Upper() { } public Upper(String u) { super(); set_u(u); } public static Upper parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Upper(); } public static Upper parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void saveGraph_trv3(SaveGraphVisitor sgv) { sgv.before(this); } } class UID implements Cloneable { private Integer id; public Integer get_id() { return id; } public void set_id(Integer new_id) { id = new_id; } UID() { } public UID(Integer id) { super(); set_id(id); } public static UID parse(java.io.InputStream in) throws ParseError { return new Parser(in)._UID(); } public static UID parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void saveGraph_trv3(SaveGraphVisitor sgv) { sgv.before(this); } } class UEdgeName implements Cloneable { private Ident name; public Ident get_name() { return name; } public void set_name(Ident new_name) { name = new_name; } UEdgeName() { } public UEdgeName(Ident name) { super(); set_name(name); } public static UEdgeName parse(java.io.InputStream in) throws ParseError { return new Parser(in)._UEdgeName(); } public static UEdgeName parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void saveGraph_trv3(SaveGraphVisitor sgv) { sgv.before(this); } } class UVertexName implements Cloneable { private Ident name; public Ident get_name() { return name; } public void set_name(Ident new_name) { name = new_name; } UVertexName() { } public UVertexName(Ident name) { super(); set_name(name); } public static UVertexName parse(java.io.InputStream in) throws ParseError { return new Parser(in)._UVertexName(); } public static UVertexName parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void saveGraph_trv3(SaveGraphVisitor sgv) { sgv.before(this); } } class Coordinates implements Cloneable { private X x; public X get_x() { return x; } public void set_x(X new_x) { x = new_x; } private Y y; public Y get_y() { return y; } public void set_y(Y new_y) { y = new_y; } Coordinates() { } public Coordinates(X x, Y y) { super(); set_x(x); set_y(y); } public static Coordinates parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Coordinates(); } public static Coordinates parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void saveGraph_trv3(SaveGraphVisitor sgv) { sgv.before(this); x.saveGraph_trv3(sgv); y.saveGraph_trv3(sgv); sgv.after(this); } } class X implements Cloneable { private Integer x; public Integer get_x() { return x; } public void set_x(Integer new_x) { x = new_x; } X() { } public X(Integer x) { super(); set_x(x); } public static X parse(java.io.InputStream in) throws ParseError { return new Parser(in)._X(); } public static X parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void saveGraph_trv3(SaveGraphVisitor sgv) { sgv.before(this); } } class Y implements Cloneable { private Integer y; public Integer get_y() { return y; } public void set_y(Integer new_y) { y = new_y; } Y() { } public Y(Integer y) { super(); set_y(y); } public static Y parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Y(); } public static Y parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void saveGraph_trv3(SaveGraphVisitor sgv) { sgv.before(this); } } class Program implements Cloneable { private JavaCode preamble; public JavaCode get_preamble() { return preamble; } public void set_preamble(JavaCode new_preamble) { preamble = new_preamble; } private ClassGraph classgraph; public ClassGraph get_classgraph() { return classgraph; } public void set_classgraph(ClassGraph new_classgraph) { classgraph = new_classgraph; } Program() { } public Program(JavaCode preamble, ClassGraph classgraph) { super(); set_preamble(preamble); set_classgraph(classgraph); } public static Program parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Program(); } public static Program parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public UGraph print_edges () { ClassNameTranspVisitor cntv = new ClassNameTranspVisitor(); UGraph ug = new UGraph(); EdgeDistinctionVisitor edv = new EdgeDistinctionVisitor(); EdgeVisitor aev = new EdgeVisitor(edv , cntv , ug); this.toAllSubclasses(cntv,aev); return ug ; //this to be used by the GUI } public void toAllSubclasses(ClassNameTranspVisitor cntv, EdgeVisitor aev) { toAllSubclasses_trv4(cntv, aev); } public void toAllSubclasses_trv4(ClassNameTranspVisitor cntv, EdgeVisitor aev) { classgraph.toAllSubclasses_trv4(cntv, aev); aev.after(this); } } class ClassGraph implements Cloneable { private ClassDef_DList classes; public ClassDef_DList get_classes() { return classes; } public void set_classes(ClassDef_DList new_classes) { classes = new_classes; } ClassGraph() { } public ClassGraph(ClassDef_DList classes) { super(); set_classes(classes); } public static ClassGraph parse(java.io.InputStream in) throws ParseError { return new Parser(in)._ClassGraph(); } public static ClassGraph parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void toAllSubclasses_trv4(ClassNameTranspVisitor cntv, EdgeVisitor aev) { classes.toAllSubclasses_trv4(cntv, aev); } } class ClassDef implements Cloneable { private ParamClassName paramclassname; public ParamClassName get_paramclassname() { return paramclassname; } public void set_paramclassname(ParamClassName new_paramclassname) { paramclassname = new_paramclassname; } private ClassParts classparts; public ClassParts get_classparts() { return classparts; } public void set_classparts(ClassParts new_classparts) { classparts = new_classparts; } private DFS_mark dfs_mark; public DFS_mark get_dfs_mark() { return dfs_mark; } public void set_dfs_mark(DFS_mark new_dfs_mark) { dfs_mark = new_dfs_mark; } private PP_mark pp_mark; public PP_mark get_pp_mark() { return pp_mark; } public void set_pp_mark(PP_mark new_pp_mark) { pp_mark = new_pp_mark; } ClassDef() { } public ClassDef(ParamClassName paramclassname, ClassParts classparts, DFS_mark dfs_mark, PP_mark pp_mark) { super(); set_paramclassname(paramclassname); set_classparts(classparts); set_dfs_mark(dfs_mark); set_pp_mark(pp_mark); } public static ClassDef parse(java.io.InputStream in) throws ParseError { return new Parser(in)._ClassDef(); } public static ClassDef parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void toAllSubclasses_trv4(ClassNameTranspVisitor cntv, EdgeVisitor aev) { cntv.before(this); aev.before(this); classparts.toAllSubclasses_trv4(cntv, aev); aev.after(this); } } class ParamClassName implements Cloneable { private ClassName classname; public ClassName get_classname() { return classname; } public void set_classname(ClassName new_classname) { classname = new_classname; } private ClassName_Commalist parameters; public ClassName_Commalist get_parameters() { return parameters; } public void set_parameters(ClassName_Commalist new_parameters) { parameters = new_parameters; } ParamClassName() { } public ParamClassName(ClassName classname, ClassName_Commalist parameters) { super(); set_classname(classname); set_parameters(parameters); } public static ParamClassName parse(java.io.InputStream in) throws ParseError { return new Parser(in)._ParamClassName(); } public static ParamClassName parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void toClassName_trv5(ClassNameRetVisitor cnrv) { classname.toClassName_trv5(cnrv); } } abstract class ClassParts implements Cloneable { public ClassParts() { super(); } public void toAllSubclasses_trv4(ClassNameTranspVisitor cntv, EdgeVisitor aev) { } } abstract class ConstOrAltClass extends ClassParts implements Cloneable { private PartOrSyntax_List parts; public PartOrSyntax_List get_parts() { return parts; } public void set_parts(PartOrSyntax_List new_parts) { parts = new_parts; } private ClassParents parents; public ClassParents get_parents() { return parents; } public void set_parents(ClassParents new_parents) { parents = new_parents; } ConstOrAltClass() { } public ConstOrAltClass(PartOrSyntax_List parts, ClassParents parents) { super(); set_parts(parts); set_parents(parents); } public void toAllSubclasses_trv4(ClassNameTranspVisitor cntv, EdgeVisitor aev) { parts.toAllSubclasses_trv4(cntv, aev); } } abstract class PartOrSyntax implements Cloneable { public PartOrSyntax() { super(); } public void toAllSubclasses_trv4(ClassNameTranspVisitor cntv, EdgeVisitor aev) { } } class Part extends PartOrSyntax implements Cloneable { private PartName partname; public PartName get_partname() { return partname; } public void set_partname(PartName new_partname) { partname = new_partname; } private ClassSpec classspec; public ClassSpec get_classspec() { return classspec; } public void set_classspec(ClassSpec new_classspec) { classspec = new_classspec; } Part() { } public Part(PartName partname, ClassSpec classspec) { super(); set_partname(partname); set_classspec(classspec); } public static Part parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Part(); } public static Part parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void toAllSubclasses_trv4(ClassNameTranspVisitor cntv, EdgeVisitor aev) { aev.before(this); aev.after(this); } } class OptionalPart extends PartOrSyntax implements Cloneable { private Part_Sandwich part; public Part_Sandwich get_part() { return part; } public void set_part(Part_Sandwich new_part) { part = new_part; } OptionalPart() { } public OptionalPart(Part_Sandwich part) { super(); set_part(part); } public static OptionalPart parse(java.io.InputStream in) throws ParseError { return new Parser(in)._OptionalPart(); } public static OptionalPart parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void toAllSubclasses_trv4(ClassNameTranspVisitor cntv, EdgeVisitor aev) { aev.before(this); part.toAllSubclasses_trv4(cntv, aev); aev.after(this); } } class ClassParents implements Cloneable { private ClassSpec extend; public ClassSpec get_extend() { return extend; } public void set_extend(ClassSpec new_extend) { extend = new_extend; } private ClassSpec_Commalist implement; public ClassSpec_Commalist get_implement() { return implement; } public void set_implement(ClassSpec_Commalist new_implement) { implement = new_implement; } ClassParents() { } public ClassParents(ClassSpec extend, ClassSpec_Commalist implement) { super(); set_extend(extend); set_implement(implement); } public static ClassParents parse(java.io.InputStream in) throws ParseError { return new Parser(in)._ClassParents(); } public static ClassParents parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class ConstructionClass extends ConstOrAltClass implements Cloneable { ConstructionClass() { } public ConstructionClass(PartOrSyntax_List parts, ClassParents parents) { super(parts, parents); } public static ConstructionClass parse(java.io.InputStream in) throws ParseError { return new Parser(in)._ConstructionClass(); } public static ConstructionClass parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class AlternationClass extends ConstOrAltClass implements Cloneable { private Subclass_Barlist subclasses; public Subclass_Barlist get_subclasses() { return subclasses; } public void set_subclasses(Subclass_Barlist new_subclasses) { subclasses = new_subclasses; } private Common common; public Common get_common() { return common; } public void set_common(Common new_common) { common = new_common; } AlternationClass() { } public AlternationClass(PartOrSyntax_List parts, ClassParents parents, Subclass_Barlist subclasses, Common common) { super(parts, parents); set_subclasses(subclasses); set_common(common); } public static AlternationClass parse(java.io.InputStream in) throws ParseError { return new Parser(in)._AlternationClass(); } public static AlternationClass parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void toAllSubclasses_trv4(ClassNameTranspVisitor cntv, EdgeVisitor aev) { subclasses.toAllSubclasses_trv4(cntv, aev); } } class Subclass implements Cloneable { private ClassSpec classspec; public ClassSpec get_classspec() { return classspec; } public void set_classspec(ClassSpec new_classspec) { classspec = new_classspec; } Subclass() { } public Subclass(ClassSpec classspec) { super(); set_classspec(classspec); } public static Subclass parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Subclass(); } public static Subclass parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void toAllSubclasses_trv4(ClassNameTranspVisitor cntv, EdgeVisitor aev) { aev.before(this); aev.after(this); } } class Common implements Cloneable { public Common() { super(); } public static Common parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Common(); } public static Common parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class RepetitionClass extends ClassParts implements Cloneable { private RepeatedPart_Sandwich sandwiched; public RepeatedPart_Sandwich get_sandwiched() { return sandwiched; } public void set_sandwiched(RepeatedPart_Sandwich new_sandwiched) { sandwiched = new_sandwiched; } RepetitionClass() { } public RepetitionClass(RepeatedPart_Sandwich sandwiched) { super(); set_sandwiched(sandwiched); } public static RepetitionClass parse(java.io.InputStream in) throws ParseError { return new Parser(in)._RepetitionClass(); } public static RepetitionClass parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class RepeatedPart implements Cloneable { private ClassSpec nonempty; public ClassSpec get_nonempty() { return nonempty; } public void set_nonempty(ClassSpec new_nonempty) { nonempty = new_nonempty; } private ClassSpec_Sandwich repeated; public ClassSpec_Sandwich get_repeated() { return repeated; } public void set_repeated(ClassSpec_Sandwich new_repeated) { repeated = new_repeated; } RepeatedPart() { } public RepeatedPart(ClassSpec nonempty, ClassSpec_Sandwich repeated) { super(); set_nonempty(nonempty); set_repeated(repeated); } public static RepeatedPart parse(java.io.InputStream in) throws ParseError { return new Parser(in)._RepeatedPart(); } public static RepeatedPart parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class ClassSpec implements Cloneable { private ClassName classname; public ClassName get_classname() { return classname; } public void set_classname(ClassName new_classname) { classname = new_classname; } private ClassSpec_Commalist actual_parameters; public ClassSpec_Commalist get_actual_parameters() { return actual_parameters; } public void set_actual_parameters(ClassSpec_Commalist new_actual_parameters) { actual_parameters = new_actual_parameters; } private PP_mark pp_mark; public PP_mark get_pp_mark() { return pp_mark; } public void set_pp_mark(PP_mark new_pp_mark) { pp_mark = new_pp_mark; } ClassSpec() { } public ClassSpec(ClassName classname, ClassSpec_Commalist actual_parameters, PP_mark pp_mark) { super(); set_classname(classname); set_actual_parameters(actual_parameters); set_pp_mark(pp_mark); } public static ClassSpec parse(java.io.InputStream in) throws ParseError { return new Parser(in)._ClassSpec(); } public static ClassSpec parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } abstract class Syntax extends PartOrSyntax implements Cloneable { public Syntax() { super(); } } class PlainSyntax extends Syntax implements Cloneable { private String string; public String get_string() { return string; } public void set_string(String new_string) { string = new_string; } PlainSyntax() { } public PlainSyntax(String string) { super(); set_string(string); } public static PlainSyntax parse(java.io.InputStream in) throws ParseError { return new Parser(in)._PlainSyntax(); } public static PlainSyntax parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } abstract class PrintCommand extends Syntax implements Cloneable { public PrintCommand() { super(); } } class PrintIndent extends PrintCommand implements Cloneable { public PrintIndent() { super(); } public static PrintIndent parse(java.io.InputStream in) throws ParseError { return new Parser(in)._PrintIndent(); } public static PrintIndent parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class PrintUnindent extends PrintCommand implements Cloneable { public PrintUnindent() { super(); } public static PrintUnindent parse(java.io.InputStream in) throws ParseError { return new Parser(in)._PrintUnindent(); } public static PrintUnindent parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class PrintSkip extends PrintCommand implements Cloneable { public PrintSkip() { super(); } public static PrintSkip parse(java.io.InputStream in) throws ParseError { return new Parser(in)._PrintSkip(); } public static PrintSkip parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class PrintSpace extends PrintCommand implements Cloneable { public PrintSpace() { super(); } public static PrintSpace parse(java.io.InputStream in) throws ParseError { return new Parser(in)._PrintSpace(); } public static PrintSpace parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class DFS_mark implements Cloneable { public DFS_mark() { super(); } public static DFS_mark parse(java.io.InputStream in) throws ParseError { return new Parser(in)._DFS_mark(); } public static DFS_mark parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class PP_mark implements Cloneable { public PP_mark() { super(); } public static PP_mark parse(java.io.InputStream in) throws ParseError { return new Parser(in)._PP_mark(); } public static PP_mark parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class Verbatim implements Cloneable { private JavaCode javacode; public JavaCode get_javacode() { return javacode; } public void set_javacode(JavaCode new_javacode) { javacode = new_javacode; } Verbatim() { } public Verbatim(JavaCode javacode) { super(); set_javacode(javacode); } public static Verbatim parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Verbatim(); } public static Verbatim parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class ClassName implements Cloneable { private Ident name; public Ident get_name() { return name; } public void set_name(Ident new_name) { name = new_name; } ClassName() { } public ClassName(Ident name) { super(); set_name(name); } public static ClassName parse(java.io.InputStream in) throws ParseError { return new Parser(in)._ClassName(); } public static ClassName parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void toClassName_trv5(ClassNameRetVisitor cnrv) { cnrv.before(this); } } class PartName implements Cloneable { private Ident name; public Ident get_name() { return name; } public void set_name(Ident new_name) { name = new_name; } PartName() { } public PartName(Ident name) { super(); set_name(name); } public static PartName parse(java.io.InputStream in) throws ParseError { return new Parser(in)._PartName(); } public static PartName parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class TraversalName implements Cloneable { private Ident name; public Ident get_name() { return name; } public void set_name(Ident new_name) { name = new_name; } TraversalName() { } public TraversalName(Ident name) { super(); set_name(name); } public static TraversalName parse(java.io.InputStream in) throws ParseError { return new Parser(in)._TraversalName(); } public static TraversalName parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class VisitorName implements Cloneable { private Ident name; public Ident get_name() { return name; } public void set_name(Ident new_name) { name = new_name; } VisitorName() { } public VisitorName(Ident name) { super(); set_name(name); } public static VisitorName parse(java.io.InputStream in) throws ParseError { return new Parser(in)._VisitorName(); } public static VisitorName parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class MethodName implements Cloneable { private Ident name; public Ident get_name() { return name; } public void set_name(Ident new_name) { name = new_name; } MethodName() { } public MethodName(Ident name) { super(); set_name(name); } public static MethodName parse(java.io.InputStream in) throws ParseError { return new Parser(in)._MethodName(); } public static MethodName parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class JavaCode implements Cloneable { private String code; public String get_code() { return code; } public void set_code(String new_code) { code = new_code; } JavaCode() { } public JavaCode(String code) { super(); set_code(code); } public static JavaCode parse(java.io.InputStream in) throws ParseError { return new Parser(in)._JavaCode(); } public static JavaCode parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class Parameterized implements Cloneable { private Part_Commalist part_commalist; public Part_Commalist get_part_commalist() { return part_commalist; } public void set_part_commalist(Part_Commalist new_part_commalist) { part_commalist = new_part_commalist; } Parameterized() { } public Parameterized(Part_Commalist part_commalist) { super(); set_part_commalist(part_commalist); } public static Parameterized parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Parameterized(); } public static Parameterized parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class SyntaxTable implements Cloneable { private PlainSyntax_List plainsyntax_list; public PlainSyntax_List get_plainsyntax_list() { return plainsyntax_list; } public void set_plainsyntax_list(PlainSyntax_List new_plainsyntax_list) { plainsyntax_list = new_plainsyntax_list; } SyntaxTable() { } public SyntaxTable(PlainSyntax_List plainsyntax_list) { super(); set_plainsyntax_list(plainsyntax_list); } public static SyntaxTable parse(java.io.InputStream in) throws ParseError { return new Parser(in)._SyntaxTable(); } public static SyntaxTable parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class PrintVisitor implements Cloneable { private UGraph ugraph; public UGraph get_ugraph() { return ugraph; } public void set_ugraph(UGraph new_ugraph) { ugraph = new_ugraph; } PrintVisitor() { } public PrintVisitor(UGraph ugraph) { super(); set_ugraph(ugraph); } public static PrintVisitor parse(java.io.InputStream in) throws ParseError { return new Parser(in)._PrintVisitor(); } public static PrintVisitor parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class PlacementVisitor implements Cloneable { private UGraph ugraph; public UGraph get_ugraph() { return ugraph; } public void set_ugraph(UGraph new_ugraph) { ugraph = new_ugraph; } PlacementVisitor() { } public PlacementVisitor(UGraph ugraph) { super(); set_ugraph(ugraph); } public static PlacementVisitor parse(java.io.InputStream in) throws ParseError { return new Parser(in)._PlacementVisitor(); } public static PlacementVisitor parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } private int maxedges ; private int maxvertices ; private Hashtable vTable ; private Hashtable eTable ; void anneal_init() { Nonempty_UEdge_List elist; Nonempty_UVertex_List vlist; UVertex uv; UEdge ue; //--------------what follows would look better in the constructor //---------------but i didnt want to touch generated constructors maxedges = this.ugraph.get_edges().get_first().get_it().get_id().get_id().intValue(); maxvertices = this.ugraph.get_vertices().get_first().get_it().get_id().get_id().intValue(); vTable = new Hashtable(maxvertices); eTable = new Hashtable(maxedges); //----------------------------------------------- vlist = this.ugraph.get_vertices().get_first(); while(vlist != null) { uv = vlist.get_it(); vTable.put(uv.get_id().get_id() , uv); vlist = vlist.get_next(); } elist = this.ugraph.get_edges().get_first(); while(elist != null) { ue = elist.get_it(); eTable.put(ue.get_id().get_id() , ue); elist = elist.get_next(); } } void anneal() { anneal_init(); int temp = 1000; double rate = 0.80 ; UID id1 = new UID(); UID id2 = new UID(); double prob = 0; double rndm = 0; int cost; for ( ;temp > 0 ; temp = (int) (((double)temp)*rate)) { do { id1.set_id(new Integer((int) Math.ceil( Math.random() * maxvertices ))); id2.set_id(new Integer((int) Math.ceil( Math.random() * maxvertices ))); }while ( id1.get_id().intValue() == id2.get_id().intValue() ); UVertex v1 = (UVertex)this.vTable.get(id1.get_id()); UVertex v2 = (UVertex)this.vTable.get(id2.get_id()); cost = cost_of_swap( v1 , v2 ); if(cost > 0) { prob = Math.exp(-(cost*cost)/temp); rndm = Math.random(); } if(cost <= 0 | rndm < prob ) { swap_vertex_pos(v1 , v2); //increse # of swaps // System.out.println("Swapping vertex at temp = " + temp); } } } int vertex_cost(UVertex v) { int x1 , x2; int y1 , y2; double length = 0; UVertex v2; x1 = v.get_position().get_x().get_x().intValue(); y1 = v.get_position().get_y().get_y().intValue(); Nonempty_IEdge_List inlist; Nonempty_OEdge_List outlist ; UID uid; inlist = v.get_incoming().get_first(); while(inlist != null) { uid = inlist.get_it(); v2 = (UVertex)vTable.get(uid.get_id()); x2 = v2.get_position().get_x().get_x().intValue(); y2 = v2.get_position().get_y().get_y().intValue(); length += Math. sqrt(x1*x2 - y1*y2); inlist = inlist.get_next(); } outlist = v.get_outgoing().get_first(); while(outlist != null) { uid = outlist.get_it(); v2 = (UVertex)vTable.get(uid.get_id()); x2 = v2.get_position().get_x().get_x().intValue(); y2 = v2.get_position().get_y().get_y().intValue(); length += Math. sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)); outlist = outlist.get_next(); } // System.out.println("vertex cost " + length); return (int)length; } int graph_cost() { return 0; } void swap_vertex_pos(UVertex v1 , UVertex v2) { Coordinates pos; pos = v1.get_position(); v1.set_position(v2.get_position()); v2.set_position(pos); } int cost_of_swap(UVertex v1 , UVertex v2) { int cost1 , cost2; cost1= vertex_cost(v1) + vertex_cost(v2); swap_vertex_pos(v1,v2); cost2= vertex_cost(v1) + vertex_cost(v2); swap_vertex_pos(v1,v2); return (cost2 - cost1) ; } } class EdgeDistinctionVisitor implements Cloneable { private String edgetype; public String get_edgetype() { return edgetype; } public void set_edgetype(String new_edgetype) { edgetype = new_edgetype; } EdgeDistinctionVisitor() { } public EdgeDistinctionVisitor(String edgetype) { super(); set_edgetype(edgetype); } public static EdgeDistinctionVisitor parse(java.io.InputStream in) throws ParseError { return new Parser(in)._EdgeDistinctionVisitor(); } public static EdgeDistinctionVisitor parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class ClassNameRetVisitor implements Cloneable { private ClassName cn; public ClassName get_cn() { return cn; } public void set_cn(ClassName new_cn) { cn = new_cn; } ClassNameRetVisitor() { } public ClassNameRetVisitor(ClassName cn) { super(); set_cn(cn); } public static ClassNameRetVisitor parse(java.io.InputStream in) throws ParseError { return new Parser(in)._ClassNameRetVisitor(); } public static ClassNameRetVisitor parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void before(ClassName host) { this.set_cn(host); } } class ClassNameTranspVisitor implements Cloneable { private ParamClassName pcn; public ParamClassName get_pcn() { return pcn; } public void set_pcn(ParamClassName new_pcn) { pcn = new_pcn; } ClassNameTranspVisitor() { } public ClassNameTranspVisitor(ParamClassName pcn) { super(); set_pcn(pcn); } public static ClassNameTranspVisitor parse(java.io.InputStream in) throws ParseError { return new Parser(in)._ClassNameTranspVisitor(); } public static ClassNameTranspVisitor parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void before(ClassDef host) { this.set_pcn(host.get_paramclassname()); } public void toClassName_trv5(ClassNameRetVisitor cnrv) { pcn.toClassName_trv5(cnrv); } } class EdgeVisitor implements Cloneable { private EdgeDistinctionVisitor edv; public EdgeDistinctionVisitor get_edv() { return edv; } public void set_edv(EdgeDistinctionVisitor new_edv) { edv = new_edv; } private ClassNameTranspVisitor cntv; public ClassNameTranspVisitor get_cntv() { return cntv; } public void set_cntv(ClassNameTranspVisitor new_cntv) { cntv = new_cntv; } private UGraph ugraph; public UGraph get_ugraph() { return ugraph; } public void set_ugraph(UGraph new_ugraph) { ugraph = new_ugraph; } EdgeVisitor() { } public EdgeVisitor(EdgeDistinctionVisitor edv, ClassNameTranspVisitor cntv, UGraph ugraph) { super(); set_edv(edv); set_cntv(cntv); set_ugraph(ugraph); } public static EdgeVisitor parse(java.io.InputStream in) throws ParseError { return new Parser(in)._EdgeVisitor(); } public static EdgeVisitor parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } /** Retrieve the class name from the visitor. Requires a traversal from the visitor class which itself needs a visitor. */ public ClassName dig_out() { ClassNameRetVisitor cnrv = new ClassNameRetVisitor(); this.toClassName(cnrv); return cnrv.get_cn(); } Hashtable hTable = new Hashtable(50); //magic number why 50? UVertex uv; //create a UVertex* in the visitor //creating instances before ClassDef UEdge ue; //create a UEdge* in the visitor //creating instances before Part & Subclass boolean bFlag ; //to diff alt and const vertex. //false = alt vertex. boolean bOptFlag; //for diff cardinality.(optional = 0). //true = optional part. public void before(ClassDef host) { this.bFlag = true; //TRUE means const vertex ; FALSE means its alt vertex // set to TRUE before each vertex this.bOptFlag = false; } public void after(ClassDef host) { //if present and UTerm, delete and add //else return if( this.hTable.containsKey(this.dig_out().get_name())==true) { System.out.println("**vector contains**"+this.hTable.get(this.dig_out().get_name()).getClass().getName()); if(this.hTable.get( this.dig_out().get_name()).getClass().getName().endsWith("UTerm")) { this.hTable.remove( this.dig_out().get_name()); } else { System.out.println("**Possible redefinition of class " + this.dig_out().get_name()); this.hTable.remove( this.dig_out().get_name()); //keep only the latest definition return ; } } //add the vertex since it is not present. if(this.bFlag == true) { uv = new UConstVertex(this.dig_out().get_name()); } else { uv = new UAltVertex(this.dig_out().get_name()); } this.hTable.put(this.dig_out().get_name() , uv); } public void before(Part host) { ue = new UConstEdge(this.dig_out().get_name(), host.get_classspec().get_classname().get_name() , host.get_partname().get_name() ); //add source, dest, partname //add vertex to hashtable if not already present if( this.hTable.containsKey( host.get_classspec().get_classname().get_name())==false) { this.hTable.put( host.get_classspec().get_classname().get_name() , new UTerm(host.get_classspec().get_classname().get_name() )); } } public void after(Part host) { Cardinality crdn; if(this.bOptFlag == true) { crdn = new Cardinality(new Lower(new Integer(0)) ,new Upper( new String("1"))); } else { crdn = new Cardinality(); crdn.set_lower(new Lower(new Integer(1))); } ((UConstEdge)ue).set_card(crdn); this.ugraph.add_uedge(ue); } public void before(Subclass host) { this.bFlag = false; ue = new UAltEdge(this.dig_out().get_name(), host.get_classspec().get_classname().get_name() ); // add source, dest //add vertex to hashtable if not already present if( this.hTable.containsKey( host.get_classspec().get_classname().get_name())==false) { this.hTable.put( host.get_classspec().get_classname().get_name() , new UTerm(host.get_classspec().get_classname().get_name() )); } } public void after(Subclass host) { this.ugraph.add_uedge(ue); } public void before(OptionalPart host) { this.bOptFlag = true; } public void after(OptionalPart host) { this.bOptFlag = false; } public void after(Program host) { Enumeration e = this.hTable.keys(), e2 = this.hTable.elements(); int count ; for( count =1 ; e.hasMoreElements() ; count++) //assign unique id# to vertices and add to list { e.nextElement(); uv = (UVertex)e2.nextElement(); uv.set_id(new UID(new Integer(count))); this.ugraph.add_uvertex(uv); } //assign edges unique id# and let all edges reflect // the right type of to & from Vertex Nonempty_UEdge_List list; list = this.ugraph.get_edges().get_first(); UID uid; count = 1; while(list != null) { ue = list.get_it(); //-------------actual code uid = new UID(new Integer(count)); ue.set_id( uid ); //set uids uv =(UVertex)this.hTable.get( ue.get_fromVertex().get_vertexname().get_name() ); ue.set_fromVertex( uv ); //update fromvertex uv.add_outgoing( uid ); uv =(UVertex)this.hTable.get( ue.get_toVertex().get_vertexname().get_name() ); ue.set_toVertex( uv ); //update tovertex uv.add_incoming( uid ); //------------- list = list.get_next(); count++; } } public void toClassName(ClassNameRetVisitor cnrv) { toClassName_trv5(cnrv); } public void toClassName_trv5(ClassNameRetVisitor cnrv) { cntv.toClassName_trv5(cnrv); } } class ReadVertexVisitor implements Cloneable { private VertexContainer elements; public VertexContainer get_elements() { return elements; } public void set_elements(VertexContainer new_elements) { elements = new_elements; } ReadVertexVisitor() { } public ReadVertexVisitor(VertexContainer elements) { super(); set_elements(elements); } public static ReadVertexVisitor parse(java.io.InputStream in) throws ParseError { return new Parser(in)._ReadVertexVisitor(); } public static ReadVertexVisitor parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void before(UAltVertex host) { String vertex_name=host.get_vertexname().get_name().toString(); Integer vertex_x=host.get_position().get_x().get_x(); Integer vertex_y=host.get_position().get_y().get_y(); Point p = new Point(vertex_x.intValue(), vertex_y.intValue()); UID uid=host.get_id(); VertexInfo vertexinfo = new VertexInfo (vertex_name, p,uid); elements.get_alternation().addElement(vertexinfo); } public void before(UConstVertex host) { String vertex_name=host.get_vertexname().get_name().toString(); Integer vertex_x=host.get_position().get_x().get_x(); Integer vertex_y=host.get_position().get_y().get_y(); Point p = new Point(vertex_x.intValue(), vertex_y.intValue()); UID uid=host.get_id(); VertexInfo _vertexinfo = new VertexInfo (vertex_name, p,uid); elements.get_construction().addElement(_vertexinfo); } public void before(UTerm host) { String vertex_name=host.get_vertexname().get_name().toString(); Integer vertex_x=host.get_position().get_x().get_x(); Integer vertex_y=host.get_position().get_y().get_y(); Point p = new Point(vertex_x.intValue(), vertex_y.intValue()); UID uid=host.get_id(); VertexInfo _vertexinfo = new VertexInfo (vertex_name, p,uid); elements.get_construction().addElement(_vertexinfo); } } class VertexContainer implements Cloneable { public VertexContainer() { super(); } public static VertexContainer parse(java.io.InputStream in) throws ParseError { return new Parser(in)._VertexContainer(); } public static VertexContainer parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } private Vector construction; public Vector get_construction() { return construction; } public Vector set_construction(Vector construction) { Vector old_construction = this.construction; this.construction = construction; return old_construction; } private Vector alternation; public Vector get_alternation() { return alternation; } public Vector set_alternation(Vector alternation) { Vector old_alternation = this.alternation; this.alternation = alternation; return old_alternation; } private Vector termination; public Vector get_termination() { return termination; } public Vector set_termination(Vector termination) { Vector old_termination = this.termination; this.termination = termination; return old_termination; } /* VertexContainer() { }*/ public VertexContainer(Vector construction , Vector alternation , Vector termination ) { super(); set_construction(construction); set_alternation(alternation); set_termination(termination); } /* public static VertexContainer parse(java.io.InputStream in) throws Exception { Parser p = new Parser(in); return p.VertexContainer(); } public static VertexContainer parse(String str) throws Exception { return parse(new java.io.StringBufferInputStream(str)); } */ } class ReadEdgeVisitor implements Cloneable { private EdgeContainer elements; public EdgeContainer get_elements() { return elements; } public void set_elements(EdgeContainer new_elements) { elements = new_elements; } ReadEdgeVisitor() { } public ReadEdgeVisitor(EdgeContainer elements) { super(); set_elements(elements); } public static ReadEdgeVisitor parse(java.io.InputStream in) throws ParseError { return new Parser(in)._ReadEdgeVisitor(); } public static ReadEdgeVisitor parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void before(UAltEdge host) { UID from=host.get_fromVertex().get_id(); UID to=host.get_toVertex().get_id(); UID uid=host.get_id(); EdgeInfo edgeinfo = new EdgeInfo(null,null, from, to,uid); elements.get_alternation().addElement(edgeinfo); } public void before(UConstEdge host) { String edge_name=host.get_edgename().get_name().toString(); String card = host.get_card().get_lower().get_l() + (host.get_card().get_upper()==null?"":".."+host.get_card().get_upper().get_u()); UID from=host.get_fromVertex().get_id(); UID to=host.get_toVertex().get_id(); UID uid=host.get_id(); EdgeInfo edgeinfo = new EdgeInfo(edge_name,card, from, to,uid); elements.get_construction().addElement(edgeinfo); } } class EdgeContainer implements Cloneable { public EdgeContainer() { super(); } public static EdgeContainer parse(java.io.InputStream in) throws ParseError { return new Parser(in)._EdgeContainer(); } public static EdgeContainer parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } private Vector construction; public Vector get_construction() { return construction; } public Vector set_construction(Vector construction) { Vector old_construction = this.construction; this.construction = construction; return old_construction; } private Vector alternation; public Vector get_alternation() { return alternation; } public Vector set_alternation(Vector alternation) { Vector old_alternation = this.alternation; this.alternation = alternation; return old_alternation; } /*EdgeContainer() { }*/ public EdgeContainer(Vector construction , Vector alternation ) { super(); set_construction(construction); set_alternation(alternation); } /*public static EdgeContainer parse(java.io.InputStream in) throws Exception { Parser p = new Parser(in); return p.EdgeContainer(); } public static EdgeContainer parse(String str) throws Exception { return parse(new java.io.StringBufferInputStream(str)); }*/ } class SaveGraphVisitor implements Cloneable { private String graphString; public String get_graphString() { return graphString; } public void set_graphString(String new_graphString) { graphString = new_graphString; } SaveGraphVisitor() { } public SaveGraphVisitor(String graphString) { super(); set_graphString(graphString); } public static SaveGraphVisitor parse(java.io.InputStream in) throws ParseError { return new Parser(in)._SaveGraphVisitor(); } public static SaveGraphVisitor parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void before(UGraph host) { graphString = graphString + "#Class #Dictionary #Graph\n"; } public void before(UVertex_List host) {graphString = graphString + "\n#Vertex #List\n"; } public void before(UEdge_List host) {graphString = graphString + "\n#Edge #List\n"; } public void before(IEdge_List host) { graphString = graphString + "#Incoming "; } public void before(OEdge_List host) { graphString = graphString + "#Outgoing "; } public void before(UConstVertex host) { graphString = graphString +"\n #ConstVertex "; } public void before(UAltVertex host) { graphString = graphString + "\n #AltVertex "; } public void before(UTerm host) { graphString = graphString +"\n #TermVertex "; } public void before(UAltEdge host) { graphString = graphString + "\n #AltEdge "; } public void before(UConstEdge host) { graphString = graphString + "\n #ConstEdge "; } public void before(UEdgeName host) { graphString = graphString + host.get_name() +" "; } public void before(UVertexName host) { graphString = graphString + host.get_name() +" "; } public void before(Coordinates host) { graphString = graphString + " { "; } public void after(Coordinates host) { graphString = graphString + " } "; } public void before(X host) { graphString = graphString + host.get_x() +" "; } public void before(Y host) { graphString = graphString + host.get_y() +" "; } public void before(UID host) { graphString = graphString + host.get_id() +" "; } public void before(Lower host) { graphString = graphString + host.get_l() +" "; } public void before(Upper host) { graphString = graphString + ".." + "\"" + host.get_u() + "\" "; } } class Main implements Cloneable { public Main() { super(); } public static Main parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Main(); } public static Main parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public static void main(String args[]) throws Exception { FileInputStream fi=new FileInputStream("demdraw.input"); UGraph graph = UGraph.parse(fi); graph.GetAllVertices(); graph.GetAllEdges(); System.out.println(graph.GetGraphString()); } } class CountingVisitor implements Cloneable { private Integer total; public Integer get_total() { return total; } public void set_total(Integer new_total) { total = new_total; } CountingVisitor() { } public CountingVisitor(Integer total) { super(); set_total(total); } public static CountingVisitor parse(java.io.InputStream in) throws ParseError { return new Parser(in)._CountingVisitor(); } public static CountingVisitor parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class ClassDef_DList implements Cloneable { private Nonempty_ClassDef_DList first; public Nonempty_ClassDef_DList get_first() { return first; } public void set_first(Nonempty_ClassDef_DList new_first) { first = new_first; } ClassDef_DList() { } public ClassDef_DList(Nonempty_ClassDef_DList first) { super(); set_first(first); } public static ClassDef_DList parse(java.io.InputStream in) throws ParseError { return new Parser(in)._ClassDef_DList(); } public static ClassDef_DList parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void toAllSubclasses_trv4(ClassNameTranspVisitor cntv, EdgeVisitor aev) { first.toAllSubclasses_trv4(cntv, aev); } } class ClassName_Commalist implements Cloneable { private Nonempty_ClassName_Commalist first; public Nonempty_ClassName_Commalist get_first() { return first; } public void set_first(Nonempty_ClassName_Commalist new_first) { first = new_first; } ClassName_Commalist() { } public ClassName_Commalist(Nonempty_ClassName_Commalist first) { super(); set_first(first); } public static ClassName_Commalist parse(java.io.InputStream in) throws ParseError { return new Parser(in)._ClassName_Commalist(); } public static ClassName_Commalist parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class PartOrSyntax_List implements Cloneable { private Nonempty_PartOrSyntax_List first; public Nonempty_PartOrSyntax_List get_first() { return first; } public void set_first(Nonempty_PartOrSyntax_List new_first) { first = new_first; } PartOrSyntax_List() { } public PartOrSyntax_List(Nonempty_PartOrSyntax_List first) { super(); set_first(first); } public static PartOrSyntax_List parse(java.io.InputStream in) throws ParseError { return new Parser(in)._PartOrSyntax_List(); } public static PartOrSyntax_List parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void toAllSubclasses_trv4(ClassNameTranspVisitor cntv, EdgeVisitor aev) { if (first != null) { first.toAllSubclasses_trv4(cntv, aev); } } } class Part_Sandwich implements Cloneable { private Syntax_List first; public Syntax_List get_first() { return first; } public void set_first(Syntax_List new_first) { first = new_first; } private Part inner; public Part get_inner() { return inner; } public void set_inner(Part new_inner) { inner = new_inner; } private Syntax_List second; public Syntax_List get_second() { return second; } public void set_second(Syntax_List new_second) { second = new_second; } Part_Sandwich() { } public Part_Sandwich(Syntax_List first, Part inner, Syntax_List second) { super(); set_first(first); set_inner(inner); set_second(second); } public static Part_Sandwich parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Part_Sandwich(); } public static Part_Sandwich parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void toAllSubclasses_trv4(ClassNameTranspVisitor cntv, EdgeVisitor aev) { inner.toAllSubclasses_trv4(cntv, aev); } } class ClassSpec_Commalist implements Cloneable { private Nonempty_ClassSpec_Commalist first; public Nonempty_ClassSpec_Commalist get_first() { return first; } public void set_first(Nonempty_ClassSpec_Commalist new_first) { first = new_first; } ClassSpec_Commalist() { } public ClassSpec_Commalist(Nonempty_ClassSpec_Commalist first) { super(); set_first(first); } public static ClassSpec_Commalist parse(java.io.InputStream in) throws ParseError { return new Parser(in)._ClassSpec_Commalist(); } public static ClassSpec_Commalist parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class Subclass_Barlist implements Cloneable { private Nonempty_Subclass_Barlist first; public Nonempty_Subclass_Barlist get_first() { return first; } public void set_first(Nonempty_Subclass_Barlist new_first) { first = new_first; } Subclass_Barlist() { } public Subclass_Barlist(Nonempty_Subclass_Barlist first) { super(); set_first(first); } public static Subclass_Barlist parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Subclass_Barlist(); } public static Subclass_Barlist parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void toAllSubclasses_trv4(ClassNameTranspVisitor cntv, EdgeVisitor aev) { first.toAllSubclasses_trv4(cntv, aev); } } class RepeatedPart_Sandwich implements Cloneable { private Syntax_List first; public Syntax_List get_first() { return first; } public void set_first(Syntax_List new_first) { first = new_first; } private RepeatedPart inner; public RepeatedPart get_inner() { return inner; } public void set_inner(RepeatedPart new_inner) { inner = new_inner; } private Syntax_List second; public Syntax_List get_second() { return second; } public void set_second(Syntax_List new_second) { second = new_second; } RepeatedPart_Sandwich() { } public RepeatedPart_Sandwich(Syntax_List first, RepeatedPart inner, Syntax_List second) { super(); set_first(first); set_inner(inner); set_second(second); } public static RepeatedPart_Sandwich parse(java.io.InputStream in) throws ParseError { return new Parser(in)._RepeatedPart_Sandwich(); } public static RepeatedPart_Sandwich parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class ClassSpec_Sandwich implements Cloneable { private Syntax_List first; public Syntax_List get_first() { return first; } public void set_first(Syntax_List new_first) { first = new_first; } private ClassSpec inner; public ClassSpec get_inner() { return inner; } public void set_inner(ClassSpec new_inner) { inner = new_inner; } private Syntax_List second; public Syntax_List get_second() { return second; } public void set_second(Syntax_List new_second) { second = new_second; } ClassSpec_Sandwich() { } public ClassSpec_Sandwich(Syntax_List first, ClassSpec inner, Syntax_List second) { super(); set_first(first); set_inner(inner); set_second(second); } public static ClassSpec_Sandwich parse(java.io.InputStream in) throws ParseError { return new Parser(in)._ClassSpec_Sandwich(); } public static ClassSpec_Sandwich parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class Syntax_List implements Cloneable { private Nonempty_Syntax_List first; public Nonempty_Syntax_List get_first() { return first; } public void set_first(Nonempty_Syntax_List new_first) { first = new_first; } Syntax_List() { } public Syntax_List(Nonempty_Syntax_List first) { super(); set_first(first); } public static Syntax_List parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Syntax_List(); } public static Syntax_List parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class Part_Commalist implements Cloneable { private Nonempty_Part_Commalist first; public Nonempty_Part_Commalist get_first() { return first; } public void set_first(Nonempty_Part_Commalist new_first) { first = new_first; } Part_Commalist() { } public Part_Commalist(Nonempty_Part_Commalist first) { super(); set_first(first); } public static Part_Commalist parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Part_Commalist(); } public static Part_Commalist parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class PlainSyntax_List implements Cloneable { private Nonempty_PlainSyntax_List first; public Nonempty_PlainSyntax_List get_first() { return first; } public void set_first(Nonempty_PlainSyntax_List new_first) { first = new_first; } PlainSyntax_List() { } public PlainSyntax_List(Nonempty_PlainSyntax_List first) { super(); set_first(first); } public static PlainSyntax_List parse(java.io.InputStream in) throws ParseError { return new Parser(in)._PlainSyntax_List(); } public static PlainSyntax_List parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class Nonempty_UVertex_List implements Cloneable { private UVertex it; public UVertex get_it() { return it; } public void set_it(UVertex new_it) { it = new_it; } private Nonempty_UVertex_List next; public Nonempty_UVertex_List get_next() { return next; } public void set_next(Nonempty_UVertex_List new_next) { next = new_next; } Nonempty_UVertex_List() { } public Nonempty_UVertex_List(UVertex it, Nonempty_UVertex_List next) { super(); set_it(it); set_next(next); } public static Nonempty_UVertex_List parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Nonempty_UVertex_List(); } public static Nonempty_UVertex_List parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void ReadAllVertices_trv1(ReadVertexVisitor rvv) { it.ReadAllVertices_trv1(rvv); if (next != null) { next.ReadAllVertices_trv1(rvv); } } public void saveGraph_trv3(SaveGraphVisitor sgv) { it.saveGraph_trv3(sgv); if (next != null) { next.saveGraph_trv3(sgv); } } } class Nonempty_IEdge_List implements Cloneable { private UID it; public UID get_it() { return it; } public void set_it(UID new_it) { it = new_it; } private Nonempty_IEdge_List next; public Nonempty_IEdge_List get_next() { return next; } public void set_next(Nonempty_IEdge_List new_next) { next = new_next; } Nonempty_IEdge_List() { } public Nonempty_IEdge_List(UID it, Nonempty_IEdge_List next) { super(); set_it(it); set_next(next); } public static Nonempty_IEdge_List parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Nonempty_IEdge_List(); } public static Nonempty_IEdge_List parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void saveGraph_trv3(SaveGraphVisitor sgv) { it.saveGraph_trv3(sgv); if (next != null) { next.saveGraph_trv3(sgv); } } } class Nonempty_OEdge_List implements Cloneable { private UID it; public UID get_it() { return it; } public void set_it(UID new_it) { it = new_it; } private Nonempty_OEdge_List next; public Nonempty_OEdge_List get_next() { return next; } public void set_next(Nonempty_OEdge_List new_next) { next = new_next; } Nonempty_OEdge_List() { } public Nonempty_OEdge_List(UID it, Nonempty_OEdge_List next) { super(); set_it(it); set_next(next); } public static Nonempty_OEdge_List parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Nonempty_OEdge_List(); } public static Nonempty_OEdge_List parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void saveGraph_trv3(SaveGraphVisitor sgv) { it.saveGraph_trv3(sgv); if (next != null) { next.saveGraph_trv3(sgv); } } } class Nonempty_UEdge_List implements Cloneable { private UEdge it; public UEdge get_it() { return it; } public void set_it(UEdge new_it) { it = new_it; } private Nonempty_UEdge_List next; public Nonempty_UEdge_List get_next() { return next; } public void set_next(Nonempty_UEdge_List new_next) { next = new_next; } Nonempty_UEdge_List() { } public Nonempty_UEdge_List(UEdge it, Nonempty_UEdge_List next) { super(); set_it(it); set_next(next); } public static Nonempty_UEdge_List parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Nonempty_UEdge_List(); } public static Nonempty_UEdge_List parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void ReadAllEdges_trv2(ReadEdgeVisitor rev) { it.ReadAllEdges_trv2(rev); if (next != null) { next.ReadAllEdges_trv2(rev); } } public void saveGraph_trv3(SaveGraphVisitor sgv) { it.saveGraph_trv3(sgv); if (next != null) { next.saveGraph_trv3(sgv); } } } class Nonempty_ClassDef_DList implements Cloneable { private ClassDef it; public ClassDef get_it() { return it; } public void set_it(ClassDef new_it) { it = new_it; } private Nonempty_ClassDef_DList next; public Nonempty_ClassDef_DList get_next() { return next; } public void set_next(Nonempty_ClassDef_DList new_next) { next = new_next; } Nonempty_ClassDef_DList() { } public Nonempty_ClassDef_DList(ClassDef it, Nonempty_ClassDef_DList next) { super(); set_it(it); set_next(next); } public static Nonempty_ClassDef_DList parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Nonempty_ClassDef_DList(); } public static Nonempty_ClassDef_DList parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void toAllSubclasses_trv4(ClassNameTranspVisitor cntv, EdgeVisitor aev) { it.toAllSubclasses_trv4(cntv, aev); if (next != null) { next.toAllSubclasses_trv4(cntv, aev); } } } class Nonempty_ClassName_Commalist implements Cloneable { private ClassName it; public ClassName get_it() { return it; } public void set_it(ClassName new_it) { it = new_it; } private Nonempty_ClassName_Commalist next; public Nonempty_ClassName_Commalist get_next() { return next; } public void set_next(Nonempty_ClassName_Commalist new_next) { next = new_next; } Nonempty_ClassName_Commalist() { } public Nonempty_ClassName_Commalist(ClassName it, Nonempty_ClassName_Commalist next) { super(); set_it(it); set_next(next); } public static Nonempty_ClassName_Commalist parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Nonempty_ClassName_Commalist(); } public static Nonempty_ClassName_Commalist parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class Nonempty_PartOrSyntax_List implements Cloneable { private PartOrSyntax it; public PartOrSyntax get_it() { return it; } public void set_it(PartOrSyntax new_it) { it = new_it; } private Nonempty_PartOrSyntax_List next; public Nonempty_PartOrSyntax_List get_next() { return next; } public void set_next(Nonempty_PartOrSyntax_List new_next) { next = new_next; } Nonempty_PartOrSyntax_List() { } public Nonempty_PartOrSyntax_List(PartOrSyntax it, Nonempty_PartOrSyntax_List next) { super(); set_it(it); set_next(next); } public static Nonempty_PartOrSyntax_List parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Nonempty_PartOrSyntax_List(); } public static Nonempty_PartOrSyntax_List parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void toAllSubclasses_trv4(ClassNameTranspVisitor cntv, EdgeVisitor aev) { it.toAllSubclasses_trv4(cntv, aev); if (next != null) { next.toAllSubclasses_trv4(cntv, aev); } } } class Nonempty_ClassSpec_Commalist implements Cloneable { private ClassSpec it; public ClassSpec get_it() { return it; } public void set_it(ClassSpec new_it) { it = new_it; } private Nonempty_ClassSpec_Commalist next; public Nonempty_ClassSpec_Commalist get_next() { return next; } public void set_next(Nonempty_ClassSpec_Commalist new_next) { next = new_next; } Nonempty_ClassSpec_Commalist() { } public Nonempty_ClassSpec_Commalist(ClassSpec it, Nonempty_ClassSpec_Commalist next) { super(); set_it(it); set_next(next); } public static Nonempty_ClassSpec_Commalist parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Nonempty_ClassSpec_Commalist(); } public static Nonempty_ClassSpec_Commalist parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class Nonempty_Subclass_Barlist implements Cloneable { private Subclass it; public Subclass get_it() { return it; } public void set_it(Subclass new_it) { it = new_it; } private Nonempty_Subclass_Barlist next; public Nonempty_Subclass_Barlist get_next() { return next; } public void set_next(Nonempty_Subclass_Barlist new_next) { next = new_next; } Nonempty_Subclass_Barlist() { } public Nonempty_Subclass_Barlist(Subclass it, Nonempty_Subclass_Barlist next) { super(); set_it(it); set_next(next); } public static Nonempty_Subclass_Barlist parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Nonempty_Subclass_Barlist(); } public static Nonempty_Subclass_Barlist parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } public void toAllSubclasses_trv4(ClassNameTranspVisitor cntv, EdgeVisitor aev) { it.toAllSubclasses_trv4(cntv, aev); if (next != null) { next.toAllSubclasses_trv4(cntv, aev); } } } class Nonempty_Syntax_List implements Cloneable { private Syntax it; public Syntax get_it() { return it; } public void set_it(Syntax new_it) { it = new_it; } private Nonempty_Syntax_List next; public Nonempty_Syntax_List get_next() { return next; } public void set_next(Nonempty_Syntax_List new_next) { next = new_next; } Nonempty_Syntax_List() { } public Nonempty_Syntax_List(Syntax it, Nonempty_Syntax_List next) { super(); set_it(it); set_next(next); } public static Nonempty_Syntax_List parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Nonempty_Syntax_List(); } public static Nonempty_Syntax_List parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class Nonempty_Part_Commalist implements Cloneable { private Part it; public Part get_it() { return it; } public void set_it(Part new_it) { it = new_it; } private Nonempty_Part_Commalist next; public Nonempty_Part_Commalist get_next() { return next; } public void set_next(Nonempty_Part_Commalist new_next) { next = new_next; } Nonempty_Part_Commalist() { } public Nonempty_Part_Commalist(Part it, Nonempty_Part_Commalist next) { super(); set_it(it); set_next(next); } public static Nonempty_Part_Commalist parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Nonempty_Part_Commalist(); } public static Nonempty_Part_Commalist parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } } class Nonempty_PlainSyntax_List implements Cloneable { private PlainSyntax it; public PlainSyntax get_it() { return it; } public void set_it(PlainSyntax new_it) { it = new_it; } private Nonempty_PlainSyntax_List next; public Nonempty_PlainSyntax_List get_next() { return next; } public void set_next(Nonempty_PlainSyntax_List new_next) { next = new_next; } Nonempty_PlainSyntax_List() { } public Nonempty_PlainSyntax_List(PlainSyntax it, Nonempty_PlainSyntax_List next) { super(); set_it(it); set_next(next); } public static Nonempty_PlainSyntax_List parse(java.io.InputStream in) throws ParseError { return new Parser(in)._Nonempty_PlainSyntax_List(); } public static Nonempty_PlainSyntax_List parse(String str) throws ParseError { return parse(new java.io.StringBufferInputStream(str)); } }