Skip to content

Generating the grammar #89

@vwkd

Description

@vwkd

When parsing a complex language it becomes increasingly hard to keep track how everything fits together in the implementation code. It becomes increasingly helpful to look at the grammar of the language without the code. Also for a large enough project it becomes more tedious to write the grammar manually and keep it in sync for every change in the code. It pays of to have the code as single source of truth that the grammar is generated from. For similar reasons, it’s coming to generate a GraphQL schema from the code of a GraphQL server. For example, GraphQL.js has a printSchema function to generate the schema from the code.

Can arcsecond generate the grammar for a language?

I’m assuming arcsecond should have all the information needed to generate the grammar encoded somewhere in its runtime. Though I can imagine for a context-dependent language generating the grammar could pose a challenge simply because I‘m not sure any grammar exists that can express all possibilities. But at least for a context-free language it should be possible using any common grammar like McKeeman Form or (E)BNF.

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