Skip to content

Latest commit

 

History

History
79 lines (53 loc) · 1.99 KB

README.md

File metadata and controls

79 lines (53 loc) · 1.99 KB

GOLD Parser Engine in RUST

This crate provides an engine that can read a compiled Enhanced Grammar Table created with the GOLD Parsing System and generate a skeleton parser in rust for your custom language.

use goldparser-rs {
    engine::Builder,
    parser::{GOLDParser},
    vm::RuleHandler,
}

fn main() {
    let parser = Builder::from("mylang.egt");
    parser.load_source("test.src");
    if let Ok(ast) = parser.parse() {
        println!("{}",ast);
    } else {
        println!("Problems parsing");
    }

}

For more information on how it works, see the documentation or the Wiki.

Contents:

  1. How To...
    1. Include in your project
    2. Use
  2. Binaries
    1. Cargo Install
    2. Github

How To...

Include in your project

You can install the crate for use by including this in your Cargo.toml:

    [dependencies]
    goldparser-rs = "0.1"

Use

......

Binaries

egtutil is a binary in the \bin directory for basic operations on compiled Enhanced Grammar Tables and serves as a working example of implementing the parsers from this crate. The interactive feature implements a REPL-like environment to walk through the AST of your parsed source code.

Cargo Install

Install the goldparser-rs crate to get the egtutil binary.

cargo install goldparser-rs

Github

Alternatively, you can grab it on github and make it yourself.

git clone https://github.com/droidengineer/goldparser-rs.git
cd goldparser-rs
cargo build