4 ms·
There is nothing special about the parsing algorithm. It is currently a naive LL(1) (single token lookahead) Parser. I may try to upgrade it to LL(*) in the fut
by bd82 11y ago
There is nothing special about the parsing algorithm.
It is currently a naive LL(1) (single token lookahead) Parser.
I may try to upgrade it to LL(*) in the future.
However that does not mean Chevrotain it limited to LL(1) grammars.
You can explicitly implement the lookahead function in any point the grammar.
So if you are trying to parse a well designed grammar like Python
who explicitly declare that being LL(1) is a blessing not a curse.
https://www.python.org/dev/peps/pep-3099/#core-language https://www.python.org/dev/peps/pep-3099/#core-language
You won't have any issues.
If you are trying to parse a language that is nearly always LL(1)
You also won't have many issues as you can define your own custom lookahead.
Example: https://github.com/SAP/chevrotain/blob/master/examples/custom_lookahead/large_lookahead.js https://github.com/SAP/chevrotain/blob/master/examples/custo...
If you are trying to parse a language that is nearly always NOT LL(1)
You may want to use a different tool to parse it(at this point in time).