waxeye-org / waxeye

Waxeye is a parser generator based on parsing expression grammars (PEGs). It supports C, Java, JavaScript, Python, Racket, and Ruby.
https://waxeye-org.github.io/waxeye/index.html
Other
235 stars 38 forks source link

Can the state machine be compiled directly into target language rather than to structures interpreted by the runtime? #100

Open KOLANICH opened 4 years ago

orlandohill commented 4 years ago

Yes. If I understand correctly, any language that can be interpreted can also be compiled, and vice versa. The simplest way would be to have the compiler traverse the state machine and output the same code that the interpreter uses.

It's something that I had in mind to do later, but only as an optimization once more important features were done.