Logicalshift / TameParse

LALR parser with context-sensitive extensions
MIT License
21 stars 2 forks source link

Use a prefix 'yy_' instead of a list of keywords to prevent name clash #4

Closed mingodad closed 1 year ago

mingodad commented 1 year ago

The main change is here https://github.com/Logicalshift/TameParse/pull/4/files#diff-20682baf71074ef58450a1ef3acc3b922fad0d0a1e6e56e4f305719b97be22a3 everything else is fixing names with yy_.

Logicalshift commented 1 year ago

Sorry for the long delay: not sure where the start of this year has disappeared to. March and April seem to have evaporated for me.

I do remember that I originally tried to do this deliberately, with the idea of using a C++ namespace instead of adding a prefix to everything. Idea was to make it easier to use the data structures generated by the parser in more of the application.

I don't think it worked out in the end: it's still necessary to rename keywords which is both a bit fragile and can make it hard to predict what a particular token will be called later on, so I think this is an improvement on the existing code.