1
我是JFlex的初學者。我正在開發Ubuntu,並安裝了Java以及JFlex。 java以及jflex命令都可以正常工作,這意味着PATH變量可以正確設置。當我運行我的jflex文件時,它會運行w/o錯誤,但在運行.java文件時會給出一些關於sym的錯誤。我執行線如下...JAVA文件中的JFlex編譯錯誤
jflex abc.jflex
javac -cp java-cup-0.11a.jar PascalLexer.java
的錯誤是如下:
[email protected]:~/myFlex$ javac -cp java-cup-0.11a.jar PascalLexer.java
PascalLexer.java:663: error: cannot find symbol
{ return newSym(sym.TYPE);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:667: error: cannot find symbol
{ return newSym(sym.REAL, new Double(yytext()));
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:671: error: cannot find symbol
{ return newSym(sym.GTR);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:675: error: cannot find symbol
{ return newSym(sym.ASSMNT);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:679: error: cannot find symbol
{ return newSym(sym.ELSE);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:683: error: cannot find symbol
{ return newSym(sym.THEN);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:687: error: cannot find symbol
{ return newSym(sym.VAR);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:691: error: cannot find symbol
{ return newSym(sym.IDENT, yytext());
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:695: error: cannot find symbol
{ return newSym(sym.MINUS);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:699: error: cannot find symbol
{ return newSym(sym.SEMI);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:703: error: cannot find symbol
{ return newSym(sym.NOT_EQ);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:711: error: cannot find symbol
{ return newSym(sym.COMMA);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:715: error: cannot find symbol
{ return newSym(sym.IF);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:719: error: cannot find symbol
{ return newSym(sym.RT_PAREN);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:723: error: cannot find symbol
{ return newSym(sym.OR);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:727: error: cannot find symbol
{ return newSym(sym.EQ);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:731: error: cannot find symbol
{ return newSym(sym.RT_BRKT);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:735: error: cannot find symbol
{ return newSym(sym.DIVIDE);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:739: error: cannot find symbol
{ return newSym(sym.DOT);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:743: error: cannot find symbol
{ return newSym(sym.PROCEDURE);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:747: error: cannot find symbol
{ return newSym(sym.CHAR, new Character(yytext().charAt(1)));
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:751: error: cannot find symbol
{ return newSym(sym.LEFT_PAREN);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:755: error: cannot find symbol
{ return newSym(sym.BEGIN);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:759: error: cannot find symbol
{ return newSym(sym.END);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:763: error: cannot find symbol
{ return newSym(sym.GTR_EQ);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:767: error: cannot find symbol
{ return newSym(sym.PROGRAM);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:771: error: cannot find symbol
{ return newSym(sym.AND);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:775: error: cannot find symbol
{ return newSym(sym.ARRAY);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:779: error: cannot find symbol
{ return newSym(sym.LESS_EQ);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:783: error: cannot find symbol
{ return newSym(sym.OF);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:787: error: cannot find symbol
{ return newSym(sym.INT, new Integer(yytext()));
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:796: error: cannot find symbol
{ return newSym(sym.PLUS);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:800: error: cannot find symbol
{ return newSym(sym.LEFT_BRKT);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:804: error: cannot find symbol
{ return newSym(sym.LESS);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:813: error: cannot find symbol
{ return newSym(sym.TIMES);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:817: error: cannot find symbol
{ return newSym(sym.COLON);
^
symbol: variable sym
location: class PascalLexer
PascalLexer.java:824: error: cannot find symbol
{ return new java_cup.runtime.Symbol(sym.EOF); }
^
symbol: variable sym
location: class PascalLexer
37 errors