3 ms·
That parser is something: https://github.com/scross99/locic/blob/master/lib/Parser/Parser.y https://github.com/scross99/locic/blob/master/lib/Parser/Par...
by millstone 12y ago
That parser is something: https://github.com/scross99/locic/blob/master/lib/Parser/Parser.y https://github.com/scross99/locic/blob/master/lib/Parser/Par...
- 72deluxe 12y agoIt really is! I wonder why they didn't specify the namespaces they were using instead of littering it with namespace and scope operators?
- scross 12y agoThe intention is to avoid any kind of name clashes; I don't think this really inhibits readability.
- pjc50 12y agoThat looks fairly clean for a Yacc parser. I do wish there was a more modern, friendlier parser-generator; yacc C++ tends to leak AST objects on error unless you use a pool allocator.
- scross 12y agoYep, it's not the most attractive parser ever. I chose to use Bison in order to save a lot of time/work and to take advantage of its GLR implementation; unfortunately its interaction with C++ isn't pleasant (due to the use of a union type for the symbol values).