+
Skip to content

Parser improvement #7

@tomakado

Description

@tomakado

I favor a contract-first development approach for DumbQL. The query language grammar defines the parser, generated using the Pigeon tool. However, the generated parser code lacks readability and control. Therefore, I propose two alternative solutions to improve this aspect:

First, we could develop our own Parsing Expression Grammar (PEG) parser generator. This would give us complete control over the generated code's structure and functionality. A PEG parser is a type of parser that uses a recursive descent approach, allowing for a more concise and efficient parser compared to other methods like LL or LR parsers. This allows for significant flexibility in design and allows for optimizations that would not be available using the existing generated code.

Second, as a more hands-on approach, we could write a lexer and parser manually. This provides even finer control over the parsing process, but at the cost of flexibility and increased development time. A lexer (or lexical analyzer) breaks down the input text into a stream of tokens, representing individual words or symbols. The parser then uses these tokens to build a parse tree which can then be used to analyze and evaluate the DumbQL queries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载