2003/06/09 06:38:36
[org.ibex.core.git] / src / org / xwt / js / Lexer.java
index f7039f4..4752c64 100644 (file)
@@ -25,7 +25,7 @@ class Lexer implements Tokens {
 
     /** for debugging */
     public static void main(String[] s) throws Exception {
-       Lexer l = new Lexer(new InputStreamReader(System.in));
+       Lexer l = new Lexer(new InputStreamReader(System.in), "stdin", 0);
        int tok = 0;
        while((tok = l.getToken()) != -1) System.out.println(codeToString[tok]);
     }
@@ -46,10 +46,14 @@ class Lexer implements Tokens {
     protected int col = 0;
 
     /** the name of the source code file being lexed */
-    protected String sourceName = "unknown";
+    protected String sourceName;
 
     private SmartReader in;
-    public Lexer(Reader r) throws IOException { in = new SmartReader(r); }
+    public Lexer(Reader r, String sourceName, int line) throws IOException {
+       this.sourceName = sourceName;
+       this.line = line;
+       in = new SmartReader(r);
+    }
 
 
     // Predicates ///////////////////////////////////////////////////////////////////////