[erlang-questions] leex and yecc spotting double newline

Robert Virding rvirding@REDACTED
Thu Mar 26 18:03:20 CET 2009


Hello again,

I have done a quick test and the suggestion I made seems to work. It does
however demand that even the final request end with a double newline. I have
some comments and questions:

- Do you really want to keep the whitespace tokens in your output? (in
words)

- If you want to get all the tokens until the end of file you can do
    io:request(InFile, {get_until, prompt, postfix_policy_lexer,tokens,
[1]})

- Yecc is very picky and demands that you give it all the tokens it needs
and only the tokens it needs, so you would probably have to add a rule

requests -> request : ['$1'].
requests -> requests request : '$1' ++ ['$2'].

Hope this helps. Get back to me if it doesn't or you have more questions.

Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090326/df7708a5/attachment.htm>


More information about the erlang-questions mailing list