%% %class scanner %unicode %line %column %byaccj %{ /* For more information, please see the jflex manual They have explanation as to why we need a reference to a parser object. We also will need a cross-reference back to the lexer object.*/ /* store a reference to the parser object */ private Parser yyparser; /* constructor taking an additional parser */ public scanner (java.io.Reader r, Parser yyparser) { this (r); this.yyparser = yyparser; } /* return the current line number. We need this because yyline is made private and we don't have a mechanism like extern in C. */ public int getLine() { return yyline; } %} %% A {return (int) yycharat(0);} B {return (int) yycharat(0);} C {return (int) yycharat(0);} D {return (int) yycharat(0);} E {return (int) yycharat(0);} F {return (int) yycharat(0);} G {return (int) yycharat(0);} H {return (int) yycharat(0);} [ \t] {;} \r|\n|\r\n {return Parser.EOLN;} . {;}