Skip to content

Problem about associativity  #2

@xxchan

Description

@xxchan

I think the following grammar will produce a right-leaning syntax tree.

EXPR  = START, END
START = GROUP | LIT
END   = "-", EXPR | NOTHING

e.g., in your example in Main, 1-1-1-1 is parsed into Success (Sub (Lit 1) (Sub (Lit 1) (Sub (Lit 1) (Lit 1)))), but it should be Success (Sub (Sub (Sub (Lit 1) (Lit 1)) (Lit 1)) (Lit 1))

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