swiftlet 0.1.5

swiftlet is a high-performance text-parsing library for Rust, inspired by Python’s Lark.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::lexer::Tokenizer;
use crate::ast::AST;
use crate::error::ParserError;
use crate::parser_frontends::ParserFrontend;
use std::sync::Arc;

pub mod clr;
pub mod earley;
mod utils;

/// Common interface implemented by concrete parser backends.
pub trait Parser {
    /// Returns parser frontend containing lexer and grammar configuration.
    fn get_parser_frontend(&self) -> Arc<ParserFrontend>;

    /// Parses token stream into AST.
    fn parse(&self, token: Tokenizer) -> Result<AST, ParserError>;
}