Module cst

Source
Expand description

§CST

This module contains parser for transforming a stream of asciimath tokens into a Concrete Syntax Tree.

§Asciimath grammar

This grammar has been taken from the asciimath website.

E ::= IE | I/I Expression I ::= S_S | S^S | S_S^S | S Intermediate expression S ::= v | lEr | uS | bSS Simple expression v ::= [A-Za-z] | greek letters | numbers | other constant symbols u ::= sqrt | text | bb | other unary symbols for font commands b ::= frac | root | stackrel | other binary symbols l ::= ( | [ | { | (: | {: | other left brackets r ::= ) | ] | } | :) | :} | other right brackets

There are two challanges for parsing this particular grammar. For one this grammar is ambigious and second it is non deterministic. I am gonna try a few different techniques to solve those problems. So the is eventually going to be a parser that parses a modified version of the grammar and one that uses lookahead to solve this.

In both cases I want to circumvent back tracking entirely.

Modules§

predictive
Predictive

Structs§

Cursor

Type Aliases§

TokenStream