3 ms·
I used Antlr v3 to create a NLP parser for calendar events for iOS and Android. It took longer than expected. iOS + C runtime was opaque, so had to write a tool
by musesum 10y ago
I used Antlr v3 to create a NLP parser for calendar events for iOS and Android. It took longer than expected. iOS + C runtime was opaque, so had to write a tool for debugging. Android + Java runtime overran memory, so had to break into separate grammars. Of course, NLP is not a natural fit. Don't know what problems are fixed by v4.
> The most obvious is the lack of recursion: you can’t find a (regular) expression inside another one ...
PCRE has some recursion. Here is an example for parsing anything between { }, with counting of inner brackets:
'(?>\{(?:[^{}]|(?R))\})|\w+'
A C++11 constexpr can make hand coded parsers a lot more readible, allowing token names in case statements. For example , search on "str2int" in the following island parser: https://github.com/musesum/par https://github.com/musesum/par