Railroad diagrams

This is a demonstration of nearley-railroad, which visualizes nearley grammars as railroad diagrams. The grammar used is below. You can play with it in action over here.



main


_ AS _

P


"(" _ AS _ ")" N

E


P _ "^" _ E P

MD


MD _ "*" _ E MD _ "/" _ E E

AS


AS _ "+" _ MD AS _ "-" _ MD MD

N


float "sin" _ P "cos" _ P "tan" _ P "asin" _ P "acos" _ P "atan" _ P "pi" "e" "sqrt" _ P "ln" _ P

float


int "." int int

int


/[0-9]/

_


/[\s]/