Leo Parser

Crates.io Authors License

This directory contains the code to tokenize, lex and parse Leo files to the Leo AST.

Tokenizer

The tokenizer contains all tokens in Leo. It also decides which tokens are keywords. Meaning that keywords are a subset of tokens. The lexer goes through character by character as bytes, and converts the bytes into the tokens.

Tokens

Bolded ones are also keywords.

Literals

Symbols

Types

Words

Meta

Parser

The parser converts the tokens to the Leo AST.

The parser is broken down to different files that correspond to different aspects of the AST:

Grammar Relation

All function and token names are as close as possible to the Leo Grammar