Module parse

Source
Expand description

Parsing assembly source code into an AST.

This module is used to convert strings (which represent assembly source code) into abstract syntax trees that maintain all of the information of the source code in an easier to handle format.

The main function to use from this module is parse_ast, which parses an assembly code program into an AST.

However, if needed, the internals of this module are also available:

  • lex: the implementation of the lexer/tokenizer
  • Parser: the main logic for the parser
  • Parse: the implementation to “parse” an AST component

Modules§

lex
Tokenizing LC-3 assembly.
simple
Simple to parse components.

Structs§

ParseErr
Any error that occurs during parsing tokens.
Parser
The main parser struct, which holds the main logic for the parser.

Traits§

Parse
Components that can be constructed from a sequence of tokens.

Functions§

parse_ast
Parses an assembly source code string into a Vec of statements.