Skip to content

Refer to specific grammar rule #386

@barsdeveloper

Description

@barsdeveloper

Is it possible to have one single grammar and decide to parse a specific text using one rule of this grammar which is not the main one?

Let's say I have the following, very simple grammar, boolean is my start rule.

false = "false" { return false; }
true  = "true"  { return true; }
boolean = true / false

But sometimes I would like to access in the generated file, no only boolean but maybe I just need to parse false or true, is that possible? I mean to export them separately through cli.

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocks-releaseBlocks an imminent release. High Priorty.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions