simple.cc - generated code example
[prop.git] / docs / refman.toc
blob59aebe170101450a6b7689f167aa4f536fbeadb7
1 \protect \contentsline {section}{\protect \numberline {1}Introduction}{4}
2 \protect \contentsline {subsection}{\protect \numberline {1.1}Availability}{4}
3 \protect \contentsline {subsection}{\protect \numberline {1.2}Organization of this Reference Manual}{4}
4 \protect \contentsline {section}{\protect \numberline {2}General Concepts}{5}
5 \protect \contentsline {subsection}{\protect \numberline {2.1}Syntactic Conventions}{5}
6 \protect \contentsline {subsection}{\protect \numberline {2.2}Basic syntactic classes}{5}
7 \protect \contentsline {subsection}{\protect \numberline {2.3}Literals}{5}
8 \protect \contentsline {subsection}{\protect \numberline {2.4}The {\bsf Prop}{} Language}{5}
9 \protect \contentsline {section}{\protect \numberline {3}Lexer and Parser Generation}{7}
10 \protect \contentsline {subsection}{\protect \numberline {3.1}Lexer Specification}{7}
11 \protect \contentsline {subsubsection}{\protect \numberline {3.1.1}Regular expressions}{7}
12 \protect \contentsline {subsubsection}{\protect \numberline {3.1.2}Lexeme}{8}
13 \protect \contentsline {subsubsection}{\protect \numberline {3.1.3}Lexeme class}{8}
14 \protect \contentsline {subsubsection}{\protect \numberline {3.1.4}Tokens}{9}
15 \protect \contentsline {subsubsection}{\protect \numberline {3.1.5}The {\protect \tt matchscan} statement}{9}
16 \protect \contentsline {subsubsection}{\protect \numberline {3.1.6}Class {\protect \tt LexerBuffer}}{11}
17 \protect \contentsline {subsubsection}{\protect \numberline {3.1.7}Class {\protect \tt IOLexerBuffer}}{12}
18 \protect \contentsline {subsubsection}{\protect \numberline {3.1.8}Class {\protect \tt IOLexerStack}}{12}
19 \protect \contentsline {subsection}{\protect \numberline {3.2}Parser Specification}{13}
20 \protect \contentsline {subsubsection}{\protect \numberline {3.2.1}Syntax class}{13}
21 \protect \contentsline {subsubsection}{\protect \numberline {3.2.2}Syntax declaration}{13}
22 \protect \contentsline {subsubsection}{\protect \numberline {3.2.3}Precedence}{14}
23 \protect \contentsline {subsubsection}{\protect \numberline {3.2.4}{\protect \tt expect:} $n$}{14}
24 \protect \contentsline {subsubsection}{\protect \numberline {3.2.5}Production rules}{15}
25 \protect \contentsline {subsubsection}{\protect \numberline {3.2.6}Parser report}{16}
26 \protect \contentsline {subsubsection}{\protect \numberline {3.2.7}Interfacing with the generated lexer}{16}
27 \protect \contentsline {subsection}{\protect \numberline {3.3}Debugging Parsers}{16}
28 \protect \contentsline {section}{\protect \numberline {4}Algebraic Datatypes and Pattern Matching}{17}
29 \protect \contentsline {subsection}{\protect \numberline {4.1}A quick tour of pattern matching}{17}
30 \protect \contentsline {subsubsection}{\protect \numberline {4.1.1}Pattern matching versus object-oriented style}{18}
31 \protect \contentsline {subsubsection}{\protect \numberline {4.1.2}More examples}{19}
32 \protect \contentsline {subsubsection}{\protect \numberline {4.1.3}Variants of match}{22}
33 \protect \contentsline {subsection}{\protect \numberline {4.2}Algebraic Datatypes}{23}
34 \protect \contentsline {subsubsection}{\protect \numberline {4.2.1}Instantiating a datatype}{25}
35 \protect \contentsline {subsection}{\protect \numberline {4.3}Pattern Matching}{25}
36 \protect \contentsline {paragraph}{Cost minimization}{26}
37 \protect \contentsline {paragraph}{Match all rules}{26}
38 \protect \contentsline {paragraph}{Repetition}{26}
39 \protect \contentsline {paragraph}{Pattern syntax}{26}
40 \protect \contentsline {subsection}{\protect \numberline {4.4}Refining a datatype}{27}
41 \protect \contentsline {subsection}{\protect \numberline {4.5}Memory management}{29}
42 \protect \contentsline {subsubsection}{\protect \numberline {4.5.1}Garbage collection}{29}
43 \protect \contentsline {subsubsection}{\protect \numberline {4.5.2}Persistence}{30}
44 \protect \contentsline {section}{\protect \numberline {5}Inference}{32}
45 \protect \contentsline {subsection}{\protect \numberline {5.1}An Example}{32}
46 \protect \contentsline {subsubsection}{\protect \numberline {5.1.1}Another example}{33}
47 \protect \contentsline {subsection}{\protect \numberline {5.2}Inference Class}{33}
48 \protect \contentsline {subsection}{\protect \numberline {5.3}Inference Rules}{34}
49 \protect \contentsline {section}{\protect \numberline {6}Tree Rewriting}{35}
50 \protect \contentsline {subsection}{\protect \numberline {6.1}A rewriting example}{35}
51 \protect \contentsline {subsubsection}{\protect \numberline {6.1.1}Conditional rewriting and actions}{36}
52 \protect \contentsline {subsection}{\protect \numberline {6.2}Rewrite class}{37}
53 \protect \contentsline {subsection}{\protect \numberline {6.3}Rewriting rules}{37}
54 \protect \contentsline {subsection}{\protect \numberline {6.4}Rewriting modifiers}{38}
55 \protect \contentsline {subsubsection}{\protect \numberline {6.4.1}Rewriting modifier example}{38}
56 \protect \contentsline {subsection}{\protect \numberline {6.5}The {\protect \tt rewrite} statement}{40}
57 \protect \contentsline {subsubsection}{\protect \numberline {6.5.1}Rewriting modes}{41}
58 \protect \contentsline {subsubsection}{\protect \numberline {6.5.2}State caching optimization}{41}
59 \protect \contentsline {subsubsection}{\protect \numberline {6.5.3}Specifying secondary indices}{42}
60 \protect \contentsline {subsubsection}{\protect \numberline {6.5.4}Using an internal index}{42}
61 \protect \contentsline {subsubsection}{\protect \numberline {6.5.5}Using an external index}{43}
62 \protect \contentsline {paragraph}{Class {\protect \tt RewriteCache}}{44}
63 \protect \contentsline {paragraph}{Class {\protect \tt GCRewriteCache}}{44}
64 \protect \contentsline {subsection}{\protect \numberline {6.6}Short circuiting rewrite paths with {\protect \tt cutrewrite}}{45}
65 \protect \contentsline {subsection}{\protect \numberline {6.7}Conditional failure with {\protect \tt failrewrite}}{46}
66 \protect \contentsline {subsection}{\protect \numberline {6.8}Confluence and termination}{46}
67 \protect \contentsline {subsection}{\protect \numberline {6.9}Debugging Tree Rewriting}{47}
68 \protect \contentsline {subsection}{\protect \numberline {6.10}Optimizing Tree Rewriting}{47}
69 \protect \contentsline {section}{\protect \numberline {7}User defined datatypes: Views}{49}
70 \protect \contentsline {subsection}{\protect \numberline {7.1}A first example}{49}
71 \protect \contentsline {subsection}{\protect \numberline {7.2}Another view example}{51}
72 \protect \contentsline {subsection}{\protect \numberline {7.3}Syntax of view definitions}{52}
73 \protect \contentsline {section}{\protect \numberline {8}Graph Types and Graph Rewriting}{54}
74 \protect \contentsline {subsection}{\protect \numberline {8.1}Graph Types}{54}
75 \protect \contentsline {subsection}{\protect \numberline {8.2}The Graph Interface}{54}
76 \protect \contentsline {subsection}{\protect \numberline {8.3}Set Formalisms}{54}
77 \protect \contentsline {subsection}{\protect \numberline {8.4}Graph Rewriting}{55}
78 \protect \contentsline {section}{\protect \numberline {9}Running the Translator}{56}
79 \protect \contentsline {subsection}{\protect \numberline {9.1}Options}{56}
80 \protect \contentsline {subsection}{\protect \numberline {9.2}Error Messages}{57}
81 \protect \contentsline {section}{\protect \numberline {A}Garbage Collection in the {\protect \sf Prop} Library}{63}
82 \protect \contentsline {subsection}{\protect \numberline {A.1}Introduction}{63}
83 \protect \contentsline {subsection}{\protect \numberline {A.2}The Framework}{63}
84 \protect \contentsline {subsection}{\protect \numberline {A.3}Our Framework}{63}
85 \protect \contentsline {subsection}{\protect \numberline {A.4}The Implementation}{64}
86 \protect \contentsline {subsection}{\protect \numberline {A.5}Architecture}{64}
87 \protect \contentsline {subsection}{\protect \numberline {A.6}The Programmatic Interface}{64}
88 \protect \contentsline {subsection}{\protect \numberline {A.7}Memory Allocation}{65}
89 \protect \contentsline {subsection}{\protect \numberline {A.8}The GC Protocol}{66}
90 \protect \contentsline {subsection}{\protect \numberline {A.9}Messages and Statistics}{66}
91 \protect \contentsline {subsection}{\protect \numberline {A.10}The Bartlett style mostly copying collector}{68}
92 \protect \contentsline {subsection}{\protect \numberline {A.11}The Mark Sweep collector}{68}
93 \protect \contentsline {subsection}{\protect \numberline {A.12}Finalization}{68}
94 \protect \contentsline {subsubsection}{\protect \numberline {A.12.1}Weak Pointers}{69}
95 \protect \contentsline {subsubsection}{\protect \numberline {A.12.2}The Heap Walker}{70}