Javascript must be enabled in your browser to view this demo.
Language Description
Parsing:
File <- (expression / _+)* !. FunctionCall <- "(" _* name _* (expression _* (expression _*)*)? ")" expression <- FunctionCall / Variable / Number / Text / "(" _* expression _* ")" Variable <- name Number <- [0-9]+ Text <- '"' {('\"' / '\\' / [^"])*} '"' name <- {[a-zA-Z]+} _ <- [ \n\t]
Text to Parse
(print "The golden ratio is:" (divide (add (sqrt 5) 1) 2)) (print "A random number:" (random))
|⬅
⬅
Run
➡
➡|
Parse Tree