如何在lex文件中表示字符串?
我尝试了以下内容:
{NUM}* {ID}* { return new Symbol(sym.STR);}
但收到错误:
Description: + ? or * must follow an expression or subexpression.
也尝试过:
{ {NUM}* | {ID}* }+ { return new Symbol(sym.STR);}
,错误是:说明:Macro does not exist
。
但宏已被定义为:
enter code here
%%
%cup
%line
NUM = [0-9]
ID = [a-zA-Z]
WhiteSpace = [ \t\r\n\f]
%%