Skip to content

A tool that allows you to modify, edit, and recompile the AST script of Artemis engine.

Notifications You must be signed in to change notification settings

xmoezzz/artemis_ast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Artemis AST Script Processor

This utility offers a set of Rust functions to parse and manipulate Artemis AST-based scripts.

Features

  1. Tokenization: Converts raw script into a series of tokens.
  2. Parsing: Transforms tokens into a structured AST represented as a HashMap.
  3. AST Pruning: Removes unnecessary elements from the AST for a cleaner representation.
  4. Script Generation: Converts the modified AST back into its script form.
  5. Scenario Extraction and Replacement: Aids in replacing parts of the script based on your requirements.

Getting Started

Build

  1. Clone the Repository:

    git clone https://github.com/your_username/ast-script-processor.git
    cd ast-script-processor
  2. 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

  1. Parse the AST:

    let ast = parse_ast("path/to/script.txt").unwrap();
  2. Prune the AST:

    prune_ast(&mut ast);
  3. Convert the AST back to a script:

    let script = hashmap_to_script(&ast).unwrap();
  4. Extract and replace scenario:

    replace_secnario(&ast, vec!["11", "22"]).unwrap();

License

MIT

About

A tool that allows you to modify, edit, and recompile the AST script of Artemis engine.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published