How to recognize string in Lex file -
hi appropriate recognize string in lex.
i have tried
enter code here import java_cup.runtime.*; %% %cup %line num = [0-9] id = [a-za-z] pun= [:=;#@$^~] whitespace = [ \t\r\n\f] sdquo = [\"] %% ({sdquo}+) ({id}|{num})* ({sdquo}+) { return new symbol(sym.str, new string(yytext()));}
but macro fail recognized. error message kept getting is: processing first section -- user code. processing second section -- jlex declarations. processing third section -- lexical rules. creating nfa machine representation. error: parse error @ line 39. description: missing brace @ start of lexical action. parse error.
loose =
signs in definitions of num
etc. , don't place them between %%
. instead place last rule between %%
.
Comments
Post a Comment