I believe these changes will make the grammar easier to maintain. If this commit accepted, I can provide more changes to simplify it further. Unfortunately this big change cannot be broken into pieces: type-checking in Bison is all or nothing, I can't be incremental.
Currently "typing" is done by hand in the actions:
namespace
: %empty
{ $$.string = new std::string(""); }
| kCOLON2 tNAMESPACE
{ $$.string = new std::string(*$1.string + *$2.string); }
This can be simplified using %type.
namespace
: %empty
{ $$ = new std::string(""); }
| kCOLON2 tNAMESPACE
{ $$ = new std::string(*$1 + *$2); }
Besides, it will help migrating to Bison variants to use genuine
objects, instead of pointers to object:
Hi!
I believe these changes will make the grammar easier to maintain. If this commit accepted, I can provide more changes to simplify it further. Unfortunately this big change cannot be broken into pieces: type-checking in Bison is all or nothing, I can't be incremental.
Currently "typing" is done by hand in the actions:
This can be simplified using %type.
Besides, it will help migrating to Bison variants to use genuine objects, instead of pointers to object: