Scala parser combinators vs ANTLR/Java generated parser?

后端 未结 5 1121
自闭症患者
自闭症患者 2020-12-28 15:29

I am writing an expression parser for an app written mostly in Scala. I have built AST objects in Scala, and now need to write the parser. I have heard of Scala\'s built-in

5条回答
  •  长情又很酷
    2020-12-28 16:28

    I wouldn't worry about the performance limitations of parser combinators unless you were planning on parsing algebraic expressions that are a few pages long. The Programming Scala book does mention that a more efficient implementation of parser combinators is feasible. Maybe somebody will find the time and energy to write one.

    I think with ANTLR you are talking about two extra build steps: ANTLR compiles to Java, and you need to compile both Scala and Java to bytecode, instead of just Scala.

提交回复
热议问题