DEV Community

loading...

Discussion on: I'm building a programming language: Creating tokens

Collapse
bosley profile image
Bosley

Good post! When I was doing this a little while ago I considered using Logos but opted to use LALRPOP because I'm familiar with Flex/Bison. Its definitely worth a look imo.

Collapse
dblanovschi profile image
Dinu Blanovschi

You can use LALRPOP with an external (logos) lexer. Here is the chapter in the lalrpop book on external lexers and tl;dr you only need a type that implements Iterator<Item=Result<(Location, Token, Location), Error>> while the logos lexer gives you Iterator<Item=Token>.

Collapse
faraazahmad profile image
Syed Faraaz Ahmad Author

Yeah I looked at LALRPOP and it's fantastic as well. Although I wasn't too keen on learning how to use another big tool just yet, maybe in the future I will do it (for another language)

Collapse
bosley profile image
Bosley

If you do choose to use it in the future feel free to message me, I'd love to help.