LALR (1) parser generator for scala

I know that it is possible to use, for example, Java files created in a bison in a scala project, but is there any kind of full-scale "grammar for scala" LALR (1) generators?

+4
source share
2 answers

I am not answering the original question and please excuse it, but you may be interested in our sbt-rats plugin for the sbt tool . He uses Rats! parser generator for Java, but simplifies its use from Scala.

Rats! uses grammars parsing as a syntax description formalism rather than context-free grammars and definitely not LALR (1) grammars. sbt-rats also has a high-level syntax definition language, which in most cases means that you don't need to write semantic actions to get a syntax tree that represents your input. The plugin will additionally generate case classes for representing the tree and a pretty-printer for the tree structure.

0
source

Another plugin here: ScalaBison is close to LALR (1) and allows you to use Scala in actions.

0
source

Source: https://habr.com/ru/post/1432719/


All Articles