#syntax-tree #ast #sap #ast-node #statement #programming #interpreter

sap-ast

The abstractact syntax tree crate for the SAP programming language

2 stable releases

1.0.1 Mar 19, 2024
1.0.0 Mar 5, 2024

#2380 in Parser implementations


Used in 3 crates

MIT/Apache

64KB
1.5K SLoC

Abstract Syntax Tree (AST) Module

The AST module contains the definitions for the abstract syntax tree (AST) nodes generated by the parser. The AST nodes are used to represent the structure of the source code in a tree-like format, which can be used to perform various analysis and evaluation tasks on the code.

The AST nodes are defined as Rust structs, and are serialisable to JSON using the serde library. This allows the AST to be easily converted to a JSON string for debugging and analysis purposes.

The AST module is divided into sub-modules, each of which contains the definitions for a specific type of AST node, such as expressions, statements, and literals.

The AST module also contains a Program struct, which is the root node for all syntax trees generated by the parser. The Program struct contains a list of statements, which represent the top-level statements in the source code.

Dependencies

~0.7–1.5MB
~34K SLoC