src/Pure/Syntax/mixfix.ML
author wenzelm
Fri, 08 Apr 2011 15:02:11 +0200
changeset 42288 2074b31650e6
parent 42287 d98eb048a2e4
child 42293 6cca0343ea48
permissions -rw-r--r--
discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext); clarified Syntax.root;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
384
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
     1
(*  Title:      Pure/Syntax/mixfix.ML
551
4c139c37dbaf minor cleanings;
wenzelm
parents: 472
diff changeset
     2
    Author:     Tobias Nipkow and Markus Wenzel, TU Muenchen
384
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
     3
18719
dca3ae4f6dd6 moved pure syntax to Syntax/syntax.ML and pure_thy.ML;
wenzelm
parents: 18673
diff changeset
     4
Mixfix declarations, infixes, binders.
384
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
     5
*)
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
     6
42287
d98eb048a2e4 discontinued special treatment of structure Mixfix;
wenzelm
parents: 42284
diff changeset
     7
signature BASIC_MIXFIX =
2199
bcb360f80dac added Infixl/rName: specify infix name independently from syntax;
wenzelm
parents: 1952
diff changeset
     8
sig
384
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
     9
  datatype mixfix =
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
    10
    NoSyn |
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
    11
    Mixfix of string * int list * int |
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
    12
    Delimfix of string |
35130
0991c84e8dcf renamed InfixName to Infix etc.;
wenzelm
parents: 35129
diff changeset
    13
    Infix of string * int |
0991c84e8dcf renamed InfixName to Infix etc.;
wenzelm
parents: 35129
diff changeset
    14
    Infixl of string * int |
0991c84e8dcf renamed InfixName to Infix etc.;
wenzelm
parents: 35129
diff changeset
    15
    Infixr of string * int |
18673
fad60fe1565c mixfix: added Structure;
wenzelm
parents: 18565
diff changeset
    16
    Binder of string * int * int |
fad60fe1565c mixfix: added Structure;
wenzelm
parents: 18565
diff changeset
    17
    Structure
2199
bcb360f80dac added Infixl/rName: specify infix name independently from syntax;
wenzelm
parents: 1952
diff changeset
    18
end;
384
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
    19
42287
d98eb048a2e4 discontinued special treatment of structure Mixfix;
wenzelm
parents: 42284
diff changeset
    20
signature MIXFIX =
2199
bcb360f80dac added Infixl/rName: specify infix name independently from syntax;
wenzelm
parents: 1952
diff changeset
    21
sig
42287
d98eb048a2e4 discontinued special treatment of structure Mixfix;
wenzelm
parents: 42284
diff changeset
    22
  include BASIC_MIXFIX
19271
967e6c2578f2 turned string_of_mixfix into pretty_mixfix;
wenzelm
parents: 19020
diff changeset
    23
  val pretty_mixfix: mixfix -> Pretty.T
4823
588538fb9308 added no_syn;
wenzelm
parents: 4697
diff changeset
    24
  val mixfix_args: mixfix -> int
22702
372da033ed93 added mixfixT (from type_infer.ML);
wenzelm
parents: 21805
diff changeset
    25
  val mixfixT: mixfix -> typ
35412
b8dead547d9e more uniform treatment of syntax for types vs. consts;
wenzelm
parents: 35390
diff changeset
    26
  val make_type: int -> typ
42287
d98eb048a2e4 discontinued special treatment of structure Mixfix;
wenzelm
parents: 42284
diff changeset
    27
  val binder_name: string -> string
42288
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
    28
  val syn_ext_types: (string * typ * mixfix) list -> Syntax_Ext.syn_ext
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
    29
  val syn_ext_consts: (string -> bool) -> (string * typ * mixfix) list -> Syntax_Ext.syn_ext
2199
bcb360f80dac added Infixl/rName: specify infix name independently from syntax;
wenzelm
parents: 1952
diff changeset
    30
end;
bcb360f80dac added Infixl/rName: specify infix name independently from syntax;
wenzelm
parents: 1952
diff changeset
    31
15751
65e4790c7914 identify binder translations only once (admits remove);
wenzelm
parents: 15570
diff changeset
    32
structure Mixfix: MIXFIX =
384
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
    33
struct
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
    34
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
    35
(** mixfix declarations **)
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
    36
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
    37
datatype mixfix =
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
    38
  NoSyn |
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
    39
  Mixfix of string * int list * int |
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
    40
  Delimfix of string |
35130
0991c84e8dcf renamed InfixName to Infix etc.;
wenzelm
parents: 35129
diff changeset
    41
  Infix of string * int |
0991c84e8dcf renamed InfixName to Infix etc.;
wenzelm
parents: 35129
diff changeset
    42
  Infixl of string * int |
0991c84e8dcf renamed InfixName to Infix etc.;
wenzelm
parents: 35129
diff changeset
    43
  Infixr of string * int |
18673
fad60fe1565c mixfix: added Structure;
wenzelm
parents: 18565
diff changeset
    44
  Binder of string * int * int |
fad60fe1565c mixfix: added Structure;
wenzelm
parents: 18565
diff changeset
    45
  Structure;
384
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
    46
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
    47
19271
967e6c2578f2 turned string_of_mixfix into pretty_mixfix;
wenzelm
parents: 19020
diff changeset
    48
(* pretty_mixfix *)
967e6c2578f2 turned string_of_mixfix into pretty_mixfix;
wenzelm
parents: 19020
diff changeset
    49
967e6c2578f2 turned string_of_mixfix into pretty_mixfix;
wenzelm
parents: 19020
diff changeset
    50
local
11920
6833cadb4062 added string_of_mixfix;
wenzelm
parents: 11651
diff changeset
    51
19271
967e6c2578f2 turned string_of_mixfix into pretty_mixfix;
wenzelm
parents: 19020
diff changeset
    52
val quoted = Pretty.quote o Pretty.str;
967e6c2578f2 turned string_of_mixfix into pretty_mixfix;
wenzelm
parents: 19020
diff changeset
    53
val keyword = Pretty.keyword;
967e6c2578f2 turned string_of_mixfix into pretty_mixfix;
wenzelm
parents: 19020
diff changeset
    54
val parens = Pretty.enclose "(" ")";
967e6c2578f2 turned string_of_mixfix into pretty_mixfix;
wenzelm
parents: 19020
diff changeset
    55
val brackets = Pretty.enclose "[" "]";
967e6c2578f2 turned string_of_mixfix into pretty_mixfix;
wenzelm
parents: 19020
diff changeset
    56
val int = Pretty.str o string_of_int;
967e6c2578f2 turned string_of_mixfix into pretty_mixfix;
wenzelm
parents: 19020
diff changeset
    57
967e6c2578f2 turned string_of_mixfix into pretty_mixfix;
wenzelm
parents: 19020
diff changeset
    58
in
11920
6833cadb4062 added string_of_mixfix;
wenzelm
parents: 11651
diff changeset
    59
19271
967e6c2578f2 turned string_of_mixfix into pretty_mixfix;
wenzelm
parents: 19020
diff changeset
    60
fun pretty_mixfix NoSyn = Pretty.str ""
967e6c2578f2 turned string_of_mixfix into pretty_mixfix;
wenzelm
parents: 19020
diff changeset
    61
  | pretty_mixfix (Mixfix (s, ps, p)) =
967e6c2578f2 turned string_of_mixfix into pretty_mixfix;
wenzelm
parents: 19020
diff changeset
    62
      parens (Pretty.breaks [quoted s, brackets (Pretty.commas (map int ps)), int p])
967e6c2578f2 turned string_of_mixfix into pretty_mixfix;
wenzelm
parents: 19020
diff changeset
    63
  | pretty_mixfix (Delimfix s) = parens [quoted s]
35130
0991c84e8dcf renamed InfixName to Infix etc.;
wenzelm
parents: 35129
diff changeset
    64
  | pretty_mixfix (Infix (s, p)) = parens (Pretty.breaks [keyword "infix", quoted s, int p])
0991c84e8dcf renamed InfixName to Infix etc.;
wenzelm
parents: 35129
diff changeset
    65
  | pretty_mixfix (Infixl (s, p)) = parens (Pretty.breaks [keyword "infixl", quoted s, int p])
0991c84e8dcf renamed InfixName to Infix etc.;
wenzelm
parents: 35129
diff changeset
    66
  | pretty_mixfix (Infixr (s, p)) = parens (Pretty.breaks [keyword "infixl", quoted s, int p])
19271
967e6c2578f2 turned string_of_mixfix into pretty_mixfix;
wenzelm
parents: 19020
diff changeset
    67
  | pretty_mixfix (Binder (s, p1, p2)) =
967e6c2578f2 turned string_of_mixfix into pretty_mixfix;
wenzelm
parents: 19020
diff changeset
    68
      parens (Pretty.breaks [keyword "binder", quoted s, brackets [int p1], int p2])
967e6c2578f2 turned string_of_mixfix into pretty_mixfix;
wenzelm
parents: 19020
diff changeset
    69
  | pretty_mixfix Structure = parens [keyword "structure"];
967e6c2578f2 turned string_of_mixfix into pretty_mixfix;
wenzelm
parents: 19020
diff changeset
    70
967e6c2578f2 turned string_of_mixfix into pretty_mixfix;
wenzelm
parents: 19020
diff changeset
    71
end;
11920
6833cadb4062 added string_of_mixfix;
wenzelm
parents: 11651
diff changeset
    72
6833cadb4062 added string_of_mixfix;
wenzelm
parents: 11651
diff changeset
    73
12531
adc39b100e9a improved mixfix_args;
wenzelm
parents: 12512
diff changeset
    74
(* syntax specifications *)
384
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
    75
4053
c88d0d5ae806 added mixfix_args;
wenzelm
parents: 3829
diff changeset
    76
fun mixfix_args NoSyn = 0
42288
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
    77
  | mixfix_args (Mixfix (sy, _, _)) = Syntax_Ext.mfix_args sy
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
    78
  | mixfix_args (Delimfix sy) = Syntax_Ext.mfix_args sy
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
    79
  | mixfix_args (Infix (sy, _)) = 2 + Syntax_Ext.mfix_args sy
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
    80
  | mixfix_args (Infixl (sy, _)) = 2 + Syntax_Ext.mfix_args sy
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
    81
  | mixfix_args (Infixr (sy, _)) = 2 + Syntax_Ext.mfix_args sy
18673
fad60fe1565c mixfix: added Structure;
wenzelm
parents: 18565
diff changeset
    82
  | mixfix_args (Binder _) = 1
fad60fe1565c mixfix: added Structure;
wenzelm
parents: 18565
diff changeset
    83
  | mixfix_args Structure = 0;
4053
c88d0d5ae806 added mixfix_args;
wenzelm
parents: 3829
diff changeset
    84
22709
9ab51bac6287 removed obsolete TypeInfer.logicT -- use dummyT;
wenzelm
parents: 22702
diff changeset
    85
fun mixfixT (Binder _) = (dummyT --> dummyT) --> dummyT
9ab51bac6287 removed obsolete TypeInfer.logicT -- use dummyT;
wenzelm
parents: 22702
diff changeset
    86
  | mixfixT mx = replicate (mixfix_args mx) dummyT ---> dummyT;
22702
372da033ed93 added mixfixT (from type_infer.ML);
wenzelm
parents: 21805
diff changeset
    87
4053
c88d0d5ae806 added mixfix_args;
wenzelm
parents: 3829
diff changeset
    88
384
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
    89
(* syn_ext_types *)
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
    90
42288
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
    91
fun make_type n = replicate n Syntax_Ext.typeT ---> Syntax_Ext.typeT;
35412
b8dead547d9e more uniform treatment of syntax for types vs. consts;
wenzelm
parents: 35390
diff changeset
    92
14903
d264b8ad3eec removed separate logtypes field of syntax;
wenzelm
parents: 14855
diff changeset
    93
fun syn_ext_types type_decls =
384
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
    94
  let
42288
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
    95
    fun mk_infix sy ty t p1 p2 p3 = Syntax_Ext.Mfix ("(_ " ^ sy ^ "/ _)", ty, t, [p1, p2], p3);
384
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
    96
35129
ed24ba6f69aa discontinued unnamed infix syntax;
wenzelm
parents: 32786
diff changeset
    97
    fun mfix_of (_, _, NoSyn) = NONE
42288
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
    98
      | mfix_of (t, ty, Mixfix (sy, ps, p)) = SOME (Syntax_Ext.Mfix (sy, ty, t, ps, p))
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
    99
      | mfix_of (t, ty, Delimfix sy) = SOME (Syntax_Ext.Mfix (sy, ty, t, [], Syntax_Ext.max_pri))
35412
b8dead547d9e more uniform treatment of syntax for types vs. consts;
wenzelm
parents: 35390
diff changeset
   100
      | mfix_of (t, ty, Infix (sy, p)) = SOME (mk_infix sy ty t (p + 1) (p + 1) p)
b8dead547d9e more uniform treatment of syntax for types vs. consts;
wenzelm
parents: 35390
diff changeset
   101
      | mfix_of (t, ty, Infixl (sy, p)) = SOME (mk_infix sy ty t p (p + 1) p)
b8dead547d9e more uniform treatment of syntax for types vs. consts;
wenzelm
parents: 35390
diff changeset
   102
      | mfix_of (t, ty, Infixr (sy, p)) = SOME (mk_infix sy ty t (p + 1) p p)
42130
e10e2cce85c8 removed unclear comments stemming from ed24ba6f69aa;
wenzelm
parents: 37216
diff changeset
   103
      | mfix_of (t, _, _) = error ("Bad mixfix declaration for " ^ quote t);
384
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
   104
42288
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
   105
    fun check_args (_, ty, _) (SOME (mfix as Syntax_Ext.Mfix (sy, _, _, _, _))) =
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
   106
          if length (Term.binder_types ty) = Syntax_Ext.mfix_args sy then ()
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
   107
          else Syntax_Ext.err_in_mfix "Bad number of type constructor arguments" mfix
35351
7425aece4ee3 allow general mixfix syntax for type constructors;
wenzelm
parents: 35130
diff changeset
   108
      | check_args _ NONE = ();
7425aece4ee3 allow general mixfix syntax for type constructors;
wenzelm
parents: 35130
diff changeset
   109
7425aece4ee3 allow general mixfix syntax for type constructors;
wenzelm
parents: 35130
diff changeset
   110
    val mfix = map mfix_of type_decls;
7425aece4ee3 allow general mixfix syntax for type constructors;
wenzelm
parents: 35130
diff changeset
   111
    val _ = map2 check_args type_decls mfix;
35129
ed24ba6f69aa discontinued unnamed infix syntax;
wenzelm
parents: 32786
diff changeset
   112
    val xconsts = map #1 type_decls;
42288
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
   113
  in Syntax_Ext.syn_ext (map_filter I mfix) xconsts ([], [], [], []) ([], []) end;
384
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
   114
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
   115
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
   116
(* syn_ext_consts *)
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
   117
15751
65e4790c7914 identify binder translations only once (admits remove);
wenzelm
parents: 15570
diff changeset
   118
val binder_stamp = stamp ();
21534
68f805e9db0b Binder: syntax const is determined by binder_name, not its syntax;
wenzelm
parents: 20892
diff changeset
   119
val binder_name = suffix "_binder";
15751
65e4790c7914 identify binder translations only once (admits remove);
wenzelm
parents: 15570
diff changeset
   120
14903
d264b8ad3eec removed separate logtypes field of syntax;
wenzelm
parents: 14855
diff changeset
   121
fun syn_ext_consts is_logtype const_decls =
384
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
   122
  let
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
   123
    fun mk_infix sy ty c p1 p2 p3 =
42288
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
   124
      [Syntax_Ext.Mfix ("op " ^ sy, ty, c, [], Syntax_Ext.max_pri),
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
   125
       Syntax_Ext.Mfix ("(_ " ^ sy ^ "/ _)", ty, c, [p1, p2], p3)];
384
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
   126
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
   127
    fun binder_typ _ (Type ("fun", [Type ("fun", [_, ty2]), ty3])) =
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
   128
          [Type ("idts", []), ty2] ---> ty3
14903
d264b8ad3eec removed separate logtypes field of syntax;
wenzelm
parents: 14855
diff changeset
   129
      | binder_typ c _ = error ("Bad type of binder: " ^ quote c);
384
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
   130
35129
ed24ba6f69aa discontinued unnamed infix syntax;
wenzelm
parents: 32786
diff changeset
   131
    fun mfix_of (_, _, NoSyn) = []
42288
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
   132
      | mfix_of (c, ty, Mixfix (sy, ps, p)) = [Syntax_Ext.Mfix (sy, ty, c, ps, p)]
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
   133
      | mfix_of (c, ty, Delimfix sy) = [Syntax_Ext.Mfix (sy, ty, c, [], Syntax_Ext.max_pri)]
35130
0991c84e8dcf renamed InfixName to Infix etc.;
wenzelm
parents: 35129
diff changeset
   134
      | mfix_of (c, ty, Infix (sy, p)) = mk_infix sy ty c (p + 1) (p + 1) p
0991c84e8dcf renamed InfixName to Infix etc.;
wenzelm
parents: 35129
diff changeset
   135
      | mfix_of (c, ty, Infixl (sy, p)) = mk_infix sy ty c p (p + 1) p
0991c84e8dcf renamed InfixName to Infix etc.;
wenzelm
parents: 35129
diff changeset
   136
      | mfix_of (c, ty, Infixr (sy, p)) = mk_infix sy ty c (p + 1) p p
35129
ed24ba6f69aa discontinued unnamed infix syntax;
wenzelm
parents: 32786
diff changeset
   137
      | mfix_of (c, ty, Binder (sy, p, q)) =
42288
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
   138
          [Syntax_Ext.Mfix ("(3" ^ sy ^ "_./ _)", binder_typ c ty, (binder_name c), [0, p], q)]
42130
e10e2cce85c8 removed unclear comments stemming from ed24ba6f69aa;
wenzelm
parents: 37216
diff changeset
   139
      | mfix_of (c, _, _) = error ("Bad mixfix declaration for " ^ quote c);
384
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
   140
21534
68f805e9db0b Binder: syntax const is determined by binder_name, not its syntax;
wenzelm
parents: 20892
diff changeset
   141
    fun binder (c, _, Binder _) = SOME (binder_name c, c)
15531
08c8dad8e399 Deleted Library.option type.
skalberg
parents: 15421
diff changeset
   142
      | binder _ = NONE;
384
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
   143
19482
9f11af8f7ef9 tuned basic list operators (flat, maps, map_filter);
wenzelm
parents: 19467
diff changeset
   144
    val mfix = maps mfix_of const_decls;
35129
ed24ba6f69aa discontinued unnamed infix syntax;
wenzelm
parents: 32786
diff changeset
   145
    val xconsts = map #1 const_decls;
19482
9f11af8f7ef9 tuned basic list operators (flat, maps, map_filter);
wenzelm
parents: 19467
diff changeset
   146
    val binders = map_filter binder const_decls;
35129
ed24ba6f69aa discontinued unnamed infix syntax;
wenzelm
parents: 32786
diff changeset
   147
    val binder_trs = binders
42288
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
   148
      |> map (Syntax_Ext.stamp_trfun binder_stamp o apsnd K o Syntax_Trans.mk_binder_tr);
35129
ed24ba6f69aa discontinued unnamed infix syntax;
wenzelm
parents: 32786
diff changeset
   149
    val binder_trs' = binders
42288
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
   150
      |> map (Syntax_Ext.stamp_trfun binder_stamp o
42284
326f57825e1a explicit structure Syntax_Trans;
wenzelm
parents: 42268
diff changeset
   151
          apsnd (K o Syntax_Trans.non_typed_tr') o Syntax_Trans.mk_binder_tr' o swap);
14903
d264b8ad3eec removed separate logtypes field of syntax;
wenzelm
parents: 14855
diff changeset
   152
  in
42288
2074b31650e6 discontinued special treatment of structure Syntax_Ext (formerly Syn_Ext);
wenzelm
parents: 42287
diff changeset
   153
    Syntax_Ext.syn_ext' true is_logtype
42268
01401287c3f7 discontinued user-defined token translations;
wenzelm
parents: 42130
diff changeset
   154
      mfix xconsts ([], binder_trs, binder_trs', []) ([], [])
14903
d264b8ad3eec removed separate logtypes field of syntax;
wenzelm
parents: 14855
diff changeset
   155
  end;
384
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
   156
a8d204d8071d support for new style mixfix annotations;
wenzelm
parents:
diff changeset
   157
end;
42287
d98eb048a2e4 discontinued special treatment of structure Mixfix;
wenzelm
parents: 42284
diff changeset
   158
d98eb048a2e4 discontinued special treatment of structure Mixfix;
wenzelm
parents: 42284
diff changeset
   159
structure Basic_Mixfix: BASIC_MIXFIX = Mixfix;
d98eb048a2e4 discontinued special treatment of structure Mixfix;
wenzelm
parents: 42284
diff changeset
   160
open Basic_Mixfix;
d98eb048a2e4 discontinued special treatment of structure Mixfix;
wenzelm
parents: 42284
diff changeset
   161