organization.html 8.4 KB

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