Skip to content

RUST Parser Engine for GOLD Parser. Read compiled grammar tables and source, DFA tokenizer, LALR parser.

Notifications You must be signed in to change notification settings

droidengineer/goldparser-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

RUST Parser Engine for GOLD Parser. Read compiled grammar tables and source, DFA tokenizer, LALR parser.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages