View Javadoc

1   //
2   // THIS FILE IS AUTOMATICALLY GENERATED!!
3   //
4   // Generated at 2009-08-09 by the VDM++ to JAVA Code Generator
5   // (v8.2.1b - Wed 15-Jul-2009 14:09:22)
6   //
7   // Supported compilers: jdk 1.4/1.5/1.6
8   //
9   
10  // ***** VDMTOOLS START Name=HeaderComment KEEP=NO
11  // ***** VDMTOOLS END Name=HeaderComment
12  
13  // ***** VDMTOOLS START Name=package KEEP=NO
14  package org.overturetool.api.xml;
15  
16  // ***** VDMTOOLS END Name=package
17  
18  // ***** VDMTOOLS START Name=imports KEEP=NO
19  
20  import jp.co.csk.vdm.toolbox.VDM.*;
21  import java.util.*;
22  // ***** VDMTOOLS END Name=imports
23  
24  
25  
26  public abstract class XmlEvent {
27  
28  // ***** VDMTOOLS START Name=vdmComp KEEP=NO
29    static UTIL.VDMCompare vdmComp = new UTIL.VDMCompare();
30  // ***** VDMTOOLS END Name=vdmComp
31  
32  // ***** VDMTOOLS START Name=estack KEEP=NO
33    private Vector estack = null;
34  // ***** VDMTOOLS END Name=estack
35  
36  
37  // ***** VDMTOOLS START Name=vdm_init_XmlEvent KEEP=NO
38    private void vdm_init_XmlEvent () throws CGException {
39      try {
40        estack = new Vector();
41      }
42      catch (Exception e){
43  
44        e.printStackTrace(System.out);
45        System.out.println(e.getMessage());
46      }
47    }
48  // ***** VDMTOOLS END Name=vdm_init_XmlEvent
49  
50  
51  // ***** VDMTOOLS START Name=XmlEvent KEEP=NO
52    public XmlEvent () throws CGException {
53      vdm_init_XmlEvent();
54    }
55  // ***** VDMTOOLS END Name=XmlEvent
56  
57  
58  // ***** VDMTOOLS START Name=pushEntity#1|XmlEntity KEEP=NO
59    protected void pushEntity (final XmlEntity ppe) throws CGException {
60  
61      Vector rhs_2 = null;
62      Vector var1_3 = null;
63      var1_3 = new Vector();
64      var1_3.add(ppe);
65      rhs_2 = (Vector) var1_3.clone();
66      rhs_2.addAll(estack);
67      estack = (Vector) UTIL.ConvertToList(UTIL.clone(rhs_2));
68    }
69  // ***** VDMTOOLS END Name=pushEntity#1|XmlEntity
70  
71  
72  // ***** VDMTOOLS START Name=popEntity KEEP=NO
73    protected XmlEntity popEntity () throws CGException {
74  
75      XmlEntity res = (XmlEntity) estack.get(0);
76      estack = (Vector) UTIL.ConvertToList(UTIL.clone(new Vector(estack.subList(1, estack.size()))));
77      return (XmlEntity) res;
78    }
79  // ***** VDMTOOLS END Name=popEntity
80  
81  
82  // ***** VDMTOOLS START Name=peekEntity KEEP=NO
83    protected XmlEntity peekEntity () throws CGException {
84      return (XmlEntity) (XmlEntity) estack.get(0);
85    }
86  // ***** VDMTOOLS END Name=peekEntity
87  
88  
89  // ***** VDMTOOLS START Name=stackDepth KEEP=NO
90    protected Long stackDepth () throws CGException {
91      return new Long(estack.size());
92    }
93  // ***** VDMTOOLS END Name=stackDepth
94  
95  
96  // ***** VDMTOOLS START Name=StartDocument KEEP=NO
97    abstract protected Boolean StartDocument () throws CGException ;
98  // ***** VDMTOOLS END Name=StartDocument
99  
100 
101 // ***** VDMTOOLS START Name=StopDocument KEEP=NO
102   abstract protected Boolean StopDocument () throws CGException ;
103 // ***** VDMTOOLS END Name=StopDocument
104 
105 
106 // ***** VDMTOOLS START Name=StartEntity#1|String KEEP=NO
107   abstract protected Boolean StartEntity (final String var_1_1) throws CGException ;
108 // ***** VDMTOOLS END Name=StartEntity#1|String
109 
110 
111 // ***** VDMTOOLS START Name=StopEntity#1|String KEEP=NO
112   abstract protected Boolean StopEntity (final String var_1_1) throws CGException ;
113 // ***** VDMTOOLS END Name=StopEntity#1|String
114 
115 
116 // ***** VDMTOOLS START Name=StartAttribute#2|String|String KEEP=NO
117   abstract protected Boolean StartAttribute (final String var_1_1, final String var_2_2) throws CGException ;
118 // ***** VDMTOOLS END Name=StartAttribute#2|String|String
119 
120 
121 // ***** VDMTOOLS START Name=StartData#1|String KEEP=NO
122   abstract protected Boolean StartData (final String var_1_1) throws CGException ;
123 // ***** VDMTOOLS END Name=StartData#1|String
124 
125 
126 // ***** VDMTOOLS START Name=parse#1|String KEEP=NO
127   public void parse (final String fname) throws CGException {
128 
129     XmlParser parser = new XmlParser(fname, this);
130     parser.parse();
131   }
132 // ***** VDMTOOLS END Name=parse#1|String
133 
134 }
135 ;