conch-parser

Crates.io Documentation Build Status Build Status Coverage

A Rust library for parsing Unix shell commands.

Quick Start

First, add this to your Cargo.toml:

toml [dependencies] conch-parser = "0.1.0"

Next, you can get started with:

```rust extern crate conch_parser;

use conchparser::lexer::Lexer; use conchparser::parse::DefaultParser;

fn main() { // Initialize our token lexer and shell parser with the program's input let lex = Lexer::new("echo foo bar".chars()); let parser = DefaultParser::new(lex);

// Parse our input!
for t in parser {
    println!("{:?}", t);
}

} ```

About

This library offers parsing shell commands as defined by the POSIX.1-2008 standard. The parser remains agnostic to the final AST representation by passing intermediate results to an AST Builder, allowing for easy changes to the final AST structure without having to walk and transform an entire AST produced by the parser. See the documentation for more information.

Goals

Non-goals

Supported grammar

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.