| 1 | |
|---|
| 2 | //---------------------------------------------------- |
|---|
| 3 | // The following code was generated by CUP v0.11a beta 20060608 |
|---|
| 4 | // Wed Jul 22 21:31:13 NZST 2009 |
|---|
| 5 | //---------------------------------------------------- |
|---|
| 6 | |
|---|
| 7 | package weka.core.json; |
|---|
| 8 | |
|---|
| 9 | import java_cup.runtime.*; |
|---|
| 10 | import java.io.*; |
|---|
| 11 | import java.util.*; |
|---|
| 12 | |
|---|
| 13 | /** CUP v0.11a beta 20060608 generated parser. |
|---|
| 14 | * @version Wed Jul 22 21:31:13 NZST 2009 |
|---|
| 15 | */ |
|---|
| 16 | public class Parser extends java_cup.runtime.lr_parser { |
|---|
| 17 | |
|---|
| 18 | /** Default constructor. */ |
|---|
| 19 | public Parser() {super();} |
|---|
| 20 | |
|---|
| 21 | /** Constructor which sets the default scanner. */ |
|---|
| 22 | public Parser(java_cup.runtime.Scanner s) {super(s);} |
|---|
| 23 | |
|---|
| 24 | /** Constructor which sets the default scanner. */ |
|---|
| 25 | public Parser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);} |
|---|
| 26 | |
|---|
| 27 | /** Production table. */ |
|---|
| 28 | protected static final short _production_table[][] = |
|---|
| 29 | unpackFromStrings(new String[] { |
|---|
| 30 | "\000\053\000\002\002\004\000\002\002\004\000\002\002" + |
|---|
| 31 | "\005\000\002\003\005\000\002\003\003\000\002\004\003" + |
|---|
| 32 | "\000\002\004\003\000\002\004\003\000\002\005\003\000" + |
|---|
| 33 | "\002\005\003\000\002\005\003\000\002\005\003\000\002" + |
|---|
| 34 | "\005\003\000\002\006\005\000\002\007\005\000\002\010" + |
|---|
| 35 | "\005\000\002\011\005\000\002\012\005\000\002\014\004" + |
|---|
| 36 | "\000\002\014\005\000\002\015\005\000\002\013\004\000" + |
|---|
| 37 | "\002\013\005\000\002\016\003\000\002\017\003\000\002" + |
|---|
| 38 | "\020\003\000\002\022\004\000\002\022\005\000\002\023" + |
|---|
| 39 | "\005\000\002\021\004\000\002\021\005\000\002\024\003" + |
|---|
| 40 | "\000\002\025\003\000\002\026\003\000\002\027\005\000" + |
|---|
| 41 | "\002\027\003\000\002\030\003\000\002\030\003\000\002" + |
|---|
| 42 | "\030\003\000\002\030\003\000\002\030\003\000\002\030" + |
|---|
| 43 | "\003\000\002\030\003" }); |
|---|
| 44 | |
|---|
| 45 | /** Access to production table. */ |
|---|
| 46 | public short[][] production_table() {return _production_table;} |
|---|
| 47 | |
|---|
| 48 | /** Parse-action table. */ |
|---|
| 49 | protected static final short[][] _action_table = |
|---|
| 50 | unpackFromStrings(new String[] { |
|---|
| 51 | "\000\073\000\004\007\005\001\002\000\004\002\075\001" + |
|---|
| 52 | "\002\000\006\010\020\016\014\001\002\000\006\004\062" + |
|---|
| 53 | "\010\074\001\002\000\006\010\060\016\014\001\002\000" + |
|---|
| 54 | "\022\005\035\006\043\007\051\012\042\013\041\014\037" + |
|---|
| 55 | "\015\047\016\045\001\002\000\006\004\ufffd\010\ufffd\001" + |
|---|
| 56 | "\002\000\006\004\ufffb\010\ufffb\001\002\000\006\004\ufff7" + |
|---|
| 57 | "\010\ufff7\001\002\000\004\011\024\001\002\000\006\004" + |
|---|
| 58 | "\ufff9\010\ufff9\001\002\000\006\004\ufffc\010\ufffc\001\002" + |
|---|
| 59 | "\000\006\004\ufff5\010\ufff5\001\002\000\004\002\001\001" + |
|---|
| 60 | "\002\000\006\004\ufff6\010\ufff6\001\002\000\006\004\ufffa" + |
|---|
| 61 | "\010\ufffa\001\002\000\006\004\ufff8\010\ufff8\001\002\000" + |
|---|
| 62 | "\020\005\025\007\031\012\032\013\033\014\026\015\027" + |
|---|
| 63 | "\016\030\001\002\000\022\005\uffe5\006\uffe5\007\uffe5\012" + |
|---|
| 64 | "\uffe5\013\uffe5\014\uffe5\015\uffe5\016\uffe5\001\002\000\006" + |
|---|
| 65 | "\004\ufff2\010\ufff2\001\002\000\006\004\ufff1\010\ufff1\001" + |
|---|
| 66 | "\002\000\006\004\ufff0\010\ufff0\001\002\000\006\010\uffed" + |
|---|
| 67 | "\016\uffed\001\002\000\006\004\ufff4\010\ufff4\001\002\000" + |
|---|
| 68 | "\006\004\ufff3\010\ufff3\001\002\000\006\004\067\006\uffe1" + |
|---|
| 69 | "\001\002\000\022\005\uffe2\006\uffe2\007\uffe2\012\uffe2\013" + |
|---|
| 70 | "\uffe2\014\uffe2\015\uffe2\016\uffe2\001\002\000\022\005\035" + |
|---|
| 71 | "\006\043\007\051\012\042\013\041\014\037\015\047\016" + |
|---|
| 72 | "\045\001\002\000\006\004\uffdb\006\uffdb\001\002\000\006" + |
|---|
| 73 | "\004\uffe7\010\uffe7\001\002\000\006\004\uffdc\006\uffdc\001" + |
|---|
| 74 | "\002\000\006\004\uffdd\006\uffdd\001\002\000\010\004\uffe0" + |
|---|
| 75 | "\006\uffe0\010\uffe0\001\002\000\006\004\uffde\006\uffde\001" + |
|---|
| 76 | "\002\000\006\004\uffd9\006\uffd9\001\002\000\006\010\060" + |
|---|
| 77 | "\016\014\001\002\000\006\004\uffda\006\uffda\001\002\000" + |
|---|
| 78 | "\004\006\043\001\002\000\006\010\uffea\016\uffea\001\002" + |
|---|
| 79 | "\000\006\004\uffd7\006\uffd7\001\002\000\006\004\uffd8\006" + |
|---|
| 80 | "\uffd8\001\002\000\006\004\uffe6\010\uffe6\001\002\000\006" + |
|---|
| 81 | "\004\062\010\uffe9\001\002\000\004\010\060\001\002\000" + |
|---|
| 82 | "\006\004\uffec\006\uffec\001\002\000\010\004\uffe8\006\uffe8" + |
|---|
| 83 | "\010\uffe8\001\002\000\006\004\uffeb\006\uffeb\001\002\000" + |
|---|
| 84 | "\004\016\014\001\002\000\006\004\ufffe\010\ufffe\001\002" + |
|---|
| 85 | "\000\006\004\uffe4\006\uffe4\001\002\000\004\006\043\001" + |
|---|
| 86 | "\002\000\006\004\uffe3\006\uffe3\001\002\000\020\005\035" + |
|---|
| 87 | "\007\051\012\042\013\041\014\037\015\047\016\045\001" + |
|---|
| 88 | "\002\000\006\004\uffdf\006\uffdf\001\002\000\004\010\060" + |
|---|
| 89 | "\001\002\000\006\004\uffef\010\uffef\001\002\000\006\004" + |
|---|
| 90 | "\uffee\010\uffee\001\002\000\004\002\uffff\001\002\000\004" + |
|---|
| 91 | "\002\000\001\002" }); |
|---|
| 92 | |
|---|
| 93 | /** Access to parse-action table. */ |
|---|
| 94 | public short[][] action_table() {return _action_table;} |
|---|
| 95 | |
|---|
| 96 | /** <code>reduce_goto</code> table. */ |
|---|
| 97 | protected static final short[][] _reduce_table = |
|---|
| 98 | unpackFromStrings(new String[] { |
|---|
| 99 | "\000\073\000\004\002\003\001\001\000\002\001\001\000" + |
|---|
| 100 | "\032\003\005\004\010\005\015\006\014\007\022\010\012" + |
|---|
| 101 | "\011\020\012\016\014\011\015\006\022\021\023\007\001" + |
|---|
| 102 | "\001\000\002\001\001\000\036\003\054\004\010\005\015" + |
|---|
| 103 | "\006\014\007\022\010\012\011\020\012\016\014\011\015" + |
|---|
| 104 | "\006\017\070\020\071\022\021\023\007\001\001\000\022" + |
|---|
| 105 | "\013\052\016\045\021\051\024\035\025\047\026\037\027" + |
|---|
| 106 | "\033\030\043\001\001\000\002\001\001\000\002\001\001" + |
|---|
| 107 | "\000\002\001\001\000\002\001\001\000\002\001\001\000" + |
|---|
| 108 | "\002\001\001\000\002\001\001\000\002\001\001\000\002" + |
|---|
| 109 | "\001\001\000\002\001\001\000\002\001\001\000\002\001" + |
|---|
| 110 | "\001\000\002\001\001\000\002\001\001\000\002\001\001" + |
|---|
| 111 | "\000\002\001\001\000\002\001\001\000\002\001\001\000" + |
|---|
| 112 | "\002\001\001\000\002\001\001\000\002\001\001\000\022" + |
|---|
| 113 | "\013\052\016\045\021\051\024\035\025\064\026\063\027" + |
|---|
| 114 | "\033\030\043\001\001\000\002\001\001\000\002\001\001" + |
|---|
| 115 | "\000\002\001\001\000\002\001\001\000\002\001\001\000" + |
|---|
| 116 | "\002\001\001\000\002\001\001\000\036\003\054\004\010" + |
|---|
| 117 | "\005\015\006\014\007\022\010\012\011\020\012\016\014" + |
|---|
| 118 | "\011\015\006\017\055\020\056\022\021\023\007\001\001" + |
|---|
| 119 | "\000\002\001\001\000\004\026\053\001\001\000\002\001" + |
|---|
| 120 | "\001\000\002\001\001\000\002\001\001\000\002\001\001" + |
|---|
| 121 | "\000\002\001\001\000\004\020\060\001\001\000\002\001" + |
|---|
| 122 | "\001\000\002\001\001\000\002\001\001\000\030\004\062" + |
|---|
| 123 | "\005\015\006\014\007\022\010\012\011\020\012\016\014" + |
|---|
| 124 | "\011\015\006\022\021\023\007\001\001\000\002\001\001" + |
|---|
| 125 | "\000\002\001\001\000\004\026\065\001\001\000\002\001" + |
|---|
| 126 | "\001\000\014\013\052\016\045\021\051\024\035\030\067" + |
|---|
| 127 | "\001\001\000\002\001\001\000\004\020\072\001\001\000" + |
|---|
| 128 | "\002\001\001\000\002\001\001\000\002\001\001\000\002" + |
|---|
| 129 | "\001\001" }); |
|---|
| 130 | |
|---|
| 131 | /** Access to <code>reduce_goto</code> table. */ |
|---|
| 132 | public short[][] reduce_table() {return _reduce_table;} |
|---|
| 133 | |
|---|
| 134 | /** Instance of action encapsulation class. */ |
|---|
| 135 | protected CUP$Parser$actions action_obj; |
|---|
| 136 | |
|---|
| 137 | /** Action encapsulation object initializer. */ |
|---|
| 138 | protected void init_actions() |
|---|
| 139 | { |
|---|
| 140 | action_obj = new CUP$Parser$actions(this); |
|---|
| 141 | } |
|---|
| 142 | |
|---|
| 143 | /** Invoke a user supplied parse action. */ |
|---|
| 144 | public java_cup.runtime.Symbol do_action( |
|---|
| 145 | int act_num, |
|---|
| 146 | java_cup.runtime.lr_parser parser, |
|---|
| 147 | java.util.Stack stack, |
|---|
| 148 | int top) |
|---|
| 149 | throws java.lang.Exception |
|---|
| 150 | { |
|---|
| 151 | /* call code in generated class */ |
|---|
| 152 | return action_obj.CUP$Parser$do_action(act_num, parser, stack, top); |
|---|
| 153 | } |
|---|
| 154 | |
|---|
| 155 | /** Indicates start state. */ |
|---|
| 156 | public int start_state() {return 0;} |
|---|
| 157 | /** Indicates start production. */ |
|---|
| 158 | public int start_production() {return 1;} |
|---|
| 159 | |
|---|
| 160 | /** <code>EOF</code> Symbol index. */ |
|---|
| 161 | public int EOF_sym() {return 0;} |
|---|
| 162 | |
|---|
| 163 | /** <code>error</code> Symbol index. */ |
|---|
| 164 | public int error_sym() {return 1;} |
|---|
| 165 | |
|---|
| 166 | |
|---|
| 167 | /** User initialization code. */ |
|---|
| 168 | public void user_init() throws java.lang.Exception |
|---|
| 169 | { |
|---|
| 170 | |
|---|
| 171 | m_Symbols = new HashMap(); |
|---|
| 172 | m_Result = new JSONNode(); |
|---|
| 173 | m_Stack = new Stack<JSONNode>(); |
|---|
| 174 | m_Stack.push(m_Result); |
|---|
| 175 | |
|---|
| 176 | } |
|---|
| 177 | |
|---|
| 178 | |
|---|
| 179 | /** variable - value relation. */ |
|---|
| 180 | protected HashMap m_Symbols; |
|---|
| 181 | |
|---|
| 182 | /** for storing the parsed JSON data structure. */ |
|---|
| 183 | protected JSONNode m_Result; |
|---|
| 184 | |
|---|
| 185 | /** the stack for keeping track of the current parent node. */ |
|---|
| 186 | protected Stack<JSONNode> m_Stack; |
|---|
| 187 | |
|---|
| 188 | /** |
|---|
| 189 | * Returns the JSON data structure. |
|---|
| 190 | * |
|---|
| 191 | * @return the result |
|---|
| 192 | */ |
|---|
| 193 | public JSONNode getResult() { |
|---|
| 194 | return m_Result; |
|---|
| 195 | } |
|---|
| 196 | |
|---|
| 197 | /** |
|---|
| 198 | * Returns the stack used internally for keeping track of the current |
|---|
| 199 | * parent node. |
|---|
| 200 | * |
|---|
| 201 | * @return the stack |
|---|
| 202 | */ |
|---|
| 203 | protected Stack<JSONNode> getStack() { |
|---|
| 204 | return m_Stack; |
|---|
| 205 | } |
|---|
| 206 | |
|---|
| 207 | /** |
|---|
| 208 | * Runs the parser from commandline. Expects a filename as first parameter, |
|---|
| 209 | * pointing to a JSON file. |
|---|
| 210 | * |
|---|
| 211 | * @param args the commandline arguments |
|---|
| 212 | * @throws Exception if something goes wrong |
|---|
| 213 | */ |
|---|
| 214 | public static void main(String args[]) throws Exception { |
|---|
| 215 | if (args.length != 1) { |
|---|
| 216 | System.err.println("No JSON file specified!"); |
|---|
| 217 | System.exit(1); |
|---|
| 218 | } |
|---|
| 219 | |
|---|
| 220 | FileInputStream stream = new FileInputStream(args[0]); |
|---|
| 221 | SymbolFactory sf = new DefaultSymbolFactory(); |
|---|
| 222 | Parser parser = new Parser(new Scanner(stream, sf), sf); |
|---|
| 223 | parser.parse(); |
|---|
| 224 | StringBuffer buffer = new StringBuffer(); |
|---|
| 225 | parser.getResult().toString(buffer); |
|---|
| 226 | System.out.println(buffer.toString()); |
|---|
| 227 | } |
|---|
| 228 | |
|---|
| 229 | } |
|---|
| 230 | |
|---|
| 231 | /** Cup generated class to encapsulate user supplied action code.*/ |
|---|
| 232 | class CUP$Parser$actions { |
|---|
| 233 | private final Parser parser; |
|---|
| 234 | |
|---|
| 235 | /** Constructor */ |
|---|
| 236 | CUP$Parser$actions(Parser parser) { |
|---|
| 237 | this.parser = parser; |
|---|
| 238 | } |
|---|
| 239 | |
|---|
| 240 | /** Method with the actual generated action code. */ |
|---|
| 241 | public final java_cup.runtime.Symbol CUP$Parser$do_action( |
|---|
| 242 | int CUP$Parser$act_num, |
|---|
| 243 | java_cup.runtime.lr_parser CUP$Parser$parser, |
|---|
| 244 | java.util.Stack CUP$Parser$stack, |
|---|
| 245 | int CUP$Parser$top) |
|---|
| 246 | throws java.lang.Exception |
|---|
| 247 | { |
|---|
| 248 | /* Symbol object for return from actions */ |
|---|
| 249 | java_cup.runtime.Symbol CUP$Parser$result; |
|---|
| 250 | |
|---|
| 251 | /* select the action based on the action number */ |
|---|
| 252 | switch (CUP$Parser$act_num) |
|---|
| 253 | { |
|---|
| 254 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 255 | case 42: // element ::= anon_array |
|---|
| 256 | { |
|---|
| 257 | Object RESULT =null; |
|---|
| 258 | |
|---|
| 259 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("element",22, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 260 | } |
|---|
| 261 | return CUP$Parser$result; |
|---|
| 262 | |
|---|
| 263 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 264 | case 41: // element ::= anon_object |
|---|
| 265 | { |
|---|
| 266 | Object RESULT =null; |
|---|
| 267 | |
|---|
| 268 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("element",22, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 269 | } |
|---|
| 270 | return CUP$Parser$result; |
|---|
| 271 | |
|---|
| 272 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 273 | case 40: // element ::= STRING |
|---|
| 274 | { |
|---|
| 275 | Object RESULT =null; |
|---|
| 276 | int sleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).left; |
|---|
| 277 | int sright = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).right; |
|---|
| 278 | String s = (String)((java_cup.runtime.Symbol) CUP$Parser$stack.peek()).value; |
|---|
| 279 | |
|---|
| 280 | parser.getStack().peek().addArrayElement(s); |
|---|
| 281 | |
|---|
| 282 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("element",22, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 283 | } |
|---|
| 284 | return CUP$Parser$result; |
|---|
| 285 | |
|---|
| 286 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 287 | case 39: // element ::= DOUBLE |
|---|
| 288 | { |
|---|
| 289 | Object RESULT =null; |
|---|
| 290 | int dleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).left; |
|---|
| 291 | int dright = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).right; |
|---|
| 292 | Double d = (Double)((java_cup.runtime.Symbol) CUP$Parser$stack.peek()).value; |
|---|
| 293 | |
|---|
| 294 | parser.getStack().peek().addArrayElement(d); |
|---|
| 295 | |
|---|
| 296 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("element",22, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 297 | } |
|---|
| 298 | return CUP$Parser$result; |
|---|
| 299 | |
|---|
| 300 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 301 | case 38: // element ::= INTEGER |
|---|
| 302 | { |
|---|
| 303 | Object RESULT =null; |
|---|
| 304 | int ileft = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).left; |
|---|
| 305 | int iright = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).right; |
|---|
| 306 | Integer i = (Integer)((java_cup.runtime.Symbol) CUP$Parser$stack.peek()).value; |
|---|
| 307 | |
|---|
| 308 | parser.getStack().peek().addArrayElement(i); |
|---|
| 309 | |
|---|
| 310 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("element",22, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 311 | } |
|---|
| 312 | return CUP$Parser$result; |
|---|
| 313 | |
|---|
| 314 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 315 | case 37: // element ::= BOOLEAN |
|---|
| 316 | { |
|---|
| 317 | Object RESULT =null; |
|---|
| 318 | int bleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).left; |
|---|
| 319 | int bright = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).right; |
|---|
| 320 | Boolean b = (Boolean)((java_cup.runtime.Symbol) CUP$Parser$stack.peek()).value; |
|---|
| 321 | |
|---|
| 322 | parser.getStack().peek().addArrayElement(b); |
|---|
| 323 | |
|---|
| 324 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("element",22, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 325 | } |
|---|
| 326 | return CUP$Parser$result; |
|---|
| 327 | |
|---|
| 328 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 329 | case 36: // element ::= NULL |
|---|
| 330 | { |
|---|
| 331 | Object RESULT =null; |
|---|
| 332 | |
|---|
| 333 | parser.getStack().peek().addArrayElement(null); |
|---|
| 334 | |
|---|
| 335 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("element",22, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 336 | } |
|---|
| 337 | return CUP$Parser$result; |
|---|
| 338 | |
|---|
| 339 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 340 | case 35: // elements ::= element |
|---|
| 341 | { |
|---|
| 342 | Object RESULT =null; |
|---|
| 343 | |
|---|
| 344 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("elements",21, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 345 | } |
|---|
| 346 | return CUP$Parser$result; |
|---|
| 347 | |
|---|
| 348 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 349 | case 34: // elements ::= elements COMMA element |
|---|
| 350 | { |
|---|
| 351 | Object RESULT =null; |
|---|
| 352 | |
|---|
| 353 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("elements",21, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 354 | } |
|---|
| 355 | return CUP$Parser$result; |
|---|
| 356 | |
|---|
| 357 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 358 | case 33: // array_end ::= RSQUARE |
|---|
| 359 | { |
|---|
| 360 | Object RESULT =null; |
|---|
| 361 | |
|---|
| 362 | parser.getStack().pop(); |
|---|
| 363 | |
|---|
| 364 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("array_end",20, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 365 | } |
|---|
| 366 | return CUP$Parser$result; |
|---|
| 367 | |
|---|
| 368 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 369 | case 32: // array_content ::= elements |
|---|
| 370 | { |
|---|
| 371 | Object RESULT =null; |
|---|
| 372 | |
|---|
| 373 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("array_content",19, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 374 | } |
|---|
| 375 | return CUP$Parser$result; |
|---|
| 376 | |
|---|
| 377 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 378 | case 31: // anon_array_start ::= LSQUARE |
|---|
| 379 | { |
|---|
| 380 | Object RESULT =null; |
|---|
| 381 | |
|---|
| 382 | JSONNode node = parser.getStack().peek().addArray(null); |
|---|
| 383 | parser.getStack().push(node); |
|---|
| 384 | |
|---|
| 385 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("anon_array_start",18, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 386 | } |
|---|
| 387 | return CUP$Parser$result; |
|---|
| 388 | |
|---|
| 389 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 390 | case 30: // anon_array ::= anon_array_start array_content array_end |
|---|
| 391 | { |
|---|
| 392 | Object RESULT =null; |
|---|
| 393 | |
|---|
| 394 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("anon_array",15, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 395 | } |
|---|
| 396 | return CUP$Parser$result; |
|---|
| 397 | |
|---|
| 398 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 399 | case 29: // anon_array ::= anon_array_start array_end |
|---|
| 400 | { |
|---|
| 401 | Object RESULT =null; |
|---|
| 402 | |
|---|
| 403 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("anon_array",15, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 404 | } |
|---|
| 405 | return CUP$Parser$result; |
|---|
| 406 | |
|---|
| 407 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 408 | case 28: // named_array_start ::= STRING COLON LSQUARE |
|---|
| 409 | { |
|---|
| 410 | Object RESULT =null; |
|---|
| 411 | int nameleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)).left; |
|---|
| 412 | int nameright = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)).right; |
|---|
| 413 | String name = (String)((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-2)).value; |
|---|
| 414 | |
|---|
| 415 | JSONNode node = parser.getStack().peek().addArray(name); |
|---|
| 416 | parser.getStack().push(node); |
|---|
| 417 | |
|---|
| 418 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("named_array_start",17, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 419 | } |
|---|
| 420 | return CUP$Parser$result; |
|---|
| 421 | |
|---|
| 422 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 423 | case 27: // named_array ::= named_array_start array_content array_end |
|---|
| 424 | { |
|---|
| 425 | Object RESULT =null; |
|---|
| 426 | |
|---|
| 427 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("named_array",16, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 428 | } |
|---|
| 429 | return CUP$Parser$result; |
|---|
| 430 | |
|---|
| 431 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 432 | case 26: // named_array ::= named_array_start array_end |
|---|
| 433 | { |
|---|
| 434 | Object RESULT =null; |
|---|
| 435 | |
|---|
| 436 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("named_array",16, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 437 | } |
|---|
| 438 | return CUP$Parser$result; |
|---|
| 439 | |
|---|
| 440 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 441 | case 25: // object_end ::= RCURLY |
|---|
| 442 | { |
|---|
| 443 | Object RESULT =null; |
|---|
| 444 | |
|---|
| 445 | parser.getStack().pop(); |
|---|
| 446 | |
|---|
| 447 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("object_end",14, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 448 | } |
|---|
| 449 | return CUP$Parser$result; |
|---|
| 450 | |
|---|
| 451 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 452 | case 24: // object_content ::= pairs |
|---|
| 453 | { |
|---|
| 454 | Object RESULT =null; |
|---|
| 455 | |
|---|
| 456 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("object_content",13, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 457 | } |
|---|
| 458 | return CUP$Parser$result; |
|---|
| 459 | |
|---|
| 460 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 461 | case 23: // anon_object_start ::= LCURLY |
|---|
| 462 | { |
|---|
| 463 | Object RESULT =null; |
|---|
| 464 | |
|---|
| 465 | JSONNode node = parser.getStack().peek().addObject(null); |
|---|
| 466 | parser.getStack().push(node); |
|---|
| 467 | |
|---|
| 468 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("anon_object_start",12, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 469 | } |
|---|
| 470 | return CUP$Parser$result; |
|---|
| 471 | |
|---|
| 472 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 473 | case 22: // anon_object ::= anon_object_start object_content object_end |
|---|
| 474 | { |
|---|
| 475 | Object RESULT =null; |
|---|
| 476 | |
|---|
| 477 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("anon_object",9, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 478 | } |
|---|
| 479 | return CUP$Parser$result; |
|---|
| 480 | |
|---|
| 481 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 482 | case 21: // anon_object ::= anon_object_start object_end |
|---|
| 483 | { |
|---|
| 484 | Object RESULT =null; |
|---|
| 485 | |
|---|
| 486 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("anon_object",9, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 487 | } |
|---|
| 488 | return CUP$Parser$result; |
|---|
| 489 | |
|---|
| 490 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 491 | case 20: // named_object_start ::= STRING COLON LCURLY |
|---|
| 492 | { |
|---|
| 493 | Object RESULT =null; |
|---|
| 494 | int nameleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)).left; |
|---|
| 495 | int nameright = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)).right; |
|---|
| 496 | String name = (String)((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-2)).value; |
|---|
| 497 | |
|---|
| 498 | JSONNode node = parser.getStack().peek().addObject(name); |
|---|
| 499 | parser.getStack().push(node); |
|---|
| 500 | |
|---|
| 501 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("named_object_start",11, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 502 | } |
|---|
| 503 | return CUP$Parser$result; |
|---|
| 504 | |
|---|
| 505 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 506 | case 19: // named_object ::= named_object_start object_content object_end |
|---|
| 507 | { |
|---|
| 508 | Object RESULT =null; |
|---|
| 509 | |
|---|
| 510 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("named_object",10, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 511 | } |
|---|
| 512 | return CUP$Parser$result; |
|---|
| 513 | |
|---|
| 514 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 515 | case 18: // named_object ::= named_object_start object_end |
|---|
| 516 | { |
|---|
| 517 | Object RESULT =null; |
|---|
| 518 | |
|---|
| 519 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("named_object",10, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 520 | } |
|---|
| 521 | return CUP$Parser$result; |
|---|
| 522 | |
|---|
| 523 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 524 | case 17: // string ::= STRING COLON STRING |
|---|
| 525 | { |
|---|
| 526 | String RESULT =null; |
|---|
| 527 | int nameleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)).left; |
|---|
| 528 | int nameright = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)).right; |
|---|
| 529 | String name = (String)((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-2)).value; |
|---|
| 530 | int sleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).left; |
|---|
| 531 | int sright = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).right; |
|---|
| 532 | String s = (String)((java_cup.runtime.Symbol) CUP$Parser$stack.peek()).value; |
|---|
| 533 | |
|---|
| 534 | parser.getStack().peek().addPrimitive(name, s); |
|---|
| 535 | |
|---|
| 536 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("string",8, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 537 | } |
|---|
| 538 | return CUP$Parser$result; |
|---|
| 539 | |
|---|
| 540 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 541 | case 16: // double ::= STRING COLON DOUBLE |
|---|
| 542 | { |
|---|
| 543 | Double RESULT =null; |
|---|
| 544 | int nameleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)).left; |
|---|
| 545 | int nameright = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)).right; |
|---|
| 546 | String name = (String)((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-2)).value; |
|---|
| 547 | int dleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).left; |
|---|
| 548 | int dright = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).right; |
|---|
| 549 | Double d = (Double)((java_cup.runtime.Symbol) CUP$Parser$stack.peek()).value; |
|---|
| 550 | |
|---|
| 551 | parser.getStack().peek().addPrimitive(name, d); |
|---|
| 552 | |
|---|
| 553 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("double",7, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 554 | } |
|---|
| 555 | return CUP$Parser$result; |
|---|
| 556 | |
|---|
| 557 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 558 | case 15: // integer ::= STRING COLON INTEGER |
|---|
| 559 | { |
|---|
| 560 | Integer RESULT =null; |
|---|
| 561 | int nameleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)).left; |
|---|
| 562 | int nameright = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)).right; |
|---|
| 563 | String name = (String)((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-2)).value; |
|---|
| 564 | int ileft = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).left; |
|---|
| 565 | int iright = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).right; |
|---|
| 566 | Integer i = (Integer)((java_cup.runtime.Symbol) CUP$Parser$stack.peek()).value; |
|---|
| 567 | |
|---|
| 568 | parser.getStack().peek().addPrimitive(name, i); |
|---|
| 569 | |
|---|
| 570 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("integer",6, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 571 | } |
|---|
| 572 | return CUP$Parser$result; |
|---|
| 573 | |
|---|
| 574 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 575 | case 14: // boolean ::= STRING COLON BOOLEAN |
|---|
| 576 | { |
|---|
| 577 | Boolean RESULT =null; |
|---|
| 578 | int nameleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)).left; |
|---|
| 579 | int nameright = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)).right; |
|---|
| 580 | String name = (String)((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-2)).value; |
|---|
| 581 | int bleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).left; |
|---|
| 582 | int bright = ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()).right; |
|---|
| 583 | Boolean b = (Boolean)((java_cup.runtime.Symbol) CUP$Parser$stack.peek()).value; |
|---|
| 584 | |
|---|
| 585 | parser.getStack().peek().addPrimitive(name, b); |
|---|
| 586 | |
|---|
| 587 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("boolean",5, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 588 | } |
|---|
| 589 | return CUP$Parser$result; |
|---|
| 590 | |
|---|
| 591 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 592 | case 13: // null ::= STRING COLON NULL |
|---|
| 593 | { |
|---|
| 594 | Object RESULT =null; |
|---|
| 595 | int nameleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)).left; |
|---|
| 596 | int nameright = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)).right; |
|---|
| 597 | String name = (String)((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-2)).value; |
|---|
| 598 | |
|---|
| 599 | parser.getStack().peek().addNull(name); |
|---|
| 600 | |
|---|
| 601 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("null",4, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 602 | } |
|---|
| 603 | return CUP$Parser$result; |
|---|
| 604 | |
|---|
| 605 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 606 | case 12: // primitive ::= string |
|---|
| 607 | { |
|---|
| 608 | Object RESULT =null; |
|---|
| 609 | |
|---|
| 610 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("primitive",3, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 611 | } |
|---|
| 612 | return CUP$Parser$result; |
|---|
| 613 | |
|---|
| 614 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 615 | case 11: // primitive ::= double |
|---|
| 616 | { |
|---|
| 617 | Object RESULT =null; |
|---|
| 618 | |
|---|
| 619 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("primitive",3, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 620 | } |
|---|
| 621 | return CUP$Parser$result; |
|---|
| 622 | |
|---|
| 623 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 624 | case 10: // primitive ::= integer |
|---|
| 625 | { |
|---|
| 626 | Object RESULT =null; |
|---|
| 627 | |
|---|
| 628 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("primitive",3, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 629 | } |
|---|
| 630 | return CUP$Parser$result; |
|---|
| 631 | |
|---|
| 632 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 633 | case 9: // primitive ::= boolean |
|---|
| 634 | { |
|---|
| 635 | Object RESULT =null; |
|---|
| 636 | |
|---|
| 637 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("primitive",3, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 638 | } |
|---|
| 639 | return CUP$Parser$result; |
|---|
| 640 | |
|---|
| 641 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 642 | case 8: // primitive ::= null |
|---|
| 643 | { |
|---|
| 644 | Object RESULT =null; |
|---|
| 645 | |
|---|
| 646 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("primitive",3, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 647 | } |
|---|
| 648 | return CUP$Parser$result; |
|---|
| 649 | |
|---|
| 650 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 651 | case 7: // pair ::= named_array |
|---|
| 652 | { |
|---|
| 653 | Object RESULT =null; |
|---|
| 654 | |
|---|
| 655 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("pair",2, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 656 | } |
|---|
| 657 | return CUP$Parser$result; |
|---|
| 658 | |
|---|
| 659 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 660 | case 6: // pair ::= named_object |
|---|
| 661 | { |
|---|
| 662 | Object RESULT =null; |
|---|
| 663 | |
|---|
| 664 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("pair",2, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 665 | } |
|---|
| 666 | return CUP$Parser$result; |
|---|
| 667 | |
|---|
| 668 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 669 | case 5: // pair ::= primitive |
|---|
| 670 | { |
|---|
| 671 | Object RESULT =null; |
|---|
| 672 | |
|---|
| 673 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("pair",2, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 674 | } |
|---|
| 675 | return CUP$Parser$result; |
|---|
| 676 | |
|---|
| 677 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 678 | case 4: // pairs ::= pair |
|---|
| 679 | { |
|---|
| 680 | Object RESULT =null; |
|---|
| 681 | |
|---|
| 682 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("pairs",1, ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 683 | } |
|---|
| 684 | return CUP$Parser$result; |
|---|
| 685 | |
|---|
| 686 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 687 | case 3: // pairs ::= pairs COMMA pair |
|---|
| 688 | { |
|---|
| 689 | Object RESULT =null; |
|---|
| 690 | |
|---|
| 691 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("pairs",1, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 692 | } |
|---|
| 693 | return CUP$Parser$result; |
|---|
| 694 | |
|---|
| 695 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 696 | case 2: // json ::= LCURLY pairs RCURLY |
|---|
| 697 | { |
|---|
| 698 | Object RESULT =null; |
|---|
| 699 | |
|---|
| 700 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("json",0, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-2)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 701 | } |
|---|
| 702 | return CUP$Parser$result; |
|---|
| 703 | |
|---|
| 704 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 705 | case 1: // $START ::= json EOF |
|---|
| 706 | { |
|---|
| 707 | Object RESULT =null; |
|---|
| 708 | int start_valleft = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)).left; |
|---|
| 709 | int start_valright = ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)).right; |
|---|
| 710 | Object start_val = (Object)((java_cup.runtime.Symbol) CUP$Parser$stack.elementAt(CUP$Parser$top-1)).value; |
|---|
| 711 | RESULT = start_val; |
|---|
| 712 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("$START",0, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 713 | } |
|---|
| 714 | /* ACCEPT */ |
|---|
| 715 | CUP$Parser$parser.done_parsing(); |
|---|
| 716 | return CUP$Parser$result; |
|---|
| 717 | |
|---|
| 718 | /*. . . . . . . . . . . . . . . . . . . .*/ |
|---|
| 719 | case 0: // json ::= LCURLY RCURLY |
|---|
| 720 | { |
|---|
| 721 | Object RESULT =null; |
|---|
| 722 | |
|---|
| 723 | CUP$Parser$result = parser.getSymbolFactory().newSymbol("json",0, ((java_cup.runtime.Symbol)CUP$Parser$stack.elementAt(CUP$Parser$top-1)), ((java_cup.runtime.Symbol)CUP$Parser$stack.peek()), RESULT); |
|---|
| 724 | } |
|---|
| 725 | return CUP$Parser$result; |
|---|
| 726 | |
|---|
| 727 | /* . . . . . .*/ |
|---|
| 728 | default: |
|---|
| 729 | throw new Exception( |
|---|
| 730 | "Invalid action number found in internal parse table"); |
|---|
| 731 | |
|---|
| 732 | } |
|---|
| 733 | } |
|---|
| 734 | } |
|---|
| 735 | |
|---|