Menu

#3 parser doesnt reset after a quote is left unfinished

open
Parser (1)
5
2003-09-05
2003-09-04
Anonymous
No

If you have code like this:

NEWMODULE "rollout.bat;
PURECODE <rollout.bat>

The parser will raise an error about the trailing quote
being left off. This is the correct, and it should do
that. However, after it parses this error once, it
fails to parse all other *valid* templates. I'm
assuming this is because the parser is not reset, and
it's still looking for a closing quote. If I get time,
I'll look into the code to see if I can find a quick fix.

Discussion

  • Jorgen Bodde

    Jorgen Bodde - 2003-09-05

    Logged In: YES
    user_id=674828

    Hello,

    I will look into this. I probably forgot to return to the previous
    state on a missing quote. The lexer stays in that state. The
    problem with the lexer solution is that it is not initialised
    properly the second time. I don't know how to tell it that the
    yy_states still on the stack need to be cleared upon next
    parsing. So it stays in the string state and bison receives the
    wrong tokens that way.

    This is also encountered when you do something like;

    IF @#<dsdfsdfsd@#> which is wrong. The parser enters the
    state for a template replace item, and never escapes giving
    the same problem that bison receives the wrong tokens.

    If you know of a way to reset the states of flex before
    parsing I would be helped a lot. Right now I see two solutions;

    - Switching to GoldParser and rewrite some code
    - Using the class version of flex (yyFlexLexer)

    The work around is restarting wxCRP I'm afraid. But this issue
    is looked into ..

    Best regards,
    - Jorgen

     
  • Jorgen Bodde

    Jorgen Bodde - 2003-09-05
    • assigned_to: nobody --> jorgb
     

Log in to post a comment.

MongoDB Logo MongoDB