timtadh / lexmachine

Lex machinary for go.
Other
405 stars 28 forks source link

Generate lexers for programs in various languages from the DFA #32

Open timtadh opened 5 years ago

timtadh commented 5 years ago

This is an experimental PR which contains support for generating lexers for programming languages directly from a DFA specification. It does not use the same API as the rest of lexmachine.

For a first proof of concept I wrote a super simple generator for Python. The code it produces is probably not optimal for python.

This branch may or may not every be merged. Chime in if you have a good use case or language you want support for (including Go).