From: megacz Date: Fri, 30 Jan 2004 06:59:43 +0000 (+0000) Subject: 2003/05/02 13:30:52 X-Git-Tag: RC3~1009 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=89152b4505ee3435af5396582e25ef45bd48f290;p=org.ibex.core.git 2003/05/02 13:30:52 darcs-hash:20040130065943-2ba56-77d6616b28bf4c841546aab69e13385240c35114.gz --- diff --git a/src/org/xwt/js/Parser.java b/src/org/xwt/js/Parser.java index cd2498b..a7f29b7 100644 --- a/src/org/xwt/js/Parser.java +++ b/src/org/xwt/js/Parser.java @@ -5,7 +5,15 @@ import java.io.*; // FIXME: for..in public class Parser extends Lexer { - public static void main(String[] s) throws Exception { System.out.println(new Parser(new InputStreamReader(System.in)).parseExpr()); } + public static void main(String[] s) throws Exception { + Parser p = new Parser(new InputStreamReader(System.in)); + while(true) { + Expr block = p.parseBlock(false); + if (block == null) return; + System.out.println(block); + if (p.peekToken() == -1) return; + } + } public Parser(Reader r) throws IOException { super(r); } private Parser skipToken() throws IOException { getToken(); return this; } @@ -29,12 +37,13 @@ public class Parser extends Lexer { String ret = ""; for(int i=0; i