Lexers and parsers in nim

community
Avatar
ErikCampobadal
Jan 2015

Hey! I'm willing to create a programming language using nim.

It's an educational project. Been reading about compilers for weeks now and I started using tools like flex and bison for lexer and parser. I know nim have a parsing library but nowhere near that level.

There is an old post (2014) with a similar question so I'm bringing that back a few years later. Is there anything anyone know that could speed up the process of developing a programing language using nim? (I can have c code if needed ofc)

Avatar
twetzel59
Jan 2015

Wow, I was just reading about the compilation pipeline today!

I suppose you could use at least the lexing part from a generator like flex, not so sure about using AST generators easily (it's possible).

Is your language complicated enough to warrant a parser generator or could you just use a custom parser?

3 years later
Avatar
dom96
32m

Let us test this new design a bit, shall we?

proc hello(x: int) =
  echo("Hello ", x)

42.hello()
Output
Hello 42

The greatest function ever written is hello.

Designing websites is often a pain.

Multi-level baby!

True that.

I also want to be able to support more detailed quoting:

Avatar
Araq:
Unix is a cancer.

We also want to be able to highlight user mentions:

Please let @Araq know that this forum is awesome.

Replying to "Lexers and parsers in nim"