src/Doc/Isar_Ref/Inner_Syntax.thy
changeset 81170 2d73c3287bd3
parent 81121 7cacedbddba7
child 81178 8e7bd0566759
equal deleted inserted replaced
81169:6b1d5b7ef45e 81170:2d73c3287bd3
  1151 
  1151 
  1152     constdecl: @{syntax name} '::' @{syntax type} @{syntax mixfix}?
  1152     constdecl: @{syntax name} '::' @{syntax type} @{syntax mixfix}?
  1153     ;
  1153     ;
  1154     mode: ('(' ( @{syntax name} | @'output' | @{syntax name} @'output' ) ')')
  1154     mode: ('(' ( @{syntax name} | @'output' | @{syntax name} @'output' ) ')')
  1155     ;
  1155     ;
  1156     syntaxdeps: (((@{syntax name}+) ('==' | '\<rightleftharpoons>'))?) (@{syntax name}+)
  1156     syntaxdeps: (@{syntax name}+) ('==' | '\<rightleftharpoons>') (@{syntax name}+)
  1157     ;
  1157     ;
  1158     transpat: ('(' @{syntax name} ')')? @{syntax string}
  1158     transpat: ('(' @{syntax name} ')')? @{syntax string}
  1159   \<close>
  1159   \<close>
  1160 
  1160 
  1161   \<^descr> @{command "nonterminal"}~\<open>c\<close> declares a type constructor \<open>c\<close> (without
  1161   \<^descr> @{command "nonterminal"}~\<open>c\<close> declares a type constructor \<open>c\<close> (without
  1211   wrt.\ formal entities of the logic: multiple names may be given on both
  1211   wrt.\ formal entities of the logic: multiple names may be given on both
  1212   sides. This tells the inner-syntax engine how to markup concrete syntax, to
  1212   sides. This tells the inner-syntax engine how to markup concrete syntax, to
  1213   support hyperlinks in the browser or editor. It is essentially an abstract
  1213   support hyperlinks in the browser or editor. It is essentially an abstract
  1214   specification of the effect of translation rules (see below) or translation
  1214   specification of the effect of translation rules (see below) or translation
  1215   functions (see \secref{sec:tr-funs}).
  1215   functions (see \secref{sec:tr-funs}).
  1216 
       
  1217   @{command "syntax_types"}~\<open>types\<close> and @{command "syntax_consts"}~\<open>consts\<close>
       
  1218   merely declare formal entities to the inner-syntax engine, without any
       
  1219   dependencies yet.
       
  1220 
  1216 
  1221   \<^descr> @{command "translations"}~\<open>rules\<close> specifies syntactic translation rules
  1217   \<^descr> @{command "translations"}~\<open>rules\<close> specifies syntactic translation rules
  1222   (i.e.\ macros) as first-order rewrite rules on ASTs (\secref{sec:ast}). The
  1218   (i.e.\ macros) as first-order rewrite rules on ASTs (\secref{sec:ast}). The
  1223   theory context maintains two independent lists translation rules: parse
  1219   theory context maintains two independent lists translation rules: parse
  1224   rules (\<^verbatim>\<open>=>\<close> or \<open>\<rightharpoonup>\<close>) and print rules (\<^verbatim>\<open><=\<close> or \<open>\<leftharpoondown>\<close>). For convenience, both
  1220   rules (\<^verbatim>\<open>=>\<close> or \<open>\<rightharpoonup>\<close>) and print rules (\<^verbatim>\<open><=\<close> or \<open>\<leftharpoondown>\<close>). For convenience, both