[svlug] Lex question about variable length fields

Bob Smith bsmith at linuxtoys.org
Thu May 22 15:33:25 PDT 2014


Ivan Sergio Borgonovo wrote:
> It'd be clearer if you could make an actual example and the expected
> result (parser tree)

Jesse, Ivan, thanks for your replies.  Yeah, my original post
was pretty vague.  Let me try again.


I would like to get three single word tokens followed by a fourth
token that is whatever is left on the input line.  So, the input
line "My name is Jabba the Hutt" would return tokens
"My",
"name",
"is", and
"Jabba the Hutt".

The last token looks like several words and when I write the lex
rules to pick up more than one word, it picks up the whole line.

thanks
Bob Smith










More information about the svlug mailing list