| author | wenzelm |
| Mon, 27 Oct 2025 15:16:32 +0100 | |
| changeset 83417 | b51e4a526897 |
| parent 80914 | d97fdabd9e2b |
| permissions | -rw-r--r-- |
| 59189 | 1 |
section \<open>Concrete Syntax\<close> |
| 13020 | 2 |
|
| 16417 | 3 |
theory Quote_Antiquote imports Main begin |
| 13020 | 4 |
|
5 |
syntax |
|
|
80914
d97fdabd9e2b
standardize mixfix annotations via "isabelle update -a -u mixfix_cartouches" --- to simplify systematic editing;
wenzelm
parents:
69597
diff
changeset
|
6 |
"_quote" :: "'b \<Rightarrow> ('a \<Rightarrow> 'b)" (\<open>(\<guillemotleft>_\<guillemotright>)\<close> [0] 1000)
|
|
d97fdabd9e2b
standardize mixfix annotations via "isabelle update -a -u mixfix_cartouches" --- to simplify systematic editing;
wenzelm
parents:
69597
diff
changeset
|
7 |
"_antiquote" :: "('a \<Rightarrow> 'b) \<Rightarrow> 'b" (\<open>\<acute>_\<close> [1000] 1000)
|
|
d97fdabd9e2b
standardize mixfix annotations via "isabelle update -a -u mixfix_cartouches" --- to simplify systematic editing;
wenzelm
parents:
69597
diff
changeset
|
8 |
"_Assert" :: "'a \<Rightarrow> 'a set" (\<open>(\<lbrace>_\<rbrace>)\<close> [0] 1000) |
| 13020 | 9 |
|
10 |
translations |
|
| 53241 | 11 |
"\<lbrace>b\<rbrace>" \<rightharpoonup> "CONST Collect \<guillemotleft>b\<guillemotright>" |
| 13020 | 12 |
|
| 59189 | 13 |
parse_translation \<open> |
| 13020 | 14 |
let |
| 69597 | 15 |
fun quote_tr [t] = Syntax_Trans.quote_tr \<^syntax_const>\<open>_antiquote\<close> t |
| 13020 | 16 |
| quote_tr ts = raise TERM ("quote_tr", ts);
|
| 69597 | 17 |
in [(\<^syntax_const>\<open>_quote\<close>, K quote_tr)] end |
| 59189 | 18 |
\<close> |
| 13020 | 19 |
|
| 62390 | 20 |
end |