/* Generated By:JavaCC: Do not edit this line. NumberParser.java */ package org.j_paine.formatter; class NumberParser implements NumberParserConstants { final public int Float() throws ParseException { int start = 0; label_1: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 6: ; break; default: jj_la1[0] = jj_gen; break label_1; } jj_consume_token(6); start++; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 7: case 8: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 7: jj_consume_token(7); break; case 8: jj_consume_token(8); break; default: jj_la1[1] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; default: jj_la1[2] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INTEGER_LITERAL: jj_consume_token(INTEGER_LITERAL); break; case FLOATING_POINT_LITERAL: jj_consume_token(FLOATING_POINT_LITERAL); break; default: jj_la1[3] = jj_gen; jj_consume_token(-1); throw new ParseException(); } jj_consume_token(0); {if (true) return start;} throw new Error("Missing return statement in function"); } // This is the syntax of numbers we want a real format to accept. // The makes sure that trailing non-numeric characters // (even spaces) are reported as an error. // Returns an integer which is the number of spaces to skip before // the number starts. final public int Integer() throws ParseException { int start = 0; label_2: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 6: ; break; default: jj_la1[4] = jj_gen; break label_2; } jj_consume_token(6); start++; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 7: case 8: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 7: jj_consume_token(7); break; case 8: jj_consume_token(8); break; default: jj_la1[5] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; default: jj_la1[6] = jj_gen; ; } jj_consume_token(INTEGER_LITERAL); jj_consume_token(0); {if (true) return start;} throw new Error("Missing return statement in function"); } // This is the syntax of numbers we want an integer format to // accept. // Returns an integer which is the number of spaces to skip before // the number starts. final public int Boolean() throws ParseException { int start = 0; label_3: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 6: ; break; default: jj_la1[7] = jj_gen; break label_3; } jj_consume_token(6); start++; } jj_consume_token(LOGICAL_LITERAL); jj_consume_token(0); {if (true) return start;} throw new Error("Missing return statement in function"); } public NumberParserTokenManager token_source; SimpleCharStream jj_input_stream; public Token token, jj_nt; private int jj_ntk; private int jj_gen; final private int[] jj_la1 = new int[8]; static private int[] jj_la1_0; static { jj_la1_0(); } private static void jj_la1_0() { jj_la1_0 = new int[] {0x40,0x180,0x180,0x12,0x40,0x180,0x180,0x40,}; } public NumberParser(java.io.InputStream stream) { this(stream, null); } public NumberParser(java.io.InputStream stream, String encoding) { try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } token_source = new NumberParserTokenManager(jj_input_stream); token = new Token(); jj_ntk = -1; jj_gen = 0; for (int i = 0; i < 8; i++) jj_la1[i] = -1; } public void ReInit(java.io.InputStream stream) { ReInit(stream, null); } public void ReInit(java.io.InputStream stream, String encoding) { try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } token_source.ReInit(jj_input_stream); token = new Token(); jj_ntk = -1; jj_gen = 0; for (int i = 0; i < 8; i++) jj_la1[i] = -1; } public NumberParser(java.io.Reader stream) { jj_input_stream = new SimpleCharStream(stream, 1, 1); token_source = new NumberParserTokenManager(jj_input_stream); token = new Token(); jj_ntk = -1; jj_gen = 0; for (int i = 0; i < 8; i++) jj_la1[i] = -1; } public void ReInit(java.io.Reader stream) { jj_input_stream.ReInit(stream, 1, 1); token_source.ReInit(jj_input_stream); token = new Token(); jj_ntk = -1; jj_gen = 0; for (int i = 0; i < 8; i++) jj_la1[i] = -1; } public NumberParser(NumberParserTokenManager tm) { token_source = tm; token = new Token(); jj_ntk = -1; jj_gen = 0; for (int i = 0; i < 8; i++) jj_la1[i] = -1; } public void ReInit(NumberParserTokenManager tm) { token_source = tm; token = new Token(); jj_ntk = -1; jj_gen = 0; for (int i = 0; i < 8; i++) jj_la1[i] = -1; } final private Token jj_consume_token(int kind) throws ParseException { Token oldToken; if ((oldToken = token).next != null) token = token.next; else token = token.next = token_source.getNextToken(); jj_ntk = -1; if (token.kind == kind) { jj_gen++; return token; } token = oldToken; jj_kind = kind; throw generateParseException(); } final public Token getNextToken() { if (token.next != null) token = token.next; else token = token.next = token_source.getNextToken(); jj_ntk = -1; jj_gen++; return token; } final public Token getToken(int index) { Token t = token; for (int i = 0; i < index; i++) { if (t.next != null) t = t.next; else t = t.next = token_source.getNextToken(); } return t; } final private int jj_ntk() { if ((jj_nt=token.next) == null) return (jj_ntk = (token.next=token_source.getNextToken()).kind); else return (jj_ntk = jj_nt.kind); } private java.util.Vector jj_expentries = new java.util.Vector(); private int[] jj_expentry; private int jj_kind = -1; public ParseException generateParseException() { jj_expentries.removeAllElements(); boolean[] la1tokens = new boolean[9]; for (int i = 0; i < 9; i++) { la1tokens[i] = false; } if (jj_kind >= 0) { la1tokens[jj_kind] = true; jj_kind = -1; } for (int i = 0; i < 8; i++) { if (jj_la1[i] == jj_gen) { for (int j = 0; j < 32; j++) { if ((jj_la1_0[i] & (1<