/* SCCS - @(#)alpha.lex 1.18 - 09/15/99 - 10:39:54 */ %{ /* * SCCS @(#)alpha.lex 1.12 - 08/05/99 - 15:01:14 * * $Log: alpha.lex,v $ * * 98/9/28 sn: added \r to NONNEWLINE_WHITE_SPACE_CHAR list because * PC's add an extra \r to newlines * * Revision 1.6 1998/01/30 20:02:58 erhan * ver 5 * * Revision 1.5 1997/12/13 01:30:31 erhan * aa - commited files for erhan. erhan will comment when he comes back * * Revision 1.4 1997/11/06 03:21:55 erhan * NSL3.0.b * * Revision 1.3 1997/07/30 21:10:33 erhan * nsl3.0 * * Revision 1.2 1997/06/13 22:46:57 erhan * 'NslMain takes model name as a parameter, npp:verbatim_on verbatim_off semi-column stuff, NslModule: method to setup display variables ' * * Revision 1.1.1.1 1997/03/12 23:09:23 nsl * changed dir struct * * Revision 1.1.1.1 1997/02/20 08:04:35 nsl * Importng npp * */ package npp.src; import java.lang.System; import java.io.*; import java.util.*; import npp.src.util.*; import pp.src.jbf.*; class Utility { public static void assert ( boolean expr ) { if (false == expr) { throw (new Error("Error: Assertion failed.")); } } private static final String errorMsg[] = { "Error: Unmatched end-of-comment punctuation.", "Error: Unmatched start-of-comment punctuation.", "Error: Unclosed string.", "Error: Illegal character." }; public static final int E_ENDCOMMENT = 0; public static final int E_STARTCOMMENT = 1; public static final int E_UNCLOSEDSTR = 2; public static final int E_UNMATCHED = 3; public static void error ( int code ) { System.out.println(errorMsg[code]); } } //{COMMENT_TEXT} { } %} %s COMMENT %s VERB_ON %s VERB_SCAN %s VERB_IGN IDENTIFIER [A-Za-z_$][A-Za-z_$0-9]* ALPHA [A-Za-z] DIGIT [0-9] HEXDIGIT [A-Fa-f0-9] OCTDIGIT [0-7] DECNUMBER [1-9]{DIGIT}* HEXNUMBER 0[Xx]{HEXDIGIT}+ OCTNUMBER 0{OCTDIGIT}* DECLONG {DECNUMBER}[Ll] HEXLONG {HEXNUMBER}[Ll] OCTLONG {OCTNUMBER}[Ll] EXPONENT [Ee][+-]?{DIGIT}+ FLOATBASE ((({DIGIT}+\.{DIGIT}*)|({DIGIT}*\.{DIGIT}+)){EXPONENT})|({DIGIT}+{EXPONENT})|({DIGIT}+\.{DIGIT}*)|({DIGIT}*\.{DIGIT}+) DOUBLE ({FLOATBASE}[Dd]?)|({DIGIT}+[Dd]) FLOAT ({FLOATBASE}|({DIGIT}+))[Ff] UNICODE_CHARACTER \\u{HEXDIGIT}{HEXDIGIT}{HEXDIGIT}{HEXDIGIT} ONECHAR [\^'\"]|(\\.)|.|(\\[0123]?{OCTDIGIT}{OCTDIGIT}?)|{UNICODE_CHARACTER} CHARLITCHAR {ONECHAR}|"\"" CHARACTER '[\^'\"]'|'(\\.)'|'.'|'(\\[0123]?{OCTDIGIT}{OCTDIGIT}?)'|'{UNICODE_CHARACTER}' STRINGCHAR {ONECHAR}|' STRING "\""{STRINGCHAR}*"\"" CHAR_OP [,;()[\].&|!~=+*/%<>^?:@] WHITESPACE [ \n\r\t]+ NONNEWLINE_WHITE_SPACE_CHAR [\ \t\b\012\r] WHITE_SPACE_CHAR [\n\ \t\b\012] STRING_TEXT (\\"\""|[^\n\"]|\\{WHITE_SPACE_CHAR}+\\)* COMMENT_TEXT ([^"/"*\n]|[^*\n]"/"[^*\n]|[^/\n]"*"[^/\n]|"*"[^/\n]|"/"[^*\n])* %% {NONNEWLINE_WHITE_SPACE_CHAR}+ ; \n ; "/*" { yybegin(COMMENT); comment_count = comment_count + 1; } "/*" { comment_count = comment_count + 1; } "*/" { comment_count = comment_count - 1; Utility.assert(comment_count >= 0); if (comment_count == 0) { yybegin(INITIAL); } } . { } "//".* { } \"{STRING_TEXT}\" { // Utility.assert(str.length() == lexeme().length() - 2); yyreturn((YYtoken)(new String_Token(YYtokentypes.STRING_LITERAL,yytext))); } \"{STRING_TEXT} { // Utility.error(Utility.E_UNCLOSEDSTR); //Utility.assert(str.length() == lexeme().length() - 1); yyreturn((YYtoken)(new String_Token(YYtokentypes.STRING_LITERAL,yytext))); } {FLOAT} { /* String str; if (lexeme().endsWith("f") || lexeme().endsWith("F")) { str = lexeme().substring(0,lexeme().length()-1); Utility.assert(str.length() == lexeme().length() - 1); } else str = lexeme(); */ Float_Token t = new Float_Token(YYtokentypes.FLOAT_LITERAL,yytext); /* try { t.m_float = java.lang.Float.valueOf(str).floatValue(); } catch (NumberFormatException e) { System.err.println("Unexpected integer number parse error at line:" +yyline+" char:"+yychar()+" to "+(yychar() + str.length())); } */ yyreturn ((YYtoken)t); } {DOUBLE} { /* String str; if (lexeme().endsWith("d") || lexeme().endsWith("D")) { str = lexeme().substring(0,lexeme().length()-1); Utility.assert(str.length() == lexeme().length() - 1); } else str = lexeme(); */ Double_Token t = new Double_Token(YYtokentypes.DOUBLE_LITERAL,yytext); /* try { t.m_double = java.lang.Double.valueOf(str).doubleValue(); } catch (NumberFormatException e) { System.err.println("Unexpected integer number parse error at line:" +yyline+" char:"+yychar()+" to "+(yychar() + str.length())); } */ yyreturn((YYtoken)(t)); } {DECLONG} { // String str = lexeme().substring(0,lexeme().length() - 1); DecLong_Token t = new DecLong_Token(YYtokentypes.LONG_LITERAL,yytext); /* Utility.assert(str.length() == lexeme().length() - 1); try { t.m_long = java.lang.Long.valueOf(str).longValue(); } catch (NumberFormatException e) { System.err.println("Unexpected long number parse error at line:" +yyline+" char:"+yychar()+" to "+(yychar() + str.length())); } */ yyreturn((YYtoken)(t)); } {HEXLONG} { /* String str = lexeme().substring(2,lexeme().length() - 1); Long_Token t = new Long_Token(YYtokentypes.LONG_LITERAL,yytext); Utility.assert(str.length() == lexeme().length() - 2); try { t.m_long = java.lang.Long.valueOf(str, 16).longValue(); } catch (NumberFormatException e) { System.err.println("Unexpected long number parse error at line:" +yyline+" char:"+yychar()+" to "+(yychar() + str.length())); } */ yyreturn((YYtoken)( new HexLong_Token(YYtokentypes.LONG_LITERAL,yytext))); } {OCTLONG} { /* String str = lexeme().substring(1,lexeme().length() - 1); Long_Token t = new Long_Token(YYtokentypes.LONG_LITERAL,yytext); Utility.assert(str.length() == lexeme().length() - 2); try { t.m_long = java.lang.Long.valueOf(str, 8).longValue(); } catch (NumberFormatException e) { System.err.println("Unexpected long number parse error at line:" +yyline+" char:"+yychar()+" to "+(yychar() + str.length())); } yyreturn((YYtoken)(t)); */ yyreturn((YYtoken)(new OctLong_Token(YYtokentypes.LONG_LITERAL,yytext))); } {DECNUMBER} { /* Int_Token t = new Int_Token(YYtokentypes.INT_LITERAL,yytext); try { t.m_int = java.lang.Integer.parseInt(lexeme()); } catch (NumberFormatException e) { System.err.println("Unexpected 10-based integer number parse error at line:" +yyline+" char:"+yychar()+" to "+(yychar() + lexeme().length())+"str "+lexeme()); } yyreturn((YYtoken)(t)); */ yyreturn((YYtoken)(new DecInt_Token(YYtokentypes.INT_LITERAL,yytext))); } {HEXNUMBER} { /* String str = lexeme().substring(2,lexeme().length()); Int_Token t = new Int_Token(YYtokentypes.INT_LITERAL,yytext); Utility.assert(str.length() == lexeme().length() - 2); try { t.m_int = java.lang.Integer.parseInt(str, 16); } catch (NumberFormatException e) { System.err.println("Unexpected 16-based integer number parse error at line:" +yyline+" char:"+yychar()+" to "+(yychar() + str.length())); } yyreturn((YYtoken)(t)); */ yyreturn((YYtoken)(new OctInt_Token(YYtokentypes.INT_LITERAL,yytext))); } {OCTNUMBER} { /* String str = lexeme(); Int_Token t = new Int_Token(YYtokentypes.INT_LITERAL,yytext); //Utility.assert(str.length() == lexeme().length() - 1); try { t.m_int = java.lang.Integer.parseInt(str, 8); } catch (NumberFormatException e) { System.err.println("Unexpected 8-based integer number parse error at line:" +yyline+" char:"+yychar()+" to "+(yychar() + str.length())); } yyreturn((YYtoken)(t)); */ yyreturn((YYtoken)(new DecInt_Token(YYtokentypes.INT_LITERAL,yytext))); } {CHARACTER} { // String str = lexeme().substring(1,lexeme().length()-1); // Utility.assert(str.length() == lexeme().length() - 2); yyreturn((YYtoken)(new Char_Token(YYtokentypes.CHARACTER_LITERAL,yytext))); } [.\n] { } "verbatim_off"{WHITESPACE}*";" { yybegin(INITIAL); yyreturn(new YYtoken(YYtokentypes.VERBATIM_OFF,yytext)); } "verbatim_NSLJ"{WHITESPACE}*";" { // yybegin(VERB_SCAN); yybegin(VERB_ON); yyreturn(new YYtoken(YYtokentypes.VERBATIM_NSLJ,yytext));} "verbatim_NSLC"{WHITESPACE}*";" { // yybegin(VERB_SCAN); yybegin(VERB_ON); yyreturn(new YYtoken(YYtokentypes.VERBATIM_NSLC,yytext));} "NSLJ" { yyreturn(new YYtoken(YYtokentypes.NSLJ,yytext));} "special" {yyreturn(new YYtoken(YYtokentypes.SPECIAL,yytext));} "SPECIAL" {yyreturn(new YYtoken(YYtokentypes.SPECIAL,yytext));} "ARRAY" {yyreturn(new YYtoken(YYtokentypes.ARRAY,yytext));} "ARRAY new" {yyreturn(new YYtoken(YYtokentypes.NEW,yytext));} "nslModule" {yyreturn(new YYtoken(YYtokentypes.NSLMODULE,yytext));} "nslInModule" {yyreturn(new YYtoken(YYtokentypes.NSLMODULE,yytext));} "nslOutModule" {yyreturn(new YYtoken(YYtokentypes.NSLMODULE,yytext));} "nslModel" {yyreturn(new YYtoken(YYtokentypes.NSLMODEL,yytext));} "nslClass" {yyreturn(new YYtoken(YYtokentypes.NSLCLASS,yytext));} "connect" { yyreturn(new YYtoken(YYtokentypes.CONNECT,yytext));} "nslConnect" { yyreturn(new YYtoken(YYtokentypes.CONNECT,yytext));} "nslRelabel" { yyreturn(new YYtoken(YYtokentypes.CONNECT,yytext));} "nslprint" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslprintln" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "NslPrintln" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "NslPrint" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslPrintln" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslPrint" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslAdd" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslConv" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslConvzero" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslConvW" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslConvC" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslDiv" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslDiff" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslFillColumns" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslFillRows" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslMath" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslMaxValue" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslMinValue" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslMul" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslProd" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslProduct" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslRamp" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslSaturation" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslSigmoid" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslSigmoid2" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslStep" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslSub" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslTrans" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslSum" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslSumRows" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslSumColumns" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslMaxElem" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslMinElem" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslGetSector" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslSetSector" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslElemMult" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslElemDiv" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslConcatenateRows" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslConcatenateColumns" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslGetRow" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslGetColumn" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslRandom" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslGuassian" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslRint" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslAbs" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslExp" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslArcCos" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslArcSin" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslArcTan" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslCos" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslSin" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslTan" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslLog" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslMaxMerge" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslMinMerge" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslPow" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslSome" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslNone" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslAll" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "=>".* { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslSqrt" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslDistance" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslBound" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "nslDotProd" { yyreturn(new YYtoken(YYtokentypes.NSLMULTI,yytext));} "abstract" { yyreturn(new YYtoken(YYtokentypes.ABSTRACT,yytext));} "boolean" { yyreturn(new YYtoken(YYtokentypes.BOOLEAN,yytext));} "break" { yyreturn(new YYtoken(YYtokentypes.BREAK,yytext));} "byte" { yyreturn(new YYtoken(YYtokentypes.BYTE,yytext));} "case" { yyreturn(new YYtoken(YYtokentypes.CASE,yytext));} "catch" { yyreturn(new YYtoken(YYtokentypes.CATCH,yytext));} "char" { yyreturn(new YYtoken(YYtokentypes.CHAR, yytext));} "class" { yyreturn(new YYtoken(YYtokentypes.CLASS,yytext));} "continue" { yyreturn(new YYtoken(YYtokentypes.CONTINUE,yytext));} "default" { yyreturn(new YYtoken(YYtokentypes.DEFAULT, yytext));} "do" { yyreturn(new YYtoken(YYtokentypes.DO , yytext));} "double" { yyreturn(new YYtoken(YYtokentypes.DOUBLE, yytext));} "extends" { yyreturn(new YYtoken(YYtokentypes.EXTENDS, yytext));} "else" { yyreturn(new YYtoken(YYtokentypes.ELSE, yytext));} "false" { yyreturn(new YYtoken(YYtokentypes.FALSE_TOKEN, yytext));} "final" { yyreturn(new YYtoken(YYtokentypes.FINAL, yytext));} "finally" { yyreturn(new YYtoken(YYtokentypes.FINALLY, yytext));} "float" { yyreturn(new YYtoken(YYtokentypes.FLOAT , yytext));} "for" { yyreturn(new YYtoken(YYtokentypes.FOR , yytext));} "if" { yyreturn(new YYtoken(YYtokentypes.IF , yytext));} "implements" { yyreturn(new YYtoken(YYtokentypes.IMPLEMENTS, yytext));} "nslImport" { yyreturn(new YYtoken(YYtokentypes.NSLIMPORT , yytext));} "instanceof" { yyreturn(new YYtoken(YYtokentypes.INSTANCEOF, yytext));} "int" { yyreturn(new YYtoken(YYtokentypes.INT , yytext));} "interface" { yyreturn(new YYtoken(YYtokentypes.INTERFACE, yytext));} "long" { yyreturn(new YYtoken(YYtokentypes.LONG , yytext));} "native" { yyreturn(new YYtoken(YYtokentypes.NATIVE , yytext));} "new" { yyreturn(new YYtoken(YYtokentypes.NEW , yytext));} "null" { yyreturn(new YYtoken(YYtokentypes.NULL_TOKEN , yytext));} "package" { yyreturn(new YYtoken(YYtokentypes.PACKAGE , yytext));} "private" { yyreturn(new YYtoken(YYtokentypes.PRIVATE , yytext));} "protected" { yyreturn(new YYtoken(YYtokentypes.PROTECTED, yytext));} "public" { yyreturn(new YYtoken(YYtokentypes.PUBLIC , yytext));} "return" { yyreturn(new YYtoken(YYtokentypes.RETURN , yytext));} "short" { yyreturn(new YYtoken(YYtokentypes.SHORT , yytext));} "static" { yyreturn(new YYtoken(YYtokentypes.STATIC , yytext));} "super" { yyreturn(new YYtoken(YYtokentypes.SUPER , yytext));} "switch" { yyreturn(new YYtoken(YYtokentypes.SWITCH , yytext));} "synchronized" { yyreturn(new YYtoken(YYtokentypes.SYNCHRONIZED, yytext));} "this" { yyreturn(new YYtoken(YYtokentypes.THIS , yytext));} "throw" { yyreturn(new YYtoken(YYtokentypes.THROW , yytext));} "throws" { yyreturn(new YYtoken(YYtokentypes.THROWS , yytext));} "transient" { yyreturn(new YYtoken(YYtokentypes.TRANSIENT, yytext));} "volatile" { yyreturn(new YYtoken(YYtokentypes.VOLATILE , yytext));} "true" { yyreturn(new YYtoken(YYtokentypes.TRUE_TOKEN, yytext));} "try" { yyreturn(new YYtoken(YYtokentypes.TRY , yytext));} "void" { yyreturn(new YYtoken(YYtokentypes.VOID , yytext));} "while" { yyreturn(new YYtoken(YYtokentypes.WHILE , yytext));} ">>=" { yyreturn(new YYtoken(YYtokentypes.SHIFT_RIGHT_EQUALS, yytext));} ">>>=" { yyreturn(new YYtoken(YYtokentypes.FILL_SHIFT_RIGHT_EQUALS, yytext));} "<<=" { yyreturn(new YYtoken(YYtokentypes.SHIFT_LEFT_EQUALS, yytext));} "+=" { yyreturn(new YYtoken(YYtokentypes.ADD_EQUALS, yytext));} "-=" { yyreturn(new YYtoken(YYtokentypes.SUB_EQUALS, yytext));} "*=" { yyreturn(new YYtoken(YYtokentypes.MUL_EQUALS, yytext));} "/=" { yyreturn(new YYtoken(YYtokentypes.DIV_EQUALS, yytext));} "%=" { yyreturn(new YYtoken(YYtokentypes.MOD_EQUALS, yytext));} "&=" { yyreturn(new YYtoken(YYtokentypes.AND_EQUALS, yytext));} "^=" { yyreturn(new YYtoken(YYtokentypes.XOR_EQUALS, yytext));} "|=" { yyreturn(new YYtoken(YYtokentypes.OR_EQUALS, yytext));} ">>" { yyreturn(new YYtoken(YYtokentypes.BITSHIFT_RIGHT, yytext));} ">>>" { yyreturn(new YYtoken(YYtokentypes.FILL_SHIFT_RIGHT, yytext));} "<<" { yyreturn(new YYtoken(YYtokentypes.SHIFT_LEFT, yytext));} "++" { yyreturn(new YYtoken(YYtokentypes.INCR, yytext));} "--" { yyreturn(new YYtoken(YYtokentypes.DECR, yytext));} "&&" { yyreturn(new YYtoken(YYtokentypes.AND, yytext));} "||" { yyreturn(new YYtoken(YYtokentypes.OR, yytext));} "<=" { yyreturn(new YYtoken(YYtokentypes.LTEQ, yytext));} ">=" { yyreturn(new YYtoken(YYtokentypes.GTEQ, yytext));} "==" { yyreturn(new YYtoken(YYtokentypes.EQUAL_COMPARE, yytext));} "!=" { yyreturn(new YYtoken(YYtokentypes.NOT_EQUAL, yytext));} {CHAR_OP} { yyreturn(new YYtoken((yytext.lexeme()).charAt(0), yytext));} "{" { yyreturn(new YYtoken((yytext.lexeme()).charAt(0), yytext));} "}" { yyreturn(new YYtoken((yytext.lexeme()).charAt(0), yytext));} "-" { yyreturn(new YYtoken((yytext.lexeme()).charAt(0), yytext));} ".*" { yyreturn(new YYtoken(YYtokentypes.BIT_MUL, yytext));} "NslCharString" { yyreturn(new YYtoken(YYtokentypes.STRING, yytext));} "charString" { yyreturn(new YYtoken(YYtokentypes.STRING, yytext));} {IDENTIFIER} { YYtoken t =new YYtoken(YYtokentypes.SYMBOL, yytext); yyreturn(t); } . { System.out.println("Illegal character: <" + yytext.lexeme() + "> at line "+yyline()); Utility.error(Utility.E_UNMATCHED); } %% private int comment_count = 0; NslPreProcessor npp; public void init(NslPreProcessor npp) { npp.setWholeBuffer(yytext.wholebuffer); }