# antlr-rust-rs-parser

A Rust language parser generated by
[`antlr-rust-codegen`](https://crates.io/crates/antlr-rust-codegen) itself and
wrapped in a thin syntax-analysis facade. The crate dogfoods the generator for
its checked-in lexer and parser, validates each completed parse, and builds its
identifier-role and scope indexes through the generated typed listener.

## Usage

Add the parser with `cargo add antlr-rust-rs-parser`, then analyze a Rust source
fragment:

```rust
use antlr_rust_rs_parser::analyze;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let source = "let values: Vec<u8> = Vec::new();";
    let syntax = analyze(source)?;
    let type_name = source.find("Vec").expect("Vec type");

    assert!(syntax.is_type_identifier(type_name));
    Ok(())
}
```

The facade provides role and scope analysis rather than a general-purpose Rust AST.
`analyze_member_item` applies the same analysis with member-item binding
semantics, and `struct_has_value_constructor` provides the common
struct-classification query directly.
