/* * CS431 Summer 2004 * Project 1 * Group Members: Lo, Wing; Brown, Shallon; Lee, Myung; Luu, Huy; Shimko, Spencer * Explanation: This is a recursive descent parser. It recurses through * tokens passed to it from JLex's classes, parses, and evaluates * each token in turn. It uses a 1 token lookahead. * * Grammar in EBNF form: * S := VARIABLE '=' S | E | EVAL VARIABLE * E := ( '+' | '-' ) E T | T * T := ( '*' | '/' ) T F | F * F := EXP '(' F G ')' * G := VARIABLE | DOUBLE | '(' E ')' | ('arc')? TRIG '(' E ')' * TRIG := 'cos' | 'sin' | 'tan' * EVAL := 'eval' */ package Parser; import java.lang.System; import java.math.*; import java.util.Vector; // Class: Parser // Purpose: Execute our main public class Parser { public static void main(String argv[]) throws java.io.IOException { Tokenizer tok = new Tokenizer ( ); Grammar g = new Grammar ( tok ); Yytoken tokN; // run through until $ while ( tok.lookAhead() != null ){ // should be a full ErrorParseTreeNode to prevent // this try/catch hack... but not enough time try { g.A(); } catch ( java.lang.NullPointerException e ){ } } } } // Class: Grammar // Purpose: Recurse through productions using the tokenizer // passed in during contruction class Grammar { static Tokenizer tok; static Yytoken tokN; static Yytoken trash; static varMap varM = new varMap (); // enumerations static final int ADD = 0; static final int SUB = 1; static final int MUL = 2; static final int DIV = 3; static final int EQ = 4; static final int LPAR = 5; static final int RPAR = 6; static final int ARC = 8; static final int COS = 9; static final int SIN = 10; static final int TAN = 11; static final int RADS = 12; static final int EVAL = 13; static final int VAR = 15; static final int DUB = 14; static final int EXP = 16; Grammar ( Tokenizer t ){ tok = t; } // the rest of the methods in the Grammar class are the productions public ParseTreeNode A( ) throws java.io.IOException { tokN = tok.peek ( ); // System.out.println("PROD A: " + tokN ); switch ( tokN.getType() ) { case VAR: if ( tok.lookAhead().getType() != EQ ){ return (E()); } else { String vn = tokN.getText(); // obtain variable name trash = tok.get(); trash = tok.get(); // remove varname and equals sign // add variable to varmap varM.varCreate( vn, A() ); //trash = tok.get(); break; } case EVAL: trash = tok.get(); EVAL( ); trash = tok.get();break; default: return (E( )); } return null; } public ParseTreeNode E( ) throws java.io.IOException { tokN = tok.peek ( ); // System.out.println("PROD E: " + tokN ); switch ( tokN.getType() ) { case ADD: trash = tok.get(); return (new PlusPTN ( E( ), T( ) )); case SUB: trash = tok.get(); return (new SubPTN ( E( ), T( ) )); case RPAR: trash = tok.get(); break; default: return ( T( ) ); } return null; } public ParseTreeNode T( ) throws java.io.IOException { tokN = tok.peek ( ); // System.out.println("PROD T: " + tokN ); switch ( tokN.getType() ) { case MUL: trash = tok.get (); return ( new MulPTN ( T( ), F( ) )); case DIV: trash = tok.get (); return ( new DivPTN ( T( ), F( ) )); default: return ( F( ) ); } } public ParseTreeNode F( ) throws java.io.IOException { tokN = tok.peek ( ); // System.out.println("PROD F: " + tokN ); switch ( tokN.getType() ) { case EXP: trash = tok.get(); if ( tok.peek().getType() != LPAR ){ System.out.println("Missing open paren in trig function!"); return null; } trash = tok.get(); return ( new ExpPTN ( F( ), G ( ) )); case LPAR: trash = tok.get(); return ( E() ); default: return ( G ( ) ); } } public ParseTreeNode G( ) throws java.io.IOException { tokN = tok.peek ( ); // System.out.println("PROD G: " + tokN ); switch ( tokN.getType() ) { case VAR: return ( VARIABLE ( ) ); case DUB: dubPTN tmp = new dubPTN ( tok.peek().getText() ); trash = tok.get(); return ( tmp ); case LPAR: trash = tok.get();return (E ( )); // case RPAR: case ARC: return (INV ( )); case RADS: trash = tok.get(); if ( tok.peek().getType() != LPAR ){ System.out.println("Missing open paren in trig function!"); return null; } trash = tok.get(); return ( new dubPTN ( String.valueOf( Math.toRadians( Double.parseDouble(E().evaluate()) )))); default: return(TRIG()); } } public ParseTreeNode TRIG( ) throws java.io.IOException { tokN = tok.peek ( ); trash = tok.get(); if ( tok.peek().getType() != LPAR ){ System.out.println("Missing open paren in trig function!"); return null; } trash = tok.get(); switch ( tokN.getType() ) { // a lot of type casting is needed since all doubles are stored as strings case SIN: return ( new dubPTN( String.valueOf ( Math.sin( Double.parseDouble(E().evaluate()))))); case COS: return ( new dubPTN( String.valueOf ( Math.cos( Double.parseDouble(E().evaluate()))))); case TAN: return ( new dubPTN( String.valueOf ( Math.tan( Double.parseDouble(E().evaluate()))))); default: System.out.println( "TRIG error" ); return ( new dubPTN("-1") ); } } public ParseTreeNode INV( ) throws java.io.IOException { trash = tok.get ( ); tokN = tok.peek ( ); trash = tok.get(); if ( tok.peek().getType() != LPAR ){ System.out.println("Missing open paren in trig function!"); return null; } trash = tok.get(); switch ( tokN.getType() ) { // a lot of type casting is needed since all doubles are stored as strings case SIN: return ( new dubPTN( String.valueOf ( Math.asin(Double.parseDouble(E().evaluate()))))); case COS: return ( new dubPTN( String.valueOf ( Math.acos(Double.parseDouble(E().evaluate()))))); case TAN: return ( new dubPTN( String.valueOf ( Math.atan( Double.parseDouble(E().evaluate()))))); default: System.out.println(" INV error") ; return ( new dubPTN ("-1")); } //return ( new dubPTN (String.valueOf ((1 / Double.parseDouble (TRIG().evaluate())) ); } public void EVAL( ) throws java.io.IOException { String s = tok.peek().getText (); String val = varM.varLookup ( s ); if ( val == null ){ System.out.println ("eval " + tok.peek().getText() + " is uninitialized" ); } else { System.out.println( "Variable \"" + s + "\" evaluates to " + val ); } } public ParseTreeNode VARIABLE( ) throws java.io.IOException { dubPTN tmp = new dubPTN( varM.varLookup ( tok.peek().getText () ) ); trash = tok.get(); return ( tmp ); } } // Class: varMap // Purpose: Store and lookup variables class varMap { static Vector variables; varMap(){ variables = new Vector(); } public String varLookup(String s){ int index = variables.indexOf(s); if ( index == -1 ){ System.out.println("ERROR! Unknown variable " + s); return null; } return ( String.valueOf(variables.elementAt(index+1)) ); } public void varCreate( String s, ParseTreeNode val ){ int index = variables.indexOf(s); if ( index == -1 ){ variables.add(s); variables.add(val.evaluate()); } else { //variables.setElementAt( val.evaluate(), index+1 ); variables.add( (index+1), val.evaluate()); } } } // Class: Tokenizer // Purpose: Provide buffered access to the JLEX tokens class Tokenizer { // buffered and current token static Yytoken buffer; static Yytoken tokN; static int tokNum; // lexer static Lexer yy = new Lexer(System.in); Tokenizer ( ) throws java.io.IOException { // "prime" the buffer while ( true ){ try { tokN = yy.yylex(); buffer = yy.yylex(); tokNum += 2; break; } catch ( java.lang.Error e ){ System.out.println( "Tokenization error on line #0 token #0" ); } } } public static Yytoken get ( ) throws java.io.IOException { // get next token and update buffer tokN = buffer; while ( true ){ try { buffer = yy.yylex(); break; } catch ( java.lang.Error e ){ System.out.println( "Tokenization error on line " + yy.getLine ( ) + " token #" + yy.getTokCnt ( ) ); } } tokNum++; return tokN; } public static Yytoken peek ( ){ return tokN; } public static Yytoken lookAhead ( ){ return buffer; } public static int getTokCnt ( ){ return tokNum; } } // Class: Yytoken // Purpose: All token objects are of this type class Yytoken { Yytoken ( int type, String text, int line, int charBegin, int charEnd) { m_type = type; m_text = new String(text); m_line = line; m_charBegin = charBegin; m_charEnd = charEnd; } public boolean match ( int type ){ return ( m_type == type ); } public int m_type; public String m_text; public int m_line; public int m_charBegin; public int m_charEnd; public String toString() { return "Token type #"+m_type+": "+m_text+" (line "+m_line+")"; } public String getText ( ){ return m_text; } public int getType ( ){ return m_type; } } // InterfacE: ParseTreeNode // Purpose: Provide an abstraction for other PTN's to implement interface ParseTreeNode{ String evaluate(); } // The *PTN classes are specialized ParseTreeNodes that evaluate // as required class PlusPTN implements ParseTreeNode{ ParseTreeNode E; ParseTreeNode T; PlusPTN ( ParseTreeNode e, ParseTreeNode t ){ E = e; T = t; } public String evaluate ( ){ return String.valueOf ( Double.parseDouble (E.evaluate()) + Double.parseDouble (T.evaluate()) ); } } class SubPTN implements ParseTreeNode{ ParseTreeNode E; ParseTreeNode T; SubPTN ( ParseTreeNode e, ParseTreeNode t ){ E = e; T = t; } public String evaluate ( ){ return String.valueOf ( Double.parseDouble (E.evaluate()) - Double.parseDouble (T.evaluate()) ); } } class DivPTN implements ParseTreeNode{ ParseTreeNode E; ParseTreeNode T; DivPTN ( ParseTreeNode e, ParseTreeNode t ){ E = e; T = t; } public String evaluate ( ){ if ( Double.parseDouble (T.evaluate()) == 0.0 ){ System.out.println("ERROR: Divide by zero goes to infinity (dumbass)"); } return String.valueOf ( Double.parseDouble (E.evaluate()) / Double.parseDouble (T.evaluate()) ); } } class MulPTN implements ParseTreeNode{ ParseTreeNode E; ParseTreeNode T; MulPTN ( ParseTreeNode e, ParseTreeNode t ){ E = e; T = t; } public String evaluate ( ){ return String.valueOf ( Double.parseDouble (E.evaluate()) * Double.parseDouble (T.evaluate()) ); } } class dubPTN implements ParseTreeNode{ String S; dubPTN ( String s ){ S = s; } public String evaluate ( ){ return S; } } class trigPTN implements ParseTreeNode{ Yytoken PTN_Tok; public String evaluate ( ){ return null; } } class ExpPTN implements ParseTreeNode{ ParseTreeNode E; ParseTreeNode T; ExpPTN ( ParseTreeNode e, ParseTreeNode t ) { E = e; T = t; } public String evaluate ( ){ return String.valueOf ( Math.pow(Double.parseDouble (E.evaluate()), Double.parseDouble (T.evaluate()) ) ); } } // unimplemented at this point class ErrorPTN implements ParseTreeNode{ String err; ErrorPTN ( String S ){ err = S; } public String evaluate(){ return err; } } class Lexer { private final int YY_BUFFER_SIZE = 512; private final int YY_F = -1; private final int YY_NO_STATE = -1; private final int YY_NOT_ACCEPT = 0; private final int YY_START = 1; private final int YY_END = 2; private final int YY_NO_ANCHOR = 4; private final int YY_BOL = 128; private final int YY_EOF = 129; private int tokCount = 0; private int curLine = 0; public int getLine ( ){ return curLine; } public int getTokCnt ( ){ return tokCount; } private void updateStats ( ){ if ( yyline != curLine ){ tokCount = 0; curLine = yyline; } else { tokCount++; } } private java.io.BufferedReader yy_reader; private int yy_buffer_index; private int yy_buffer_read; private int yy_buffer_start; private int yy_buffer_end; private char yy_buffer[]; private int yychar; private int yyline; private boolean yy_at_bol; private int yy_lexical_state; Lexer (java.io.Reader reader) { this (); if (null == reader) { throw (new Error("Error: Bad input stream initializer.")); } yy_reader = new java.io.BufferedReader(reader); } Lexer (java.io.InputStream instream) { this (); if (null == instream) { throw (new Error("Error: Bad input stream initializer.")); } yy_reader = new java.io.BufferedReader(new java.io.InputStreamReader(instream)); } private Lexer () { yy_buffer = new char[YY_BUFFER_SIZE]; yy_buffer_read = 0; yy_buffer_index = 0; yy_buffer_start = 0; yy_buffer_end = 0; yychar = 0; yyline = 0; yy_at_bol = true; yy_lexical_state = YYINITIAL; } private boolean yy_eof_done = false; private final int YYINITIAL = 0; private final int yy_state_dtrans[] = { 0 }; private void yybegin (int state) { yy_lexical_state = state; } private int yy_advance () throws java.io.IOException { int next_read; int i; int j; if (yy_buffer_index < yy_buffer_read) { return yy_buffer[yy_buffer_index++]; } if (0 != yy_buffer_start) { i = yy_buffer_start; j = 0; while (i < yy_buffer_read) { yy_buffer[j] = yy_buffer[i]; ++i; ++j; } yy_buffer_end = yy_buffer_end - yy_buffer_start; yy_buffer_start = 0; yy_buffer_read = j; yy_buffer_index = j; next_read = yy_reader.read(yy_buffer, yy_buffer_read, yy_buffer.length - yy_buffer_read); if (-1 == next_read) { return YY_EOF; } yy_buffer_read = yy_buffer_read + next_read; } while (yy_buffer_index >= yy_buffer_read) { if (yy_buffer_index >= yy_buffer.length) { yy_buffer = yy_double(yy_buffer); } next_read = yy_reader.read(yy_buffer, yy_buffer_read, yy_buffer.length - yy_buffer_read); if (-1 == next_read) { return YY_EOF; } yy_buffer_read = yy_buffer_read + next_read; } return yy_buffer[yy_buffer_index++]; } private void yy_move_end () { if (yy_buffer_end > yy_buffer_start && '\n' == yy_buffer[yy_buffer_end-1]) yy_buffer_end--; if (yy_buffer_end > yy_buffer_start && '\r' == yy_buffer[yy_buffer_end-1]) yy_buffer_end--; } private boolean yy_last_was_cr=false; private void yy_mark_start () { int i; for (i = yy_buffer_start; i < yy_buffer_index; ++i) { if ('\n' == yy_buffer[i] && !yy_last_was_cr) { ++yyline; } if ('\r' == yy_buffer[i]) { ++yyline; yy_last_was_cr=true; } else yy_last_was_cr=false; } yychar = yychar + yy_buffer_index - yy_buffer_start; yy_buffer_start = yy_buffer_index; } private void yy_mark_end () { yy_buffer_end = yy_buffer_index; } private void yy_to_mark () { yy_buffer_index = yy_buffer_end; yy_at_bol = (yy_buffer_end > yy_buffer_start) && ('\r' == yy_buffer[yy_buffer_end-1] || '\n' == yy_buffer[yy_buffer_end-1] || 2028/*LS*/ == yy_buffer[yy_buffer_end-1] || 2029/*PS*/ == yy_buffer[yy_buffer_end-1]); } private java.lang.String yytext () { return (new java.lang.String(yy_buffer, yy_buffer_start, yy_buffer_end - yy_buffer_start)); } private int yylength () { return yy_buffer_end - yy_buffer_start; } private char[] yy_double (char buf[]) { int i; char newbuf[]; newbuf = new char[2*buf.length]; for (i = 0; i < buf.length; ++i) { newbuf[i] = buf[i]; } return newbuf; } private final int YY_E_INTERNAL = 0; private final int YY_E_MATCH = 1; private java.lang.String yy_error_string[] = { "Error: Internal error.\n", "Error: Unmatched input.\n" }; private void yy_error (int code,boolean fatal) { java.lang.System.out.print(yy_error_string[code]); java.lang.System.out.flush(); if (fatal) { throw new Error("Fatal Error.\n"); } } private int[][] unpackFromString(int size1, int size2, String st) { int colonIndex = -1; String lengthString; int sequenceLength = 0; int sequenceInteger = 0; int commaIndex; String workString; int res[][] = new int[size1][size2]; for (int i= 0; i < size1; i++) { for (int j= 0; j < size2; j++) { if (sequenceLength != 0) { res[i][j] = sequenceInteger; sequenceLength--; continue; } commaIndex = st.indexOf(','); workString = (commaIndex==-1) ? st : st.substring(0, commaIndex); st = st.substring(commaIndex+1); colonIndex = workString.indexOf(':'); if (colonIndex == -1) { res[i][j]=Integer.parseInt(workString); continue; } lengthString = workString.substring(colonIndex+1); sequenceLength=Integer.parseInt(lengthString); workString=workString.substring(0,colonIndex); sequenceInteger=Integer.parseInt(workString); res[i][j] = sequenceInteger; sequenceLength--; } } return res; } private int yy_acpt[] = { /* 0 */ YY_NOT_ACCEPT, /* 1 */ YY_NO_ANCHOR, /* 2 */ YY_NO_ANCHOR, /* 3 */ YY_NO_ANCHOR, /* 4 */ YY_NO_ANCHOR, /* 5 */ YY_NO_ANCHOR, /* 6 */ YY_NO_ANCHOR, /* 7 */ YY_NO_ANCHOR, /* 8 */ YY_NO_ANCHOR, /* 9 */ YY_NO_ANCHOR, /* 10 */ YY_NO_ANCHOR, /* 11 */ YY_NO_ANCHOR, /* 12 */ YY_NO_ANCHOR, /* 13 */ YY_NO_ANCHOR, /* 14 */ YY_NO_ANCHOR, /* 15 */ YY_NO_ANCHOR, /* 16 */ YY_NO_ANCHOR, /* 17 */ YY_NO_ANCHOR, /* 18 */ YY_NO_ANCHOR, /* 19 */ YY_NO_ANCHOR, /* 20 */ YY_NO_ANCHOR, /* 21 */ YY_NOT_ACCEPT, /* 22 */ YY_NO_ANCHOR, /* 23 */ YY_NO_ANCHOR, /* 24 */ YY_NO_ANCHOR, /* 25 */ YY_NO_ANCHOR, /* 26 */ YY_NO_ANCHOR, /* 27 */ YY_NO_ANCHOR, /* 28 */ YY_NO_ANCHOR, /* 29 */ YY_NO_ANCHOR, /* 30 */ YY_NO_ANCHOR, /* 31 */ YY_NO_ANCHOR, /* 32 */ YY_NO_ANCHOR, /* 33 */ YY_NO_ANCHOR, /* 34 */ YY_NO_ANCHOR, /* 35 */ YY_NO_ANCHOR, /* 36 */ YY_NO_ANCHOR, /* 37 */ YY_NO_ANCHOR, /* 38 */ YY_NO_ANCHOR }; private int yy_cmap[] = unpackFromString(1,130, "28:8,22:3,28:2,27,28:18,22,28:7,6,7,3,1,28,2,26,4,24:10,28:3,5,28:3,23:26,2" + "8:4,25,28,8,23,10,19,11,23:3,16,23:2,21,23,17,14,13,23,9,15,18,23,20,23,12," + "23:2,28:5,0:2")[0]; private int yy_rmap[] = unpackFromString(1,39, "0,1,2:2,1:5,3,4,5,6,1,7:7,8,9,8,7,10,11,12,13,14,15,16,17,18,19,20,7,21,22")[0]; private int yy_nxt[][] = unpackFromString(23,29, "1,2,3,4,5,6,7,8,9,33,34,35,36:3,37,36:2,38,36:3,10,36,11,36,12,-1,13,-1:53," + "11,-1:12,36,22,36:12,-1,36,24:2,-1:25,10,-1:30,11,-1,21,-1:3,12:21,-1,12:6," + "-1:8,36:14,-1,36,24:2,-1:27,23,-1:12,36:2,14,36:11,-1,36,24:2,-1:11,36:11,3" + "1,36:2,-1,36,24:2,-1:11,36:7,15,36:6,-1,36,24:2,-1:11,36:5,16,36:8,-1,36,24" + ":2,-1:11,32,36:13,-1,36,24:2,-1:11,36:9,17,36:4,-1,36,24:2,-1:11,36:9,18,36" + ":4,-1,36,24:2,-1:11,36:7,19,36:6,-1,36,24:2,-1:11,36:13,20,-1,36,24:2,-1:11" + ",25,36:13,-1,36,24:2,-1:11,36:6,26,36:7,-1,36,24:2,-1:11,36:4,27,36:7,28,36" + ",-1,36,24:2,-1:11,36:8,29,36:5,-1,36,24:2,-1:11,30,36:13,-1,36,24:2,-1:3"); public Yytoken yylex () throws java.io.IOException { int yy_lookahead; int yy_anchor = YY_NO_ANCHOR; int yy_state = yy_state_dtrans[yy_lexical_state]; int yy_next_state = YY_NO_STATE; int yy_last_accept_state = YY_NO_STATE; boolean yy_initial = true; int yy_this_accept; yy_mark_start(); yy_this_accept = yy_acpt[yy_state]; if (YY_NOT_ACCEPT != yy_this_accept) { yy_last_accept_state = yy_state; yy_mark_end(); } while (true) { if (yy_initial && yy_at_bol) yy_lookahead = YY_BOL; else yy_lookahead = yy_advance(); yy_next_state = YY_F; yy_next_state = yy_nxt[yy_rmap[yy_state]][yy_cmap[yy_lookahead]]; if (YY_EOF == yy_lookahead && true == yy_initial) { return null; } if (YY_F != yy_next_state) { yy_state = yy_next_state; yy_initial = false; yy_this_accept = yy_acpt[yy_state]; if (YY_NOT_ACCEPT != yy_this_accept) { yy_last_accept_state = yy_state; yy_mark_end(); } } else { if (YY_NO_STATE == yy_last_accept_state) { throw (new Error("Lexical Error: Unmatched Input.")); } else { yy_anchor = yy_acpt[yy_last_accept_state]; if (0 != (YY_END & yy_anchor)) { yy_move_end(); } yy_to_mark(); switch (yy_last_accept_state) { case 1: case -2: break; case 2: { updateStats ( ); return (new Yytoken(0,yytext(),yyline,yychar,yychar+1)); } case -3: break; case 3: { updateStats ( ); return (new Yytoken(1,yytext(),yyline,yychar,yychar+1)); } case -4: break; case 4: { updateStats ( ); return (new Yytoken(2,yytext(),yyline,yychar,yychar+1)); } case -5: break; case 5: { updateStats ( ); return (new Yytoken(3,yytext(),yyline,yychar,yychar+1)); } case -6: break; case 6: { updateStats ( ); return (new Yytoken(4,yytext(),yyline,yychar,yychar+1)); } case -7: break; case 7: { updateStats ( ); return (new Yytoken(5,yytext(),yyline,yychar,yychar+1)); } case -8: break; case 8: { updateStats ( ); return (new Yytoken(6,yytext(),yyline,yychar,yychar+1)); } case -9: break; case 9: { updateStats ( ); return (new Yytoken(15,yytext(),yyline,yychar,yychar + yytext().length())); } case -10: break; case 10: { } case -11: break; case 11: { updateStats ( ); return (new Yytoken(14,yytext(),yyline,yychar,yychar + yytext().length())); } case -12: break; case 12: { java.lang.System.out.println("Invalid number format '" + yytext() + "' on line " + yyline + " token " + (getTokCnt()+1)); } case -13: break; case 13: { java.lang.System.out.println("Unmatched input '" + yytext() + "' on line " + yyline+ " token " + (getTokCnt()+1)); } case -14: break; case 14: { updateStats ( ); return (new Yytoken(8,yytext(),yyline,yychar,yychar+1)); } case -15: break; case 15: { updateStats ( ); return (new Yytoken(9,yytext(),yyline,yychar,yychar+1)); } case -16: break; case 16: { updateStats ( ); return (new Yytoken(16,yytext(),yyline,yychar,yychar+1)); } case -17: break; case 17: { updateStats ( ); return (new Yytoken(10,yytext(),yyline,yychar,yychar+1)); } case -18: break; case 18: { updateStats ( ); return (new Yytoken(11,yytext(),yyline,yychar,yychar+1)); } case -19: break; case 19: { updateStats ( ); return (new Yytoken(12,yytext(),yyline,yychar,yychar+1)); } case -20: break; case 20: { updateStats ( ); return (new Yytoken(13,yytext(),yyline,yychar,yychar+1)); } case -21: break; case 22: { updateStats ( ); return (new Yytoken(15,yytext(),yyline,yychar,yychar + yytext().length())); } case -22: break; case 23: { updateStats ( ); return (new Yytoken(14,yytext(),yyline,yychar,yychar + yytext().length())); } case -23: break; case 24: { updateStats ( ); return (new Yytoken(15,yytext(),yyline,yychar,yychar + yytext().length())); } case -24: break; case 25: { updateStats ( ); return (new Yytoken(15,yytext(),yyline,yychar,yychar + yytext().length())); } case -25: break; case 26: { updateStats ( ); return (new Yytoken(15,yytext(),yyline,yychar,yychar + yytext().length())); } case -26: break; case 27: { updateStats ( ); return (new Yytoken(15,yytext(),yyline,yychar,yychar + yytext().length())); } case -27: break; case 28: { updateStats ( ); return (new Yytoken(15,yytext(),yyline,yychar,yychar + yytext().length())); } case -28: break; case 29: { updateStats ( ); return (new Yytoken(15,yytext(),yyline,yychar,yychar + yytext().length())); } case -29: break; case 30: { updateStats ( ); return (new Yytoken(15,yytext(),yyline,yychar,yychar + yytext().length())); } case -30: break; case 31: { updateStats ( ); return (new Yytoken(15,yytext(),yyline,yychar,yychar + yytext().length())); } case -31: break; case 32: { updateStats ( ); return (new Yytoken(15,yytext(),yyline,yychar,yychar + yytext().length())); } case -32: break; case 33: { updateStats ( ); return (new Yytoken(15,yytext(),yyline,yychar,yychar + yytext().length())); } case -33: break; case 34: { updateStats ( ); return (new Yytoken(15,yytext(),yyline,yychar,yychar + yytext().length())); } case -34: break; case 35: { updateStats ( ); return (new Yytoken(15,yytext(),yyline,yychar,yychar + yytext().length())); } case -35: break; case 36: { updateStats ( ); return (new Yytoken(15,yytext(),yyline,yychar,yychar + yytext().length())); } case -36: break; case 37: { updateStats ( ); return (new Yytoken(15,yytext(),yyline,yychar,yychar + yytext().length())); } case -37: break; case 38: { updateStats ( ); return (new Yytoken(15,yytext(),yyline,yychar,yychar + yytext().length())); } case -38: break; default: yy_error(YY_E_INTERNAL,false); case -1: } yy_initial = true; yy_state = yy_state_dtrans[yy_lexical_state]; yy_next_state = YY_NO_STATE; yy_last_accept_state = YY_NO_STATE; yy_mark_start(); yy_this_accept = yy_acpt[yy_state]; if (YY_NOT_ACCEPT != yy_this_accept) { yy_last_accept_state = yy_state; yy_mark_end(); } } } } } }