Skip to content

Commit 2ee877f

Browse files
committed
consolidate LexInit.lean
1 parent a852f56 commit 2ee877f

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

Auto/Parser/LexInit.lean

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,14 @@ def specConst : ERE := .plus #[
7777
.attr string "string"
7878
]
7979

80-
def lexicons : ERE := .plus #[
80+
/-- The lexicon used by the SMT term parser. It is the disjoint union of
81+
the SMT-lib lexical categories that may appear in a term. The reserved
82+
words `forall`/`exists`/`lambda`/`let` and the special character `_`
83+
are recognized post-lex by the parser by inspecting the simple-symbol
84+
contents — they are not lexical categories. -/
85+
def lexicon : ERE := .plus #[
8186
specConst,
82-
-- For lexical analysis, do not distinguish between keyword and symbol
87+
-- For lexical analysis, do not distinguish reserved words
8388
symbol,
8489
.attr keyword "keyword",
8590
.attr lparen "(",
@@ -93,15 +98,15 @@ def lexicons : ERE := .plus #[
9398
9499
#eval specConst.toADFA
95100
96-
-- Good property: Each state have at most one attribute!
97-
#eval lexicons.toADFA
101+
-- Good property: Each state has at most one attribute!
102+
#eval lexicon.toADFA
98103
99104
-/
100105

101106
local instance : Hashable Char where
102107
hash c := hash c.val
103108

104-
initialize lexiconADFA : ADFA Char ← pure lexicons.toADFA
109+
initialize lexiconADFA : ADFA Char ← pure lexicon.toADFA
105110

106111
end SMT
107112

0 commit comments

Comments
 (0)