X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Fjs%2FParser.java;h=cd2498b327b4e0dd5fe9205002e218e183d2013f;hb=26425831523e621df99c1a75312f9eaf61ed90cc;hp=861432ce991501330b3a747dc1f485af2baf7311;hpb=61fdc9714631e4d2f26b89da1beab22ace3d5e9f;p=org.ibex.core.git diff --git a/src/org/xwt/js/Parser.java b/src/org/xwt/js/Parser.java index 861432c..cd2498b 100644 --- a/src/org/xwt/js/Parser.java +++ b/src/org/xwt/js/Parser.java @@ -3,9 +3,10 @@ import org.xwt.util.*; import java.io.*; // FIXME: for..in -// FIXME: delete keyword public class Parser extends Lexer { + public static void main(String[] s) throws Exception { System.out.println(new Parser(new InputStreamReader(System.in)).parseExpr()); } + public Parser(Reader r) throws IOException { super(r); } private Parser skipToken() throws IOException { getToken(); return this; } @@ -20,8 +21,26 @@ public class Parser extends Lexer { Expr next = null; // if this expr is part of a list String string = null; + Number number = null; + + public String toString() { return toString(0); } + + public String toString(int indent) { + String ret = ""; + for(int i=0; i