warburec / GenCompilation

A project providing an easy-to-use and extensible framework for creating and prototyping languages and grammars.
https://warburec.github.io/GenCompilation/
GNU General Public License v3.0
3 stars 2 forks source link

Allow different Token/NonTerminal types to be associated with lexical elements using BNFConvertor #36

Open warburec opened 1 month ago

warburec commented 1 month ago

e.g. For the grammar:

n:statement\\ list -> n:statement
n:statement\\ list -> n:statement\\ list n:statement
n:statement -> identifier = n:element + n:element ;
n:element -> identifier
n:element -> number

Associate "identifier" with the Identifier class, and "number" with the Literal class.