package jayanth.junction;
import java.io.BufferedReader;

public class Lexer {
    private BufferedReader reader;
    private char current_char;
    private State current_state;
    private String current_token;

    private State transition(typechar c) {
        return table_f[current_state][c];
    }

    private Token lex_token() { 
    }

    private boolean is_final_state(State s) {
        return s > SFINAL;
    }
    private enum State {
        S_INITIAL,
        S_STRING,
        S_NUMERIC,
        S_FLOAT,
        S_ID,
        SFINAL,
        SFINAL_LPAREN,
        SFINAL_RPAREN,
        SFINAL_ID,
        SFINAL_INTEGER,
        SFINAL_FLOAT,
        SFINAL_STRING
    }
    public Lexer() {
        //initialize the finite state machine
        table_f[S_INITIAL][TC_QUOTE] = S_STRING;
        table_f[S_INITIAL][TC_LPAREN] = SFINAL_LPAREN;
        table_f[S_INITIAL][TC_RPAREN] = SFINAL_RPAREN;
        table_f[S_INITIAL][TC_DOT] = S_FLOAT;
        table_f[S_INITIAL][TC_HYPHEN] = S_NUMERIC;
        table_f[S_INITIAL][TC_DIGIT] = S_NUMERIC;
        table_f[S_INITIAL][TC_IDSTART] = S_ID;
        table_f[S_INITIAL][TC_OTHER] = SFINAL_ERROR;

        table_f[S_STRING][TC_QUOTE] = SFINAL_STRING;
        table_f[S_STRING][TC_LPAREN] = S_STRING;
        table_f[S_STRING][TC_RPAREN] = S_STRING;
        table_f[S_STRING][TC_DOT] = S_STRING;
        table_f[S_STRING][TC_HYPHEN] = S_STRING;
        table_f[S_STRING][TC_DIGIT] = S_STRING;
        table_f[S_STRING][TC_IDSTART] = S_STRING;
        table_f[S_STRING][TC_OTHER] = S_STRING;

        table_f[S_NUMERIC][TC_QUOTE] = SFINAL_INTEGER;
        table_f[S_NUMERIC][TC_LPAREN] = SFINAL_INTEGER;
        table_f[S_NUMERIC][TC_RPAREN] = SFINAL_INTEGER;
        table_f[S_NUMERIC][TC_DOT] = S_FLOAT;
        table_f[S_NUMERIC][TC_HYPHEN] = SFINAL_INTEGER;
        table_f[S_NUMERIC][TC_DIGIT] = S_NUMERIC;
        table_f[S_NUMERIC][TC_IDSTART] = SFINAL_INTEGER;
        table_f[S_NUMERIC][TC_OTHER] = SFINAL_INTEGER;

        table_f[S_FLOAT][TC_QUOTE] = SFINAL_FLOAT;
        table_f[S_FLOAT][TC_LPAREN] = SFINAL_FLOAT;
        table_f[S_FLOAT][TC_RPAREN] = SFINAL_FLOAT;
        table_f[S_FLOAT][TC_DOT] = S_FLOAT;
        table_f[S_FLOAT][TC_HYPHEN] = SFINAL_FLOAT;
        table_f[S_FLOAT][TC_DIGIT] = SFINAL_FLOAT;
        table_f[S_FLOAT][TC_IDSTART] = SFINAL_FLOAT;
        table_f[S_FLOAT][TC_OTHER] = SFINAL_FLOAT;

        table_f[S_ID][TC_QUOTE] = SFINAL_ID;
        table_f[S_ID][TC_LPAREN] = SFINAL_ID;
        table_f[S_ID][TC_RPAREN] = SFINAL_ID;
        table_f[S_ID][TC_DOT] = S_ID;
        table_f[S_ID][TC_HYPHEN] = SFINAL_ID;
        table_f[S_ID][TC_DIGIT] = S_ID;
        table_f[S_ID][TC_IDSTART] = S_ID;
        table_f[S_ID][TC_OTHER] = SFINAL_ID;
    }
    public Token next_token() {
        return lex_token();
    }
}

@@ -235,17 +235,17 @@
 nsition(
-t
+T
 ypechar 
@@ -339,82 +339,940 @@
     
-%7D%0A%0A    private boolean is_final_state(State s) %7B%0A        return s %3E SFINAL
+    current_token = new StringBuilder(); //will add each char to build up%0A        current_state = transition(classify(current_char));%0A        while (!is_final_state(current_state)) %7B%0A            current_token.append(current_char);%0A            current_char = reader.read();%0A            current_state = transition(classify(current_char));%0A        %7D%0A        if (current_state == SFINAL_ERROR) %7B%0A            //throw %60invalid token%60 error%0A        %7D%0A    %7D%0A%0A    private boolean is_final_state(State s) %7B%0A        return s %3E SFINAL;%0A    %7D%0A    private Typechar classify(char c) %7B%0A        if c == '%22' return TC_QUOTE;%0A        if c == '(' return TC_LPAREN;%0A        if c == ')' return TC_RPAREN;%0A        if c == '.' return TC_DOT;%0A        if c == '-' return TC_HYPHEN;%0A        if Character.isDigit(c) return TC_DIGIT;%0A        if Character.isLetter(c) return TC_IDSTART;%0A        if (c == '+' %7C%7C c == '-' %7C%7C c == '*' %7C%7C c == '/') return TC_IDSTART
 ;%0A  
@@ -1535,16 +1535,218 @@
 L_STRING
+,%0A        SFINAL_ERROR%0A    %7D%0A    private enum Typechar %7B%0A        TC_QUOTE,%0A        TC_LPAREN,%0A        TC_RPAREN,%0A        TC_DOT,%0A        TC_HYPHEN,%0A        TC_DIGIT,%0A        TC_IDSTART,%0A        TC_OTHER
 %0A    %7D%0A 
@@ -3832,24 +3832,59 @@
 t_token() %7B%0A
+        current_state = S_INITIAL;%0A
         retu

Add classify and lex