/spectrum

spectrum parser

Primary LanguageJavaScript

spectrum parser

#spectrum parser

This is an experimental parser created as a learning exercise.

A parser for expressions based languages with an html visualization: View it in action at: (code is editable. Press button to parse it.) xzzulz.github.com/spectrum
(the visualization in the link may be slightly out of date, respect to the master branch)

MIT license.

Simple expressions grammar

A simple expressions grammar is a grammar defined in identities and operators. Expressions are constructed based on identities and operator rules. A single identity is a valid expression. Operators are combinators element, that can form valid expressions by combining with identities:

  • identities: symbols that are valid expression by itself.

  • operators: symbols that combines with identities or expressions to form valid expressions.