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

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -