author | wenzelm |
Tue, 30 Jan 2018 11:48:38 +0100 | |
changeset 67532 | 71b36ff8f94d |
parent 67522 | 9e712280cc37 |
child 67539 | 1b8aad1909b7 |
permissions | -rw-r--r-- |
18 | 1 |
(* Title: Pure/Syntax/lexicon.ML |
2 |
Author: Tobias Nipkow and Markus Wenzel, TU Muenchen |
|
0 | 3 |
|
4703 | 4 |
Lexer for the inner Isabelle syntax (terms and types). |
18 | 5 |
*) |
0 | 6 |
|
42290
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
7 |
signature LEXICON = |
4247
9bba9251bb4d
added implode_xstr: string list -> string, explode_xstr: string -> string list;
wenzelm
parents:
3828
diff
changeset
|
8 |
sig |
42476 | 9 |
structure Syntax: |
10 |
sig |
|
11 |
val const: string -> term |
|
12 |
val free: string -> term |
|
13 |
val var: indexname -> term |
|
14 |
end |
|
67426 | 15 |
val scan_id: Symbol_Pos.T list scanner |
16 |
val scan_longid: Symbol_Pos.T list scanner |
|
17 |
val scan_tid: Symbol_Pos.T list scanner |
|
18 |
val scan_hex: Symbol_Pos.T list scanner |
|
19 |
val scan_bin: Symbol_Pos.T list scanner |
|
20 |
val scan_var: Symbol_Pos.T list scanner |
|
21 |
val scan_tvar: Symbol_Pos.T list scanner |
|
50239 | 22 |
val is_tid: string -> bool |
27800
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
23 |
datatype token_kind = |
67352
5f7f339f3d7e
inner syntax comments may be written as "\<comment> \<open>text\<close>";
wenzelm
parents:
64275
diff
changeset
|
24 |
Literal | IdentSy | LongIdentSy | VarSy | TFreeSy | TVarSy | NumSy | FloatSy | |
67425
7d4a088dbc0e
clarified modules: uniform notion of formal comments;
wenzelm
parents:
67413
diff
changeset
|
25 |
StrSy | StringSy | Cartouche | Space | Comment of Comment.kind option | EOF |
27800
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
26 |
datatype token = Token of token_kind * string * Position.range |
67412 | 27 |
val kind_of_token: token -> token_kind |
27806 | 28 |
val str_of_token: token -> string |
29 |
val pos_of_token: token -> Position.T |
|
27887 | 30 |
val is_proper: token -> bool |
27800
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
31 |
val mk_eof: Position.T -> token |
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
32 |
val eof: token |
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
33 |
val is_eof: token -> bool |
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
34 |
val stopper: token Scan.stopper |
237
a7d3e712767a
MAJOR INTERNAL CHANGE: extend and merge operations of syntax tables
wenzelm
parents:
164
diff
changeset
|
35 |
val terminals: string list |
a7d3e712767a
MAJOR INTERNAL CHANGE: extend and merge operations of syntax tables
wenzelm
parents:
164
diff
changeset
|
36 |
val is_terminal: string -> bool |
49821
d15fe10593ff
clarified output token markup (see also bc22daeed49e);
wenzelm
parents:
48992
diff
changeset
|
37 |
val literal_markup: string -> Markup.T |
44736 | 38 |
val report_of_token: token -> Position.report |
39510
d9f5f01faa1b
Syntax.read_asts error: report token ranges within message -- no side-effect here;
wenzelm
parents:
39507
diff
changeset
|
39 |
val reported_token_range: Proof.context -> token -> string |
18 | 40 |
val valued_token: token -> bool |
237
a7d3e712767a
MAJOR INTERNAL CHANGE: extend and merge operations of syntax tables
wenzelm
parents:
164
diff
changeset
|
41 |
val predef_term: string -> token option |
55108
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
42 |
val implode_string: Symbol.symbol list -> string |
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
43 |
val explode_string: string * Position.T -> Symbol_Pos.T list |
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
44 |
val implode_str: Symbol.symbol list -> string |
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
45 |
val explode_str: string * Position.T -> Symbol_Pos.T list |
30573 | 46 |
val tokenize: Scan.lexicon -> bool -> Symbol_Pos.T list -> token list |
42290
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
47 |
val read_indexname: string -> indexname |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
48 |
val read_var: string -> term |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
49 |
val read_variable: string -> indexname option |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
50 |
val read_nat: string -> int option |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
51 |
val read_int: string -> int option |
58421 | 52 |
val read_num: string -> {radix: int, leading_zeros: int, value: int} |
42290
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
53 |
val read_float: string -> {mant: int, exp: int} |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
54 |
val mark_class: string -> string val unmark_class: string -> string |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
55 |
val mark_type: string -> string val unmark_type: string -> string |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
56 |
val mark_const: string -> string val unmark_const: string -> string |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
57 |
val mark_fixed: string -> string val unmark_fixed: string -> string |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
58 |
val unmark: |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
59 |
{case_class: string -> 'a, |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
60 |
case_type: string -> 'a, |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
61 |
case_const: string -> 'a, |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
62 |
case_fixed: string -> 'a, |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
63 |
case_default: string -> 'a} -> string -> 'a |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
64 |
val is_marked: string -> bool |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
65 |
val dummy_type: term |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
66 |
val fun_type: term |
4247
9bba9251bb4d
added implode_xstr: string list -> string, explode_xstr: string -> string list;
wenzelm
parents:
3828
diff
changeset
|
67 |
end; |
0 | 68 |
|
14679 | 69 |
structure Lexicon: LEXICON = |
0 | 70 |
struct |
71 |
||
42476 | 72 |
(** syntaxtic terms **) |
73 |
||
74 |
structure Syntax = |
|
75 |
struct |
|
76 |
||
77 |
fun const c = Const (c, dummyT); |
|
78 |
fun free x = Free (x, dummyT); |
|
79 |
fun var xi = Var (xi, dummyT); |
|
80 |
||
81 |
end; |
|
82 |
||
83 |
||
84 |
||
4703 | 85 |
(** basic scanners **) |
86 |
||
30573 | 87 |
open Basic_Symbol_Pos; |
27773 | 88 |
|
55105 | 89 |
val err_prefix = "Inner lexical error: "; |
90 |
||
91 |
fun !!! msg = Symbol_Pos.!!! (fn () => err_prefix ^ msg); |
|
27773 | 92 |
|
50239 | 93 |
val scan_id = Symbol_Pos.scan_ident; |
61476 | 94 |
val scan_longid = scan_id @@@ Scan.repeats1 ($$$ "." @@@ scan_id); |
27773 | 95 |
val scan_tid = $$$ "'" @@@ scan_id; |
4703 | 96 |
|
40525
14a2e686bdac
eliminated slightly odd pervasive Symbol_Pos.symbol;
wenzelm
parents:
40290
diff
changeset
|
97 |
val scan_hex = $$$ "0" @@@ $$$ "x" @@@ Scan.many1 (Symbol.is_ascii_hex o Symbol_Pos.symbol); |
27773 | 98 |
val scan_bin = $$$ "0" @@@ $$$ "b" @@@ Scan.many1 (fn (s, _) => s = "0" orelse s = "1"); |
62782 | 99 |
val scan_num = scan_hex || scan_bin || Symbol_Pos.scan_nat; |
4703 | 100 |
|
62782 | 101 |
val scan_id_nat = scan_id @@@ Scan.optional ($$$ "." @@@ Symbol_Pos.scan_nat) []; |
27773 | 102 |
val scan_var = $$$ "?" @@@ scan_id_nat; |
103 |
val scan_tvar = $$$ "?" @@@ $$$ "'" @@@ scan_id_nat; |
|
4703 | 104 |
|
50239 | 105 |
fun is_tid s = |
106 |
(case try (unprefix "'") s of |
|
107 |
SOME s' => Symbol_Pos.is_identifier s' |
|
108 |
| NONE => false); |
|
109 |
||
4703 | 110 |
|
111 |
||
18 | 112 |
(** datatype token **) |
0 | 113 |
|
27800
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
114 |
datatype token_kind = |
67352
5f7f339f3d7e
inner syntax comments may be written as "\<comment> \<open>text\<close>";
wenzelm
parents:
64275
diff
changeset
|
115 |
Literal | IdentSy | LongIdentSy | VarSy | TFreeSy | TVarSy | NumSy | FloatSy | StrSy | |
67425
7d4a088dbc0e
clarified modules: uniform notion of formal comments;
wenzelm
parents:
67413
diff
changeset
|
116 |
StringSy | Cartouche | Space | Comment of Comment.kind option | EOF; |
27800
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
117 |
|
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
118 |
datatype token = Token of token_kind * string * Position.range; |
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
119 |
|
67412 | 120 |
fun kind_of_token (Token (k, _, _)) = k; |
27806 | 121 |
fun str_of_token (Token (_, s, _)) = s; |
122 |
fun pos_of_token (Token (_, _, (pos, _))) = pos; |
|
123 |
||
67425
7d4a088dbc0e
clarified modules: uniform notion of formal comments;
wenzelm
parents:
67413
diff
changeset
|
124 |
val is_proper = kind_of_token #> (fn Space => false | Comment _ => false | _ => true); |
27887 | 125 |
|
27800
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
126 |
|
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
127 |
(* stopper *) |
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
128 |
|
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
129 |
fun mk_eof pos = Token (EOF, "", (pos, Position.none)); |
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
130 |
val eof = mk_eof Position.none; |
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
131 |
|
67412 | 132 |
fun is_eof tok = kind_of_token tok = EOF; |
27800
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
133 |
val stopper = Scan.stopper (K eof) is_eof; |
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
134 |
|
0 | 135 |
|
237
a7d3e712767a
MAJOR INTERNAL CHANGE: extend and merge operations of syntax tables
wenzelm
parents:
164
diff
changeset
|
136 |
(* terminal arguments *) |
0 | 137 |
|
29156
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
138 |
val terminal_kinds = |
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
139 |
[("id", IdentSy), |
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
140 |
("longid", LongIdentSy), |
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
141 |
("var", VarSy), |
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
142 |
("tid", TFreeSy), |
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
143 |
("tvar", TVarSy), |
45703
c7a13ce60161
renamed inner syntax categories "num" to "num_token" and "xnum" to "xnum_token";
wenzelm
parents:
45666
diff
changeset
|
144 |
("num_token", NumSy), |
29156
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
145 |
("float_token", FloatSy), |
55033 | 146 |
("str_token", StrSy), |
55108
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
147 |
("string_token", StringSy), |
55033 | 148 |
("cartouche", Cartouche)]; |
29156
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
149 |
|
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
150 |
val terminals = map #1 terminal_kinds; |
20664 | 151 |
val is_terminal = member (op =) terminals; |
237
a7d3e712767a
MAJOR INTERNAL CHANGE: extend and merge operations of syntax tables
wenzelm
parents:
164
diff
changeset
|
152 |
|
0 | 153 |
|
27887 | 154 |
(* markup *) |
155 |
||
49821
d15fe10593ff
clarified output token markup (see also bc22daeed49e);
wenzelm
parents:
48992
diff
changeset
|
156 |
fun literal_markup s = |
52189 | 157 |
if Symbol.is_ascii_identifier s orelse exists Symbol.is_letter (Symbol.explode s) |
158 |
then Markup.literal |
|
159 |
else Markup.delimiter; |
|
49821
d15fe10593ff
clarified output token markup (see also bc22daeed49e);
wenzelm
parents:
48992
diff
changeset
|
160 |
|
27887 | 161 |
val token_kind_markup = |
51612
6a1e40f9dd55
added var_position in analogy to longid_position, for typing reports on input;
wenzelm
parents:
50242
diff
changeset
|
162 |
fn TFreeSy => Markup.tfree |
55033 | 163 |
| TVarSy => Markup.tvar |
164 |
| NumSy => Markup.numeral |
|
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
49821
diff
changeset
|
165 |
| FloatSy => Markup.numeral |
55033 | 166 |
| StrSy => Markup.inner_string |
55108
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
167 |
| StringSy => Markup.inner_string |
55033 | 168 |
| Cartouche => Markup.inner_cartouche |
67440 | 169 |
| Comment _ => Markup.inner_comment |
55033 | 170 |
| _ => Markup.empty; |
27887 | 171 |
|
44736 | 172 |
fun report_of_token (Token (kind, s, (pos, _))) = |
49821
d15fe10593ff
clarified output token markup (see also bc22daeed49e);
wenzelm
parents:
48992
diff
changeset
|
173 |
let val markup = if kind = Literal then literal_markup s else token_kind_markup kind |
44736 | 174 |
in (pos, markup) end; |
27887 | 175 |
|
39510
d9f5f01faa1b
Syntax.read_asts error: report token ranges within message -- no side-effect here;
wenzelm
parents:
39507
diff
changeset
|
176 |
fun reported_token_range ctxt tok = |
39168
e3ac771235f7
report token range after inner parse error -- often provides important clues about misunderstanding concerning lexical phase;
wenzelm
parents:
38474
diff
changeset
|
177 |
if is_proper tok |
50201
c26369c9eda6
Isabelle-specific implementation of quasi-abstract markup elements -- back to module arrangement before d83797ef0d2d;
wenzelm
parents:
49821
diff
changeset
|
178 |
then Context_Position.reported_text ctxt (pos_of_token tok) Markup.token_range "" |
39510
d9f5f01faa1b
Syntax.read_asts error: report token ranges within message -- no side-effect here;
wenzelm
parents:
39507
diff
changeset
|
179 |
else ""; |
39168
e3ac771235f7
report token range after inner parse error -- often provides important clues about misunderstanding concerning lexical phase;
wenzelm
parents:
38474
diff
changeset
|
180 |
|
27887 | 181 |
|
18 | 182 |
(* valued_token *) |
0 | 183 |
|
67412 | 184 |
val valued_token = |
185 |
kind_of_token #> (fn Literal => false | EOF => false | _ => true); |
|
0 | 186 |
|
187 |
||
18 | 188 |
(* predef_term *) |
0 | 189 |
|
29156
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
190 |
fun predef_term s = |
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
191 |
(case AList.lookup (op =) terminal_kinds s of |
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
192 |
SOME sy => SOME (Token (sy, s, Position.no_range)) |
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
193 |
| NONE => NONE); |
0 | 194 |
|
195 |
||
55108
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
196 |
|
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
197 |
(** string literals **) |
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
198 |
|
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
199 |
fun explode_literal scan_body (str, pos) = |
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
200 |
(case Scan.read Symbol_Pos.stopper scan_body (Symbol_Pos.explode (str, pos)) of |
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
201 |
SOME ss => ss |
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
202 |
| _ => error (err_prefix ^ "malformed string literal " ^ quote str ^ Position.here pos)); |
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
203 |
|
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
204 |
|
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
205 |
(* string *) |
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
206 |
|
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
207 |
val scan_string = Scan.trace (Symbol_Pos.scan_string_qq err_prefix) >> #2; |
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
208 |
val scan_string_body = Symbol_Pos.scan_string_qq err_prefix >> (#1 o #2); |
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
209 |
|
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
210 |
fun implode_string ss = quote (implode (map (fn "\"" => "\\\"" | s => s) ss)); |
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
211 |
val explode_string = explode_literal scan_string_body; |
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
212 |
|
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
213 |
|
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
214 |
(* str *) |
18 | 215 |
|
14730 | 216 |
val scan_chr = |
55107 | 217 |
$$ "\\" |-- $$$ "'" || |
40525
14a2e686bdac
eliminated slightly odd pervasive Symbol_Pos.symbol;
wenzelm
parents:
40290
diff
changeset
|
218 |
Scan.one |
58854 | 219 |
((fn s => s <> "\\" andalso s <> "'" andalso Symbol.not_eof s) o |
40525
14a2e686bdac
eliminated slightly odd pervasive Symbol_Pos.symbol;
wenzelm
parents:
40290
diff
changeset
|
220 |
Symbol_Pos.symbol) >> single || |
55107 | 221 |
$$$ "'" --| Scan.ahead (~$$ "'"); |
14730 | 222 |
|
223 |
val scan_str = |
|
55106 | 224 |
Scan.ahead ($$ "'" -- $$ "'") |-- |
225 |
!!! "unclosed string literal" |
|
61476 | 226 |
($$$ "'" @@@ $$$ "'" @@@ Scan.repeats scan_chr @@@ $$$ "'" @@@ $$$ "'"); |
27800
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
227 |
|
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
228 |
val scan_str_body = |
55107 | 229 |
Scan.ahead ($$ "'" |-- $$ "'") |-- |
55106 | 230 |
!!! "unclosed string literal" |
61476 | 231 |
($$ "'" |-- $$ "'" |-- Scan.repeats scan_chr --| $$ "'" --| $$ "'"); |
14730 | 232 |
|
55108
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
233 |
fun implode_str ss = enclose "''" "''" (implode (map (fn "'" => "\\'" | s => s) ss)); |
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
234 |
val explode_str = explode_literal scan_str_body; |
18 | 235 |
|
236 |
||
27806 | 237 |
|
18 | 238 |
(** tokenize **) |
239 |
||
67412 | 240 |
val token_leq = op <= o apply2 str_of_token; |
30573 | 241 |
fun token kind ss = Token (kind, Symbol_Pos.content ss, Symbol_Pos.range ss); |
27800
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
242 |
|
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
243 |
fun tokenize lex xids syms = |
18 | 244 |
let |
245 |
val scan_xid = |
|
55962
fbd0e768bc8f
special identifier "__" (i.e. empty name with internal suffix) serves as wild-card for completion;
wenzelm
parents:
55624
diff
changeset
|
246 |
(if xids then $$$ "_" @@@ scan_id || scan_id else scan_id) || |
fbd0e768bc8f
special identifier "__" (i.e. empty name with internal suffix) serves as wild-card for completion;
wenzelm
parents:
55624
diff
changeset
|
247 |
$$$ "_" @@@ $$$ "_"; |
18 | 248 |
|
550
353eea6ec232
replaced id, var, tid, tvar by idT, varT, tidT, tvarT;
wenzelm
parents:
376
diff
changeset
|
249 |
val scan_val = |
26007
3760d3ff4cce
basic scanners: produce symbol list instead of imploded string;
wenzelm
parents:
24630
diff
changeset
|
250 |
scan_tvar >> token TVarSy || |
3760d3ff4cce
basic scanners: produce symbol list instead of imploded string;
wenzelm
parents:
24630
diff
changeset
|
251 |
scan_var >> token VarSy || |
3760d3ff4cce
basic scanners: produce symbol list instead of imploded string;
wenzelm
parents:
24630
diff
changeset
|
252 |
scan_tid >> token TFreeSy || |
62782 | 253 |
Symbol_Pos.scan_float >> token FloatSy || |
58421 | 254 |
scan_num >> token NumSy || |
26007
3760d3ff4cce
basic scanners: produce symbol list instead of imploded string;
wenzelm
parents:
24630
diff
changeset
|
255 |
scan_longid >> token LongIdentSy || |
3760d3ff4cce
basic scanners: produce symbol list instead of imploded string;
wenzelm
parents:
24630
diff
changeset
|
256 |
scan_xid >> token IdentSy; |
18 | 257 |
|
27800
df444ddeff56
datatype token: maintain range, tuned representation;
wenzelm
parents:
27773
diff
changeset
|
258 |
val scan_lit = Scan.literal lex >> token Literal; |
550
353eea6ec232
replaced id, var, tid, tvar by idT, varT, tidT, tvarT;
wenzelm
parents:
376
diff
changeset
|
259 |
|
4703 | 260 |
val scan_token = |
55105 | 261 |
Symbol_Pos.scan_cartouche err_prefix >> token Cartouche || |
67425
7d4a088dbc0e
clarified modules: uniform notion of formal comments;
wenzelm
parents:
67413
diff
changeset
|
262 |
Symbol_Pos.scan_comment err_prefix >> token (Comment NONE) || |
7d4a088dbc0e
clarified modules: uniform notion of formal comments;
wenzelm
parents:
67413
diff
changeset
|
263 |
Comment.scan >> (fn (kind, ss) => token (Comment (SOME kind)) ss) || |
27887 | 264 |
Scan.max token_leq scan_lit scan_val || |
55108
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
265 |
scan_string >> token StringSy || |
27887 | 266 |
scan_str >> token StrSy || |
40525
14a2e686bdac
eliminated slightly odd pervasive Symbol_Pos.symbol;
wenzelm
parents:
40290
diff
changeset
|
267 |
Scan.many1 (Symbol.is_blank o Symbol_Pos.symbol) >> token Space; |
18 | 268 |
in |
27773 | 269 |
(case Scan.error |
30573 | 270 |
(Scan.finite Symbol_Pos.stopper (Scan.repeat scan_token)) syms of |
27887 | 271 |
(toks, []) => toks |
55108
0b7a0c1fdf7e
inner syntax token language allows regular quoted strings;
wenzelm
parents:
55107
diff
changeset
|
272 |
| (_, ss) => |
55624 | 273 |
error ("Inner lexical error" ^ Position.here (#1 (Symbol_Pos.range ss)) ^ |
274 |
Markup.markup Markup.no_report ("\nat " ^ quote (Symbol_Pos.content ss)))) |
|
275 |
||
18 | 276 |
end; |
277 |
||
278 |
||
279 |
||
280 |
(** scan variables **) |
|
281 |
||
15991
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
282 |
(* scan_indexname *) |
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
283 |
|
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
284 |
local |
18 | 285 |
|
27773 | 286 |
val scan_vname = |
18 | 287 |
let |
15991
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
288 |
fun nat n [] = n |
64275
ac2abc987cf9
accomodate Poly/ML repository version, which treats singleton strings as boxed;
wenzelm
parents:
62819
diff
changeset
|
289 |
| nat n (c :: cs) = nat (n * 10 + (ord c - Char.ord #"0")) cs; |
18 | 290 |
|
15991
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
291 |
fun idxname cs ds = (implode (rev cs), nat 0 ds); |
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
292 |
fun chop_idx [] ds = idxname [] ds |
62529
8b7bdfc09f3b
clarified treatment of fragments of Isabelle symbols during bootstrap;
wenzelm
parents:
61476
diff
changeset
|
293 |
| chop_idx (cs as (_ :: "\<^sub>" :: _)) ds = idxname cs ds |
15991
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
294 |
| chop_idx (c :: cs) ds = |
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
295 |
if Symbol.is_digit c then chop_idx cs (c :: ds) |
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
296 |
else idxname (c :: cs) ds; |
18 | 297 |
|
50239 | 298 |
val scan = |
299 |
(scan_id >> map Symbol_Pos.symbol) -- |
|
62782 | 300 |
Scan.optional ($$ "." |-- Symbol_Pos.scan_nat >> (nat 0 o map Symbol_Pos.symbol)) ~1; |
18 | 301 |
in |
27773 | 302 |
scan >> |
303 |
(fn (cs, ~1) => chop_idx (rev cs) [] |
|
304 |
| (cs, i) => (implode cs, i)) |
|
18 | 305 |
end; |
306 |
||
15991
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
307 |
in |
18 | 308 |
|
55107 | 309 |
val scan_indexname = $$ "'" |-- scan_vname >> (fn (x, i) => ("'" ^ x, i)) || scan_vname; |
15443
07f78cc82a73
indexname function now parses type variables as well; changed input
berghofe
parents:
14981
diff
changeset
|
310 |
|
15991
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
311 |
end; |
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
312 |
|
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
313 |
|
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
314 |
(* indexname *) |
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
315 |
|
20313
bf9101cc4385
renamed Syntax.indexname to Syntax.read_indexname;
wenzelm
parents:
20165
diff
changeset
|
316 |
fun read_indexname s = |
62751 | 317 |
(case Scan.read Symbol_Pos.stopper scan_indexname (Symbol_Pos.explode0 s) of |
15531 | 318 |
SOME xi => xi |
20313
bf9101cc4385
renamed Syntax.indexname to Syntax.read_indexname;
wenzelm
parents:
20165
diff
changeset
|
319 |
| _ => error ("Lexical error in variable name: " ^ quote s)); |
18 | 320 |
|
321 |
||
4703 | 322 |
(* read_var *) |
18 | 323 |
|
4703 | 324 |
fun read_var str = |
18 | 325 |
let |
326 |
val scan = |
|
55107 | 327 |
$$ "?" |-- scan_indexname --| Scan.ahead (Scan.one Symbol_Pos.is_eof) |
42476 | 328 |
>> Syntax.var || |
58854 | 329 |
Scan.many (Symbol.not_eof o Symbol_Pos.symbol) |
42476 | 330 |
>> (Syntax.free o implode o map Symbol_Pos.symbol); |
62751 | 331 |
in the (Scan.read Symbol_Pos.stopper scan (Symbol_Pos.explode0 str)) end; |
15991
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
332 |
|
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
333 |
|
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
334 |
(* read_variable *) |
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
335 |
|
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
336 |
fun read_variable str = |
55107 | 337 |
let val scan = $$ "?" |-- scan_indexname || scan_indexname |
62751 | 338 |
in Scan.read Symbol_Pos.stopper scan (Symbol_Pos.explode0 str) end; |
4587 | 339 |
|
340 |
||
20313
bf9101cc4385
renamed Syntax.indexname to Syntax.read_indexname;
wenzelm
parents:
20165
diff
changeset
|
341 |
(* read numbers *) |
bf9101cc4385
renamed Syntax.indexname to Syntax.read_indexname;
wenzelm
parents:
20165
diff
changeset
|
342 |
|
bf9101cc4385
renamed Syntax.indexname to Syntax.read_indexname;
wenzelm
parents:
20165
diff
changeset
|
343 |
local |
bf9101cc4385
renamed Syntax.indexname to Syntax.read_indexname;
wenzelm
parents:
20165
diff
changeset
|
344 |
|
bf9101cc4385
renamed Syntax.indexname to Syntax.read_indexname;
wenzelm
parents:
20165
diff
changeset
|
345 |
fun nat cs = |
40525
14a2e686bdac
eliminated slightly odd pervasive Symbol_Pos.symbol;
wenzelm
parents:
40290
diff
changeset
|
346 |
Option.map (#1 o Library.read_int o map Symbol_Pos.symbol) |
62782 | 347 |
(Scan.read Symbol_Pos.stopper Symbol_Pos.scan_nat cs); |
5860 | 348 |
|
20313
bf9101cc4385
renamed Syntax.indexname to Syntax.read_indexname;
wenzelm
parents:
20165
diff
changeset
|
349 |
in |
bf9101cc4385
renamed Syntax.indexname to Syntax.read_indexname;
wenzelm
parents:
20165
diff
changeset
|
350 |
|
62751 | 351 |
fun read_nat s = nat (Symbol_Pos.explode0 s); |
20313
bf9101cc4385
renamed Syntax.indexname to Syntax.read_indexname;
wenzelm
parents:
20165
diff
changeset
|
352 |
|
bf9101cc4385
renamed Syntax.indexname to Syntax.read_indexname;
wenzelm
parents:
20165
diff
changeset
|
353 |
fun read_int s = |
62751 | 354 |
(case Symbol_Pos.explode0 s of |
27773 | 355 |
("-", _) :: cs => Option.map ~ (nat cs) |
20313
bf9101cc4385
renamed Syntax.indexname to Syntax.read_indexname;
wenzelm
parents:
20165
diff
changeset
|
356 |
| cs => nat cs); |
bf9101cc4385
renamed Syntax.indexname to Syntax.read_indexname;
wenzelm
parents:
20165
diff
changeset
|
357 |
|
bf9101cc4385
renamed Syntax.indexname to Syntax.read_indexname;
wenzelm
parents:
20165
diff
changeset
|
358 |
end; |
5860 | 359 |
|
360 |
||
58421 | 361 |
(* read_num: hex/bin/decimal *) |
9326 | 362 |
|
15991
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
363 |
local |
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
364 |
|
64275
ac2abc987cf9
accomodate Poly/ML repository version, which treats singleton strings as boxed;
wenzelm
parents:
62819
diff
changeset
|
365 |
val ten = Char.ord #"0" + 10; |
ac2abc987cf9
accomodate Poly/ML repository version, which treats singleton strings as boxed;
wenzelm
parents:
62819
diff
changeset
|
366 |
val a = Char.ord #"a"; |
ac2abc987cf9
accomodate Poly/ML repository version, which treats singleton strings as boxed;
wenzelm
parents:
62819
diff
changeset
|
367 |
val A = Char.ord #"A"; |
35428 | 368 |
val _ = a > A orelse raise Fail "Bad ASCII"; |
20096 | 369 |
|
370 |
fun remap_hex c = |
|
371 |
let val x = ord c in |
|
372 |
if x >= a then chr (x - a + ten) |
|
373 |
else if x >= A then chr (x - A + ten) |
|
374 |
else c |
|
375 |
end; |
|
15991
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
376 |
|
21781 | 377 |
fun leading_zeros ["0"] = 0 |
378 |
| leading_zeros ("0" :: cs) = 1 + leading_zeros cs |
|
379 |
| leading_zeros _ = 0; |
|
380 |
||
15991
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
381 |
in |
15965
f422f8283491
Use of IntInf.int instead of int in most numeric simprocs; avoids
paulson
parents:
15570
diff
changeset
|
382 |
|
58421 | 383 |
fun read_num str = |
9326 | 384 |
let |
58421 | 385 |
val (radix, digs) = |
386 |
(case Symbol.explode str of |
|
387 |
"0" :: "x" :: cs => (16, map remap_hex cs) |
|
388 |
| "0" :: "b" :: cs => (2, cs) |
|
389 |
| cs => (10, cs)); |
|
29156
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
390 |
in |
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
391 |
{radix = radix, |
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
392 |
leading_zeros = leading_zeros digs, |
58421 | 393 |
value = #1 (Library.read_radix_int radix digs)} |
29156
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
394 |
end; |
9326 | 395 |
|
15991
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
396 |
end; |
670f8e4b5a98
added read_variable: optional question mark on input;
wenzelm
parents:
15965
diff
changeset
|
397 |
|
28904 | 398 |
fun read_float str = |
399 |
let |
|
58421 | 400 |
val cs = Symbol.explode str; |
29156
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
401 |
val (intpart, fracpart) = |
67522 | 402 |
(case chop_prefix Symbol.is_digit cs of |
29156
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
403 |
(intpart, "." :: fracpart) => (intpart, fracpart) |
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
404 |
| _ => raise Fail "read_float"); |
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
405 |
in |
58421 | 406 |
{mant = #1 (Library.read_int (intpart @ fracpart)), |
29156
89f76a58a378
renamed terminal category "float" to "float_token", to avoid name
wenzelm
parents:
28904
diff
changeset
|
407 |
exp = length fracpart} |
42046
6341c23baf10
added Lexicon.encode_position, Lexicon.decode_position;
wenzelm
parents:
40525
diff
changeset
|
408 |
end; |
6341c23baf10
added Lexicon.encode_position, Lexicon.decode_position;
wenzelm
parents:
40525
diff
changeset
|
409 |
|
42290
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
410 |
|
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
411 |
(* marked logical entities *) |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
412 |
|
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
413 |
fun marker s = (prefix s, unprefix s); |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
414 |
|
62529
8b7bdfc09f3b
clarified treatment of fragments of Isabelle symbols during bootstrap;
wenzelm
parents:
61476
diff
changeset
|
415 |
val (mark_class, unmark_class) = marker "\<^class>"; |
8b7bdfc09f3b
clarified treatment of fragments of Isabelle symbols during bootstrap;
wenzelm
parents:
61476
diff
changeset
|
416 |
val (mark_type, unmark_type) = marker "\<^type>"; |
8b7bdfc09f3b
clarified treatment of fragments of Isabelle symbols during bootstrap;
wenzelm
parents:
61476
diff
changeset
|
417 |
val (mark_const, unmark_const) = marker "\<^const>"; |
8b7bdfc09f3b
clarified treatment of fragments of Isabelle symbols during bootstrap;
wenzelm
parents:
61476
diff
changeset
|
418 |
val (mark_fixed, unmark_fixed) = marker "\<^fixed>"; |
42290
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
419 |
|
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
420 |
fun unmark {case_class, case_type, case_const, case_fixed, case_default} s = |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
421 |
(case try unmark_class s of |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
422 |
SOME c => case_class c |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
423 |
| NONE => |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
424 |
(case try unmark_type s of |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
425 |
SOME c => case_type c |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
426 |
| NONE => |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
427 |
(case try unmark_const s of |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
428 |
SOME c => case_const c |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
429 |
| NONE => |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
430 |
(case try unmark_fixed s of |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
431 |
SOME c => case_fixed c |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
432 |
| NONE => case_default s)))); |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
433 |
|
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
434 |
val is_marked = |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
435 |
unmark {case_class = K true, case_type = K true, case_const = K true, |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
436 |
case_fixed = K true, case_default = K false}; |
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
437 |
|
42476 | 438 |
val dummy_type = Syntax.const (mark_type "dummy"); |
439 |
val fun_type = Syntax.const (mark_type "fun"); |
|
42290
b1f544c84040
discontinued special treatment of structure Lexicon;
wenzelm
parents:
42264
diff
changeset
|
440 |
|
59196 | 441 |
|
442 |
(* toplevel pretty printing *) |
|
443 |
||
62663 | 444 |
val _ = |
62819
d3ff367a16a0
careful export of type-dependent functions, without losing their special status;
wenzelm
parents:
62782
diff
changeset
|
445 |
ML_system_pp (fn _ => fn _ => |
62663 | 446 |
Pretty.to_polyml o Pretty.str_list "{" "}" o map quote o Scan.dest_lexicon); |
59196 | 447 |
|
0 | 448 |
end; |