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

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -