Expand description
Boa’s boa_ast
crate implements an ECMAScript abstract syntax tree.
Crate Overview
boa_ast
contains representations of Parse Nodes as defined by the ECMAScript
spec. Some Parse Node
s are not represented by Boa’s AST, because a lot of grammar productions
are only used to throw Early Errors, and don’t influence the evaluation of the AST
itself.
Boa’s AST is mainly split in three main components: Declaration
s, Expression
s and
Statement
s, with StatementList
being the primordial Parse Node that combines
all of them to create a proper AST.
About Boa
Boa is an open-source, experimental ECMAScript Engine written in Rust for lexing, parsing and executing ECMAScript/JavaScript. Currently, Boa supports some of the language. More information can be viewed at Boa’s website.
Try out the most recent release with Boa’s live demo playground.
Boa Crates
boa_ast
- Boa’s ECMAScript Abstract Syntax Tree.boa_engine
- Boa’s implementation of ECMAScript builtin objects and execution.boa_gc
- Boa’s garbage collector.boa_interner
- Boa’s string interner.boa_parser
- Boa’s lexer and parser.boa_profiler
- Boa’s code profiler.boa_icu_provider
- Boa’s ICU4X data provider.boa_runtime
- Boa’s WebAPI features.
Re-exports
pub use self::declaration::Declaration;
pub use self::expression::Expression;
pub use self::keyword::Keyword;
pub use self::statement::Statement;
Modules
- The
Declaration
Parse Node, as defined by the spec. - The
Expression
Parse Node, as defined by the spec. - Functions and classes nodes, as defined by the spec.
- The
Keyword
AST node, which represents reserved words of the ECMAScript language. - Module item list AST nodes.
- Definitions of various Syntax-Directed Operations used in the spec.
- A pattern binding or assignment node.
- position 🔒
- Property definition related types, used in object literals and class definitions.
- The
Punctuator
enum, which contains all punctuators used in ECMAScript. - source 🔒
- Statement list node.
- ECMAScript Abstract Syntax Tree visitors.
Macros
Try
-like conditional unwrapping ofControlFlow
.
Structs
- A Module source.
- Module item list AST node.
- A position in the ECMAScript source code.
- A Script source.
- A span in the ECMAScript source code.
- List of statements.
Enums
- Module item AST node.
- All of the punctuators used in ECMAScript.
- An item inside a
StatementList
Parse Node, as defined by the spec.
Traits
- Utility trait that adds a
UTF-16
escaped representation to every[u16]
.
Functions
- Displays the body of a block or statement list.
- Utility to join multiple Nodes into a single string.