Skip to content

Tutorial lesson 1.4 doesn't mention maximal-munch lexing #3539

@Baltoli

Description

@Baltoli

The exercise in question asks the user to identify why this grammar isn't ambiguous for the input abb:

module EXERCISE4
  syntax Expr ::= "a" Expr "b"
                | "abb"
                | "b"
endmodule

For experienced K users, the answer is clearly that the lexer tokenises abb before the parser is ever called, but I don't see where we explain longest-match lexing in the tutorial. We should add a short section explaining this when we introduce lexing and parsing.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions