Skip to content

Adding "%fallback" directive ? #13

@mingodad

Description

@mingodad

On this commit I've added an experimental "%fallback" directive similar to the one used by the lemon parser generator https://sqlite.org/src/doc/trunk/doc/lemon.html#pfallback , for some grammars there is a huge performance gain when building the parser:

/usr/bin/time ./parsertl-playground "postgres16-fallback.g" test.sql
Parser user grammar success: 1
Warning: Token "UMINUS" does not have a lexer definiton.
Parser input success: 1
0.24user 0.02system 0:00.27elapsed 100%CPU (0avgtext+0avgdata 40696maxresident)k
0inputs+0outputs (0major+13932minor)pagefaults 0swaps

/usr/bin/time ./parsertl-playground "postgres16.g" test.sql
Parser user grammar success: 1
Warning: Token "UMINUS" does not have a lexer definiton.
Parser input success: 1
0.74user 0.03system 0:00.77elapsed 99%CPU (0avgtext+0avgdata 100900maxresident)k
0inputs+0outputs (0major+33640minor)pagefaults 0swaps

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions