Hi,

I'm trying to understand how works Lemon error recovery, but it does not
seems to work as specified in the documentation (if I understand it
correctly).

You can check this repository for an minimal showcase of my issue :
https://github.com/arcanis/lemon.error-recovery

As you can see in test.cc, I feed the grammar (test.lm) with : If, Expr,
If, Expr, Ok, Else, Ok

Firstly, I would expect that the right-association-rule accepts the input as

- if
    - if
        - ok
    - ok

since using %left instead of %right gives me

- if
    - if
        - ok
        - ok

But it does not. Instead, it calls syntax error then (and that's the
weirdest) accepts an incomplete input, dropping the remaining input tokens :

- if
    - ok

The parse_failure directive is never called, even if there is no 'error'
non-terminal in my grammar.

I'm fairly new with this kind of parser, so please forgive me if I said
something horrible, but is it normal ? Is there something that I have
missed ?

Thanks,

-- 
Maël Nison
JS Github hipster, Assistant C++ chez Epitech
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to