[svlug] Lex question about variable length fields

Bob Smith bsmith at linuxtoys.org
Wed May 21 12:12:01 PDT 2014


Anyone here remember Lex?

I'm writing a parser in which the end of line can
have a random ASCII string with spaces, tabs, and
commas.  What I want is a grammar something like:

command:
   WORD WORD WORD WORDS_TO_EOL
   ;

If I build a lex rule to capture the variable
length string it gobbles the whole input line.

Any suggestions?

thanks
Bob




More information about the svlug mailing list