equal
deleted
inserted
replaced
1034 subsection \<open>Abstract syntax trees \label{sec:ast}\<close> |
1034 subsection \<open>Abstract syntax trees \label{sec:ast}\<close> |
1035 |
1035 |
1036 text \<open>The ML datatype @{ML_type Ast.ast} explicitly represents the |
1036 text \<open>The ML datatype @{ML_type Ast.ast} explicitly represents the |
1037 intermediate AST format that is used for syntax rewriting |
1037 intermediate AST format that is used for syntax rewriting |
1038 (\secref{sec:syn-trans}). It is defined in ML as follows: |
1038 (\secref{sec:syn-trans}). It is defined in ML as follows: |
1039 \begin{ttbox} |
1039 @{verbatim [display] |
1040 datatype ast = |
1040 \<open>datatype ast = |
1041 Constant of string | |
1041 Constant of string | |
1042 Variable of string | |
1042 Variable of string | |
1043 Appl of ast list |
1043 Appl of ast list\<close>} |
1044 \end{ttbox} |
|
1045 |
1044 |
1046 An AST is either an atom (constant or variable) or a list of (at |
1045 An AST is either an atom (constant or variable) or a list of (at |
1047 least two) subtrees. Occasional diagnostic output of ASTs uses |
1046 least two) subtrees. Occasional diagnostic output of ASTs uses |
1048 notation that resembles S-expression of LISP. Constant atoms are |
1047 notation that resembles S-expression of LISP. Constant atoms are |
1049 shown as quoted strings, variable atoms as non-quoted strings and |
1048 shown as quoted strings, variable atoms as non-quoted strings and |