[][src]Crate earl_lang_syntax

A tokenizer and parser for the language Earl. The syntax of Earl resembles the syntax of Lisp or S-expressions. The main difference is that Earl does not define ordered pairs, i.e. (x . y), but only lists, e.g. the empty list (x y z). The design of multiline strings and nesting multiline comments is possibly unorthodox.

Structs

ParseNodeList

A parse node list is a list of parse nodes.

ParsingError

Error information returned to the user if there's a problem tokenizing or parsing the input.

Token

A token in Earl contains where it appears in the code and its type or ID.

Enums

ErrorCode

Error codes we might receive when tokenizing and parsing.

ParseNode

A parse node is either a token or a list of parse nodes.

SyntaxError

Any kind of error that can pop up while tokenizing and parsing.

TokenId

Token IDs or token types.

Functions

parse

Parses the code and returns a result of parse trees or a parsing error.

tokenize

Returns a tokenization result.