1 | <html> |
---|
2 | <head> |
---|
3 | <title>Organization</title> |
---|
4 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
5 | <link rel="stylesheet" href="theme/style.css" type="text/css"> |
---|
6 | </head> |
---|
7 | |
---|
8 | <body> |
---|
9 | <table width="100%" border="0" background="theme/bkd2.gif" cellspacing="2"> |
---|
10 | <tr> |
---|
11 | <td width="10"> |
---|
12 | </td> |
---|
13 | <td width="85%"> <font size="6" face="Verdana, Arial, Helvetica, sans-serif"><b>Organization</b></font> |
---|
14 | </td> |
---|
15 | <td width="112"><a href="http://spirit.sf.net"><img src="theme/spirit.gif" width="112" height="48" align="right" border="0"></a></td> |
---|
16 | </tr> |
---|
17 | </table> |
---|
18 | <br> |
---|
19 | <table border="0"> |
---|
20 | <tr> |
---|
21 | <td width="10"></td> |
---|
22 | <td width="30"><a href="../index.html"><img src="theme/u_arr.gif" border="0"></a></td> |
---|
23 | <td width="30"><a href="basic_concepts.html"><img src="theme/l_arr.gif" border="0"></a></td> |
---|
24 | <td width="30"><a href="primitives.html"><img src="theme/r_arr.gif" border="0"></a></td> |
---|
25 | </tr> |
---|
26 | </table> |
---|
27 | <p>The framework is highly modular and is organized in layers:</p> |
---|
28 | <table width="100%" border="0"> |
---|
29 | <tr> |
---|
30 | <td><div align="center"> |
---|
31 | <table width="40%" border="1" cellpadding="3" cellspacing="3" class="table_cells"> |
---|
32 | <tr> |
---|
33 | <td><div align="center"><font color="#003366"><strong>iterator</strong></font></div></td> |
---|
34 | <td><div align="center"><font color="#003366"><strong>actor</strong></font></div></td> |
---|
35 | </tr> |
---|
36 | </table> |
---|
37 | <font color="#003366" size="3"><br> |
---|
38 | </font></div></td> |
---|
39 | </tr> |
---|
40 | <tr> |
---|
41 | <td><div align="center"> |
---|
42 | <table width="20%" border="1" cellpadding="3" cellspacing="3" class="table_cells"> |
---|
43 | <tr> |
---|
44 | <td><div align="center"><font color="#003366"><strong>debug</strong></font></div></td> |
---|
45 | </tr> |
---|
46 | </table> |
---|
47 | <font color="#003366" size="3"><br> |
---|
48 | </font></div></td> |
---|
49 | </tr> |
---|
50 | <tr> |
---|
51 | <td><div align="center"> |
---|
52 | <table width="75%" border="1" cellpadding="3" cellspacing="3" class="table_cells"> |
---|
53 | <tr> |
---|
54 | <td><div align="center"><font color="#003366"><strong>attribute</strong></font></div></td> |
---|
55 | <td><div align="center"><font color="#003366"><strong>dynamic</strong></font></div></td> |
---|
56 | <td><div align="center"><font color="#003366"><strong>error_handling</strong></font></div></td> |
---|
57 | <td><div align="center"><font color="#003366"><strong>symbols</strong></font></div></td> |
---|
58 | <td><div align="center"><font color="#003366"><strong>tree</strong></font></div></td> |
---|
59 | <td><div align="center"><font color="#003366"><strong>utility</strong></font></div></td> |
---|
60 | </tr> |
---|
61 | </table> |
---|
62 | <font color="#003366" size="3"><br> |
---|
63 | </font></div></td> |
---|
64 | </tr> |
---|
65 | <tr> |
---|
66 | <td><div align="center"> |
---|
67 | <table width="20%" border="1" cellpadding="3" cellspacing="3" class="table_cells"> |
---|
68 | <tr> |
---|
69 | <td><div align="center"><font color="#003366"><strong>meta</strong></font></div></td> |
---|
70 | </tr> |
---|
71 | </table> |
---|
72 | <font color="#003366"><br> |
---|
73 | </font></div></td> |
---|
74 | </tr> |
---|
75 | <tr> |
---|
76 | <td><div align="center"> |
---|
77 | <table width="85%" border="1" cellpadding="3" cellspacing="3" class="table_cells"> |
---|
78 | <tr> |
---|
79 | <td colspan="4"><div align="center"><font color="#003366"><strong><font size="4">core</font></strong></font></div></td> |
---|
80 | </tr> |
---|
81 | <tr> |
---|
82 | <td><div align="center"><font color="#003366"><strong>scanner</strong></font></div></td> |
---|
83 | <td><div align="center"><font color="#003366"><strong>primitives</strong></font></div></td> |
---|
84 | <td><div align="center"><font color="#003366"><strong>composite</strong></font></div></td> |
---|
85 | <td><div align="center"><font color="#003366"><strong>non_terminal</strong></font></div></td> |
---|
86 | </tr> |
---|
87 | </table> |
---|
88 | </div></td> |
---|
89 | </tr> |
---|
90 | </table> |
---|
91 | <p>Spirit has four layers, plus an independent top layer. The independent layer, |
---|
92 | comprising of actor and iterator, does not rely on the other layers. The framework's |
---|
93 | architecture is completely orthogonal. The relationship among the layers is |
---|
94 | acyclic. Lower layers do not depend nor know the existence of upper layers. |
---|
95 | Modules in a layer do not depend on other modules in the same layer. </p> |
---|
96 | <p>The client may use only the modules that she wants without incurring any compile |
---|
97 | time nor run time penalty. A minimalistic approach is to use only the core as |
---|
98 | is. The highly streamlined core is usable by itself. The core is sufficiently |
---|
99 | suitable for tasks such as micro parsing.</p> |
---|
100 | <p>The <strong>iterator</strong> module is independent of Spirit and may be used |
---|
101 | in other non-Spirit applications. This module is a compilation of stand-alone |
---|
102 | iterators and iterator wrappers compatible with Spirit. |
---|
103 | |
---|
104 | |
---|
105 | Over time, these iterators have been found to be most useful for parsing with Spirit. </p> |
---|
106 | <p>The <strong>actor</strong> module, also independent of Spirit, is a compilation |
---|
107 | of predefined semantic actions that covers the most common semantics processing |
---|
108 | tasks.</p> |
---|
109 | <p>The <strong>debug</strong> module provides library wide parser debugging. This |
---|
110 | module hooks itself up transparently into the core non-intrusively and only |
---|
111 | when necessary.</p> |
---|
112 | <p>The<strong> attribute</strong> module introduces advanced semantic action machinery |
---|
113 | with emphasis on extraction and passing of data up and down the parser hierarchy |
---|
114 | through inherited and synthesized attributes. Attributes may also be used to |
---|
115 | actually control the parsing. Parametric parsers are a form of dynamic parsers |
---|
116 | that changes their behavior at run time based on some attribute or data.</p> |
---|
117 | <p>The <strong>dynamic</strong> module focuses on parsers with behavior that can |
---|
118 | be modified at run-time.</p> |
---|
119 | <p><strong>error_handling</strong>. The framework would not be complete without |
---|
120 | Error Handling. C++'s exception handling mechanism is a perfect match for Spirit |
---|
121 | due to its highly recursive functional nature. C++ Exceptions are used extensively |
---|
122 | by this module for handling errors.</p> |
---|
123 | <p>The<strong> symbols</strong> module focuses on symbol table management. This module |
---|
124 | is rather basic now. The goal is to build a sub-framework that will be able |
---|
125 | to accommodate C++ style multiple scope mechanisms. C++ is a great model for |
---|
126 | the complexity of scoping that perhaps has no parallel in any other language. |
---|
127 | There are classes and inheritance, private, protected and public access restrictions, |
---|
128 | friends, namespaces, using declarations, using directives, Koenig lookup (Argument |
---|
129 | Dependent Lookup) and more. The symbol table functionality we have now will |
---|
130 | be the basis of a complete facility that will attempt to model this.</p> |
---|
131 | <blockquote> |
---|
132 | <p><em><font color="#003366">I wish that I could ever see, a structure as lovely |
---|
133 | as a tree</font></em><font color="#003366">...</font></p> |
---|
134 | </blockquote> |
---|
135 | <p> Parse Tree and Abstract Syntax Tree (AST) generation are handled by the <b>Tree</b> |
---|
136 | module. There are advantages with Parse Trees and Abstract Syntax Trees over |
---|
137 | semantic actions. You can make multiple passes over the data without having |
---|
138 | to re-parse the input. You can perform transformations on the tree. You can |
---|
139 | evaluate things in any order you want, whereas with attribute schemes you have |
---|
140 | to process in a begin to end fashion. You do not have to worry about backtracking |
---|
141 | and action side effects that may occur with an ambiguous grammar.</p> |
---|
142 | <p>The <b>utility</b> module is a set of commonly useful parsers and support classes |
---|
143 | that were found to be useful in handling common tasks such as list processing, |
---|
144 | comments, confix expressions, etc.</p> |
---|
145 | <p><strong>meta</strong>, provides metaprogramming facilities for advanced Spirit |
---|
146 | developers. This module facilitates compile-time and run-time introspection |
---|
147 | of Spirit parsers.</p> |
---|
148 | <table border="0"> |
---|
149 | <tr> |
---|
150 | <td width="10"></td> |
---|
151 | <td width="30"><a href="../index.html"><img src="theme/u_arr.gif" border="0"></a></td> |
---|
152 | <td width="30"><a href="basic_concepts.html"><img src="theme/l_arr.gif" border="0"></a></td> |
---|
153 | <td width="30"><a href="primitives.html"><img src="theme/r_arr.gif" border="0"></a></td> |
---|
154 | </tr> |
---|
155 | </table> |
---|
156 | <br> |
---|
157 | <hr size="1"> |
---|
158 | <p class="copyright">Copyright © 1998-2003 Joel de Guzman<br> |
---|
159 | <br> |
---|
160 | <font size="2">Use, modification and distribution is subject to the Boost Software |
---|
161 | License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
---|
162 | http://www.boost.org/LICENSE_1_0.txt)</font></p> |
---|
163 | <p class="copyright"> </p> |
---|
164 | </body> |
---|
165 | </html> |
---|