Parser, Generator for Java with the following requirements

后端 未结 7 1669
天命终不由人
天命终不由人 2020-12-09 23:25

I am looking for a parser generator for Java that does the following: My language project is pretty simple and only contains a small set of tokens.

Output in pure R

相关标签:
7条回答
  • 2020-12-10 00:19

    Take a look at SableCC. Sablecc is an easy to use parser generator that accepts the grammar of your language as EBNF, without intermingling action code, and generates a Java parser that produces a syntax tree which can be traversed using a tree node visitor. SableCC is powerful, yet much simpler to use than ANTLR, JavaCC, yacc, etc. It also does not require a separate lexer. Constructing your language processor amounts to extending a visitor class generated from your grammar, and to overriding its methods which are called upon when a syntactic construct is encountered by the parser. For every grammar rule XYZ, the visitor will have a method inAXYZ(Node xyz)....outAXYZ(Node xyz) called upon when the parser matches the rule.

    0 讨论(0)
提交回复
热议问题