Skip to content

Any method to integrate a customized lexer in your library? #261

Closed
@asmwarrior

Description

@asmwarrior

Hi, as we know, the PEG grammar is text(character) based, which means we write lexer and parser grammar together.
But in my application, I have my own lexer(mainly the C-preprocessor) implemented myself, so my question is: can the library support parsing rules for custom lexer.

For example, the lexer has some kinds of std::vector<Token> supplied, the Token class may have definition like:

class Token
{
    TokenKind kind;
    std::string lexeme;
}

Any idea or suggestions?
I mean it could be a generalized peg grammar?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions