Skip to content

Ambiguities and how to handle them #612

Description

@rbartlensky

Hey!

While porting an early YACC grammar of Rust, I noticed an interesting edge case that I'm not entirely sure how to handle.

When parsing nested generic parameters, the "original" YACC grammar has a rule to parse a >> token, and emits code that puts back a > token into the lexer. It seems that this is how it works around ambiguities between >> as an operator and >> as generic parameter delimiters.

How should I approach such cases in grmtools? I am aware you can call lexer methods in action blocks, but currently the lexer trait has a limited API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions