Racc or Bison Equivalent in Crystal

Could anyone point me in the direct of a Crystal Racc equivalent. It is in the standard library in Ruby, but there doesn’t seem to be any LALR parsers for Crystal.

1 Like

Crystal parser write by Crystal itself, i guess there is no bison equivalent.

There is GitHub - keidax/tree-sitter-crystal under construction.

And I had a not yet released bindings for TreeSitter that could be useful with this, and other tree-sitter parsers as well.

But it’s possible to get the Crystal AST using the Crystal compiler code base, IIRC there’s an example in Crystal repo.

1 Like

They are asking for a parser generator equivalent for the one in Ruby’s standard library, not specifically a parser for the Crystal language.

1 Like

Yes, I’m looking for a parser generator like Ruby’s Racc.

Quite surprising one doesn’t exist already. I’d appreciate any recommendations :)

You could try pegasus.