111 Ignoring parse \AST{} translations, parse trees are transformed to \AST{}s |
111 Ignoring parse \AST{} translations, parse trees are transformed to \AST{}s |
112 by stripping out delimiters and copy productions. More precisely, the |
112 by stripping out delimiters and copy productions. More precisely, the |
113 mapping $\astofpt{-}$ is derived from the productions as follows: |
113 mapping $\astofpt{-}$ is derived from the productions as follows: |
114 \begin{itemize} |
114 \begin{itemize} |
115 \item Name tokens: $\astofpt{t} = \Variable s$, where $t$ is an \ndx{id}, |
115 \item Name tokens: $\astofpt{t} = \Variable s$, where $t$ is an \ndx{id}, |
116 \ndx{var}, \ndx{tid}, \ndx{tvar}, \ndx{xnum} or \ndx{xstr} token, and $s$ |
116 \ndx{var}, \ndx{tid}, \ndx{tvar}, \ndx{num}, \ndx{xnum} or \ndx{xstr} token, |
117 its associated string. Note that for {\tt xstr} this does not include the |
117 and $s$ its associated string. Note that for {\tt xstr} this does not |
118 quotes. |
118 include the quotes. |
119 |
119 |
120 \item Copy productions:\index{productions!copy} |
120 \item Copy productions:\index{productions!copy} |
121 $\astofpt{\ldots P \ldots} = \astofpt{P}$. Here $\ldots$ stands for |
121 $\astofpt{\ldots P \ldots} = \astofpt{P}$. Here $\ldots$ stands for |
122 strings of delimiters, which are discarded. $P$ stands for the single |
122 strings of delimiters, which are discarded. $P$ stands for the single |
123 constituent that is not a delimiter; it is either a nonterminal symbol or |
123 constituent that is not a delimiter; it is either a nonterminal symbol or |
527 non-rule \AST{}s behave like {\tt Constant}s. Recall that \AST{}s are not |
527 non-rule \AST{}s behave like {\tt Constant}s. Recall that \AST{}s are not |
528 far removed from parse trees; at this level it is not yet known which |
528 far removed from parse trees; at this level it is not yet known which |
529 identifiers will become constants, bounds, frees, types or classes. As |
529 identifiers will become constants, bounds, frees, types or classes. As |
530 \S\ref{sec:asts} describes, former parse tree heads appear in \AST{}s as |
530 \S\ref{sec:asts} describes, former parse tree heads appear in \AST{}s as |
531 {\tt Constant}s, while the name tokens \ndx{id}, \ndx{var}, \ndx{tid}, |
531 {\tt Constant}s, while the name tokens \ndx{id}, \ndx{var}, \ndx{tid}, |
532 \ndx{tvar}, \ndx{xnum} and \ndx{xstr} become {\tt Variable}s. On the other |
532 \ndx{tvar}, \ndx{num}, \ndx{xnum} and \ndx{xstr} become {\tt Variable}s. On the other |
533 hand, when \AST{}s generated from terms for printing, all constants and type |
533 hand, when \AST{}s generated from terms for printing, all constants and type |
534 constructors become {\tt Constant}s; see \S\ref{sec:asts}. Thus \AST{}s may |
534 constructors become {\tt Constant}s; see \S\ref{sec:asts}. Thus \AST{}s may |
535 contain a messy mixture of {\tt Variable}s and {\tt Constant}s. This is |
535 contain a messy mixture of {\tt Variable}s and {\tt Constant}s. This is |
536 insignificant at macro level because matching treats them alike. |
536 insignificant at macro level because matching treats them alike. |
537 |
537 |