From 912eaf40d4efd29b7e3489d51c55b8b79206df79 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Tue, 5 Mar 2019 11:42:17 +0100 Subject: [parsing] Split Tok.t into Tok.t and Tok.pattern Tokens were having a double role: - the output of the lexer - the items of grammar entries, especially terminals Now tokens are the output of the lexer, and this paves the way for using a richer data type, eg including Loc.t Patterns, as in Plexing.pattern, only represent patterns (for tokens) and now have a bit more structure (eg the wildcard is represented as None, not as "", while a regular pattern for "x" as Some "x") --- gramlib/plexing.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gramlib/plexing.mli') diff --git a/gramlib/plexing.mli b/gramlib/plexing.mli index f6e4d96b80..48722e01be 100644 --- a/gramlib/plexing.mli +++ b/gramlib/plexing.mli @@ -8,7 +8,7 @@ grammars (see module [Grammar]). It also provides some useful functions to create lexers. *) -type pattern = string * string +type pattern = string * string option (* Type for values used by the generated code of the EXTEND statement to represent terminals in entry rules. - The first string is the constructor name (must start with -- cgit v1.2.3 From f832476404a29d7791c1a6d7970988d3b2e3ad9e Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Mon, 18 Mar 2019 15:17:55 +0100 Subject: documentation --- gramlib/plexing.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gramlib/plexing.mli') diff --git a/gramlib/plexing.mli b/gramlib/plexing.mli index 48722e01be..26443df026 100644 --- a/gramlib/plexing.mli +++ b/gramlib/plexing.mli @@ -14,7 +14,7 @@ type pattern = string * string option - The first string is the constructor name (must start with an uppercase character). When it is empty, the second string is supposed to be a keyword. -- The second string is the constructor parameter. Empty if it +- The second component is the constructor parameter. None if it has no parameter (corresponding to the 'wildcard' pattern). - The way tokens patterns are interpreted to parse tokens is done by the lexer, function [tok_match] below. *) -- cgit v1.2.3