Artemis AST Script Processor
This utility offers a set of Rust functions to parse and manipulate Artemis AST-based scripts.
Features
- Tokenization: Converts raw script into a series of tokens.
- Parsing: Transforms tokens into a structured AST represented as a HashMap.
- AST Pruning: Removes unnecessary elements from the AST for a cleaner representation.
- Script Generation: Converts the modified AST back into its script form.
- Scenario Extraction and Replacement: Aids in replacing parts of the script based on your requirements.
Getting Started
Build
-
Clone the Repository:
git clone https://github.com/your_username/ast-script-processor.git cd ast-script-processor
-
Build the Project:
With Rust installed, building is as simple as:
cargo build --release
This will create an optimized executable in the
target/release
directory.
Usage
-
Parse the AST:
let ast = parse_ast("path/to/script.txt").unwrap();
-
Prune the AST:
prune_ast(&mut ast);
-
Convert the AST back to a script:
let script = hashmap_to_script(&ast).unwrap();
-
Extract and replace scenario:
replace_secnario(&ast, vec!["11", "22"]).unwrap();