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 Nodes 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: Declarations, Expressions and
Statements, 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_cli- Boa’s CLI && REPL implementationboa_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_icu_provider- Boa’s ICU4X data provider.boa_interner- Boa’s string interner.boa_macros- Boa’s macros.boa_parser- Boa’s lexer and parser.boa_runtime- Boa’sWebAPIfeatures.boa_string- Boa’s ECMAScript string implementation.tag_ptr- Utility library that enables a pointer to be associated with a tag of typeusize.small_btree- Utility library that adds theSmallBTreeMapdata structure.
Re-exports§
pub use self::declaration::Declaration;pub use self::expression::Expression;pub use self::keyword::Keyword;pub use self::statement::Statement;
Modules§
- declaration
- The
DeclarationParse Node, as defined by the spec. - expression
- The
ExpressionParse Node, as defined by the spec. - function
- This module contains Function and Class AST nodes.
- keyword
- The
KeywordAST node, which represents reserved words of the ECMAScript language. - operations
- Definitions of various Syntax-Directed Operations used in the spec.
- pattern
- A pattern binding or assignment node.
- property
- Property definition related types, used in object literals and class definitions.
- scope
- This module implements the binding scope for various AST nodes.
- scope_
analyzer - This module implements the scope analysis for the AST.
- statement
- The
StatementParse Node, as defined by the spec. - visitor
- ECMAScript Abstract Syntax Tree visitors.
Structs§
- Linear
Position - Linear position in the ECMAScript source code.
- Linear
Span - A linear span in the ECMAScript source code.
- Linear
Span Ignore Eq - Stores a
LinearSpanbutPartialEq,Eqalways return true. - Module
- A Module source.
- Module
Item List - Module item list AST node.
- Position
- A position in the ECMAScript source code.
- Position
Group - A position group of
LinearPositionandPositionrelated to the same position in the ECMAScript source code. - Script
- A Script source.
- Source
Text - Source text.
- Span
- A span in the ECMAScript source code.
- Statement
List - List of statements.
Enums§
- Module
Item - Module item AST node.
- Punctuator
- All of the punctuators used in ECMAScript.
- Statement
List Item - An item inside a
StatementListParse Node, as defined by the spec.
Traits§
- Spanned
- An element of the AST or any type that can be located in the source with a Span.