Skip to content

Instantly share code, notes, and snippets.

View lancearlaus's full-sized avatar

Lance Arlaus lancearlaus

View GitHub Profile
@kiritsuku
kiritsuku / ExprParsers.scala
Created May 7, 2013 00:35
simple math expression parser combinator in Scala
import scala.util.parsing.combinator.JavaTokenParsers
object Test extends App with ExprParsers2 {
println(eval(parseAll(expr, "1+1-2*3").get))
}
trait ExprParsers1 extends JavaTokenParsers {