doc-src/Ref/defining.tex
changeset 46284 6233d0b74d71
parent 42840 e87888b4152f
child 46290 465851ba524e
equal deleted inserted replaced
46283:d90a650a5fb9 46284:6233d0b74d71
   222 \endgroup
   222 \endgroup
   223 
   223 
   224 \index{mixfix declarations|)}
   224 \index{mixfix declarations|)}
   225 
   225 
   226 
   226 
   227 \section{*Alternative print modes} \label{sec:prmodes}
       
   228 \index{print modes|(}
       
   229 %
       
   230 Isabelle's pretty printer supports alternative output syntaxes.  These
       
   231 may be used independently or in cooperation.  The currently active
       
   232 print modes (with precedence from left to right) are determined by a
       
   233 reference variable.
       
   234 \begin{ttbox}\index{*print_mode}
       
   235 print_mode: string list ref
       
   236 \end{ttbox}
       
   237 Initially this may already contain some print mode identifiers,
       
   238 depending on how Isabelle has been invoked (e.g.\ by some user
       
   239 interface).  So changes should be incremental --- adding or deleting
       
   240 modes relative to the current value.
       
   241 
       
   242 Any \ML{} string is a legal print mode identifier, without any predeclaration
       
   243 required.  The following names should be considered reserved, though:
       
   244 \texttt{""} (the empty string), \texttt{symbols}, \texttt{xsymbols}, and
       
   245 \texttt{latex}.
       
   246 
       
   247 There is a separate table of mixfix productions for pretty printing
       
   248 associated with each print mode.  The currently active ones are
       
   249 conceptually just concatenated from left to right, with the standard
       
   250 syntax output table always coming last as default.  Thus mixfix
       
   251 productions of preceding modes in the list may override those of later
       
   252 ones.
       
   253 
       
   254 \medskip The canonical application of print modes is optional printing
       
   255 of mathematical symbols from a special screen font instead of {\sc
       
   256   ascii}.  Another example is to re-use Isabelle's advanced
       
   257 $\lambda$-term printing mechanisms to generate completely different
       
   258 output, say for interfacing external tools like \rmindex{model
       
   259   checkers} (see also \texttt{HOL/Modelcheck}).
       
   260 
       
   261 \index{print modes|)}
       
   262 
       
   263 
       
   264 \section{Ambiguity of parsed expressions} \label{sec:ambiguity}
   227 \section{Ambiguity of parsed expressions} \label{sec:ambiguity}
   265 \index{ambiguity!of parsed expressions}
   228 \index{ambiguity!of parsed expressions}
   266 
   229 
   267 To keep the grammar small and allow common productions to be shared
   230 To keep the grammar small and allow common productions to be shared
   268 all logical types (except {\tt prop}) are internally represented
   231 all logical types (except {\tt prop}) are internally represented