PageRenderTime 50ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/Dependencies/boo/lib/antlr-2.7.5/doc/index.html

https://github.com/w4x/boolangstudio
HTML | 335 lines | 318 code | 13 blank | 4 comment | 0 complexity | a4c318430a882c8dc19337537a3ebab6 MD5 | raw file
Possible License(s): GPL-2.0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. <title>ANTLR Reference Manual</title>
  6. </head>
  7. <body bgcolor="#FFFFFF" text="#000000">
  8. <font face="Arial">
  9. <p align="center"><font size="7" face="Courier New"><strong>ANTLR<br>
  10. Reference Manual<br>
  11. </strong></font><br>
  12. <big><big><big><font face="Arial">Credits</font></big></big></big></p>
  13. <p align="center"><font face="Arial">Project Lead and Supreme Dictator<br>
  14. <a href="mailto:parrt@jguru.com"><em>Terence Parr</em></a><br>
  15. University of San Franciso</font></p>
  16. <p align="center"><font face="Arial">Support from<br>
  17. <em><a href="http://www.jguru.com">jGuru.com</a><br>
  18. Your View of the Java Universe</em></font></p>
  19. <p align="center"><font face="Arial">Help with initial coding<br>
  20. <em>John Lilly, <a href="http://www.Empathy.com">Empathy Software</a> </em></font></p>
  21. <p align="center">
  22. <font face="Arial">C++ code generator by<br>
  23. <a href="mailto:pete@yamuna.demon.co.uk">
  24. <em>Peter Wells</em></a> and
  25. <a href="mailto:klaren@cs.utwente.nl">
  26. <em>Ric Klaren</em></a><br>
  27. </font>
  28. </p>
  29. <p align=center>C# code generation by<br>
  30. Micheal Jordan, Kunle Odutola and Anthony Oguntimehin.
  31. <!-- Python credits -->
  32. <p align="center"><a
  33. href="http://www.python.org">Python's</a> universe has been
  34. extended by<br>
  35. <a href="mailto:ora.et.labora@web.de"><em>Wolfgang H&auml;felinger</em></a> and
  36. <a href="mailto:marq.kole@xs4all.nl"><em>Marq Kole</em></a><br>
  37. <p align="center"><font face="Arial">Infrastructure support from <a
  38. href="http://www.perforce.com">Perforce</a>:<br>
  39. The world's best source code control system</font></p>
  40. <p align="center"><font face="Arial">Substantial intellectual effort donated by<br>
  41. <em>
  42. <a href="mailto:Loring.Craymer@jpl.nasa.gov">Loring Craymer</a><br>
  43. <a href="mailto:mzukowski@bco.com">Monty Zukowski </a><br>
  44. <a href="mailto:jcoker@magelang.com">Jim Coker</a><br>
  45. <a href="mailto:thetick@magelang.com">Scott Stanchfield</a><br>
  46. <a href="mailto:johnm@magelang.com">John Mitchell</a><br>
  47. <a href="mailto:flack@cs.purdue.edu">Chapman Flack</a> (UNICODE, streams)</em></font></p>
  48. <p align="center">Source changes for Eclipse and NetBeans by<br>
  49. <a href="mailto:marco@mvmsoft.de">Marco van Meegen</a> and <a href="mailto:brian-l-smith@uiowa.edu">Brian Smith</a></font></p>
  50. <p align="center">&nbsp;</p>
  51. <div align="left"><pre><font face="Arial"><i>ANTLR Version 2.7.5
  52. </i><font
  53. face="Arial" size="2"><em>December 22, 2004</em></font></pre>
  54. <h2>What's ANTLR</h2>
  55. <p><font
  56. face="Arial"><strong>ANTLR</strong>, ANother Tool for Language Recognition, (formerly <strong>PCCTS</strong>)
  57. is a language tool that provides a framework for constructing recognizers, compilers, and
  58. translators from grammatical descriptions containing Java, C++, or C# actions [You can use
  59. PCCTS 1.xx to generate C-based parsers].</font></p>
  60. <p><font face="Arial">Computer language translation has become a common task. While
  61. compilers and tools for traditional computer languages (such as C or Java) are still being
  62. built, their number is dwarfed by the thousands of mini-languages for which recognizers
  63. and translators are being developed. Programmers construct translators for database
  64. formats, graphical data files (e.g., PostScript, AutoCAD), text processing files (e.g.,
  65. HTML, SGML).&nbsp; ANTLR is designed to handle all of your translation tasks.</p>
  66. <p>
  67. <a href="http://www.parr-research.com/~parrt">Terence
  68. Parr</a> has been working on ANTLR since 1989 and, together with his colleagues, has made
  69. a number of fundamental <a href="http://www.antlr.org/contributions.html">contributions</a>
  70. to parsing theory and language tool construction,
  71. leading to the resurgence of LL(k)-based recognition tools.</font>
  72. <p><font face="Arial">Here is a chronological <a href="http://www.antlr.org/history.html">history</a>
  73. and credit list for ANTLR/PCCTS.</font></p>
  74. <p><font face="Arial">See <a href="http://www.antlr.org/rights.html">ANTLR software rights</a>.</font>
  75. <p>Check out <a href="http://www.antlr.org/doc/getting-started.html"><b>Getting started</b></a> for a list of tutorials and get your questions answered at the <a
  76. href="http://www.jguru.com/faq/ANTLR">ANTLR FAQ at jguru.com</a></font></p>
  77. <p align="left"><font face="Arial">See also <a href="http://www.ANTLR.org">http://www.ANTLR.org</a></font> and <a href="glossary.html"><b>glossary</b></a>.
  78. <p><small><font face="Arial"><i>If you are looking for the previous main version (PCCTS
  79. 1.33) of ANTLR rather than the new Java-based version, see <a
  80. href="http://www.ANTLR.org/pccts133.html">Getting started with PCCTS</a>.</i></font></small></p>
  81. <hr>
  82. <font face="Arial">
  83. <p>Download <a href="http://www.antlr.org/download.html">ANTLR</a>.</p>
  84. <p><a href="http://www.antlr.org/blog/CHANGES-2.7.5.txt"><big><big>ANTLR 2.7.5 release notes</big></big></a></p>
  85. <p><big><a href="metalang.html#_bb1">ANTLR Meta-Language</a></big><ul>
  86. <li><a href="metalang.html#_bb2">Meta-Language Vocabulary </a></li>
  87. <li><a href="metalang.html#_bb3">Header Section </a></li>
  88. <li><a href="metalang.html#_bb4">Parser Class Definitions</a></li>
  89. <li><a href="metalang.html#_bb5">Lexical Analyzer Class Definitions</a></li>
  90. <li><a href="metalang.html#_bb6">Tree-parser Class Definitions</a></li>
  91. <li><a href="metalang.html#_bb8">Options Section</a></li>
  92. <li><a href="metalang.html#TokensSection">Tokens Section</a></li>
  93. <li><a href="metalang.html#_bb9">Grammar Inheritance </a></li>
  94. <li><a href="metalang.html#_bb10">Rule Definitions</a></li>
  95. <li><a href="metalang.html#_bb11">Atomic Production elements </a></li>
  96. <li><a href="metalang.html#_bb12">Simple Production elements </a></li>
  97. <li><a href="metalang.html#_bb13">Production Element Operators </a></li>
  98. <li><a href="metalang.html#_bb14">Token Classes</a></li>
  99. <li><a href="metalang.html#_bb15">Predicates </a></li>
  100. <li><a href="metalang.html#_bb16">Element Labels</a></li>
  101. <li><a href="metalang.html#_bb17">EBNF Rule Elements</a></li>
  102. <li><a href="metalang.html#_bb18">Interpretation Of Semantic Actions </a></li>
  103. <li><a href="metalang.html#SemanticPredicates">Semantic Predicates </a></li>
  104. <li><a href="metalang.html#SyntacticPredicates">Syntactic Predicates </a><ul>
  105. <li><a href="metalang.html#_bb21">Fixed depth lookahead and syntactic predicates</a></li>
  106. </ul>
  107. </li>
  108. <li><a href="metalang.html#_bb22">ANTLR Meta-Language Grammar </a></li>
  109. </ul>
  110. <!--index-->
  111. <p><big><a href="lexer.html#Lexical_Analysis_with_ANTLR">Lexical Analysis with ANTLR</a></big>
  112. <ul>
  113. <li><a href="lexer.html#lexicalrules">Lexical Rules</a></li>
  114. <ul>
  115. <li><a href="lexer.html#Skipping_characters">Skipping characters</a></li>
  116. <li><a href="lexer.html#Distinguishing_between_lexer_rules">Distinguishing between lexer rules</a></li>
  117. <li><a href="lexer.html#Return_values">Return values</a></li>
  118. </ul>
  119. <li><a href="lexer.html#Predicated-LL(k)_Lexing">Predicated-LL(k) Lexing</a></li>
  120. <li><a href="lexer.html#Keywords_and_literals">Keywords and literals</a></li>
  121. <li><a href="lexer.html#Common_prefixes">Common prefixes</a></li>
  122. <li><a href="lexer.html#Token_definition_files">Token definition files</a></li>
  123. <li><a href="lexer.html#Character_classes">Character classes</a></li>
  124. <li><a href="lexer.html#Token_Attributes">Token Attributes</a></li>
  125. <li><a href="lexer.html#lexicallookahead">Lexical lookahead and the end-of-token symbol</a></li>
  126. <li><a href="lexer.html#Scanning_Binary_Files">Scanning Binary Files</a></li>
  127. <li><a href="lexer.html#unicode">Scanning Unicode Characters</a></li>
  128. <li><a href="lexer.html#Manipulating_Token_Text_and_Objects">Manipulating Token Text and Objects</a></li>
  129. <ul>
  130. <li><a href="lexer.html#Manipulating_the_Text_of_a_Lexical_Rule">Manipulating the Text of a Lexical Rule</a></li>
  131. <li><a href="lexer.html#Heterogeneous_Token_Object_Streams">Heterogeneous Token Object Streams</a></li>
  132. </ul>
  133. <li><a href="lexer.html#Filtering%20Input%20Streams">Filtering Input Streams</a></li>
  134. <ul>
  135. <li><a href="lexer.html#ANTLR_Masquerading_as_SED">ANTLR Masquerading as SED</a></li>
  136. <li><a href="lexer.html#Nongreedy_Subrules">Nongreedy Subrules</a></li>
  137. <li><a href="lexer.html#Greedy_Subrules">Greedy Subrules</a></li>
  138. <li><a href="lexer.html#Nongreedy_Lexer_Subrules">Nongreedy Lexer Subrules</a></li>
  139. <li><a href="lexer.html#Limitations_of_Nongreedy_Subrules">Limitations of Nongreedy Subrules</a></li>
  140. </ul>
  141. <li><a href="lexer.html#Lexical_States">Lexical States</a></li>
  142. <li><a href="lexer.html#The_End_Of_File_Condition">The End Of File Condition</a></li>
  143. <li><a href="lexer.html#Case_sensitivity">Case sensitivity</a></li>
  144. <li><a href="lexer.html#ignoringwhitespace">Ignoring whitespace in the lexer</a></li>
  145. <li><a href="lexer.html#trackingline">Tracking Line Information</a></li>
  146. <li><a href="lexer.html#trackingcolumn">Tracking Column Information</a></li>
  147. <li><a href="lexer.html#dfacompare">But...We've Always Used Automata For Lexical Analysis!</a></li>
  148. </ul>
  149. <!--/index-->
  150. <p><big><a href="sor.html#_bb1">ANTLR Tree Parsers</a></big><ul>
  151. <li><a href="sor.html#_bb2">What's a tree parser?</a></li>
  152. <li><a href="sor.html#_bb3">What kinds of trees can be parsed?</a></li>
  153. <li><a href="sor.html#_bb4">Tree grammar rules</a> <ul>
  154. <li><a href="sor.html#_bb5">Syntactic predicates</a></li>
  155. <li><a href="sor.html#_bb6">Semantic predicates</a></li>
  156. <li><a href="sor.html#_bb7">An Example Tree Walker</a></li>
  157. </ul>
  158. </li>
  159. <li><a href="sor.html#_bb8">Transformations </a></li>
  160. <ul>
  161. <li><a href="sor.html#_bb9">An Example Tree Transformation</a></li>
  162. </ul>
  163. <li><a href="sor.html#Examining_Debugging ASTs">Examining/Debugging ASTs</a></li>
  164. </ul>
  165. <p><a href="streams.html"><big>Token Streams</big></a><ul>
  166. <li><a href="streams.html#Introduction">Introduction</a></li>
  167. <li><a href="streams.html#Pass-Through Token Stream">Pass-Through Token Stream</a></li>
  168. <li><a href="streams.html#Token Stream Filtering">Token Stream Filtering</a></li>
  169. <li><a href="streams.html#Token Stream Splitting">Token Stream Splitting</a><ul>
  170. <li><a href="streams.html#Example">Example</a></li>
  171. <li><a href="streams.html#Filter Implementation">Filter Implementation</a></li>
  172. <li><a href="streams.html#How To Use This Filter">How To Use This Filter</a></li>
  173. <li><a href="streams.html#Tree Construction">Tree Construction</a></li>
  174. <li><a href="streams.html#Garbage Collection Issues">Garbage Collection Issues</a></li>
  175. <li><a href="streams.html#Notes">Notes</a></li>
  176. </ul>
  177. </li>
  178. <li><a href="streams.html#lexerstates">Token Stream Multiplexing (aka &quot;Lexer
  179. states&quot;)</a><ul>
  180. <li><a href="streams.html#Multiple Lexers">Multiple Lexers</a></li>
  181. <li><a href="streams.html#Lexers Sharing Same Character Stream">Lexers Sharing Same
  182. Character Stream</a></li>
  183. <li><a href="streams.html#Parsing Multiplexed Token Streams">Parsing Multiplexed Token
  184. Streams</a></li>
  185. <li><a href="streams.html#The Effect of Lookahead Upon Multiplexed Token Streams">The Effect
  186. of Lookahead Upon Multiplexed Token Streams</a></li>
  187. <li><a href="streams.html#Multiple Lexers Versus Calling Another Lexer Rule">Multiple Lexers
  188. Versus Calling Another Lexer Rule</a></li>
  189. </ul>
  190. </li>
  191. <li><a href="streams.html#rewriteengine">TokenStreamRewriteEngine Easy Syntax-Directed Translation</a></li>
  192. <li><a href="streams.html#The Future">The Future</a></li>
  193. </ul>
  194. <p><a href="vocab.html"><big>Token Vocabularies</big></a><ul>
  195. <li><a href="vocab.html#Introduction">Introduction</a><ul>
  196. <li><a href="vocab.html#How does ANTLR decide which vocabulary symbol gets what token type?">How
  197. does ANTLR decide which vocabulary symbol gets what token type?</a></li>
  198. <li><a href="vocab.html#Why do token types start at 4?">Why do token types start at 4?</a></li>
  199. <li><a href="vocab.html#What files associated with vocabulary does ANTLR generate?">What
  200. files associated with vocabulary does ANTLR generate?</a></li>
  201. <li><a
  202. href="vocab.html#How does ANTLR synchronize the symbol-type mappings between grammars in the same file and in different files?">How
  203. does ANTLR synchronize the symbol-type mappings between grammars in the same file and in
  204. different files?</a></li>
  205. </ul>
  206. </li>
  207. <li><a href="vocab.html#Grammar Inheritance and Vocabularies">Grammar Inheritance and
  208. Vocabularies</a></li>
  209. <li><a href="vocab.html#Recognizer Generation Order">Recognizer Generation Order</a></li>
  210. <li><a href="vocab.html#Tricky Vocabulary Stuff">Tricky Vocabulary Stuff</a></li>
  211. </ul>
  212. <p><big><a href="err.html#_bb1">Error Handling and Recovery</a></big><ul>
  213. <li><a href="err.html#ANTLR Exception Hierarchy">ANTLR Exception Hierarchy</a></li>
  214. <li><a href="err.html#_bb2">Modifying Default Error Messages With Paraphrases</a></li>
  215. <li><a href="err.html#ParserExceptionHandling">Parser Exception Handling</a></li>
  216. <li><a href="err.html#SpecifyingParserException-Handlers">Specifying Parser Exception-Handlers</a></li>
  217. <li><a href="err.html#Default Exception Handling in the Lexer">Default Exception Handling in
  218. the Lexer</a></li>
  219. </ul>
  220. <p><big><a href="runtime.html#_bb1">Java Runtime Model</a></big><ul>
  221. <li><a href="runtime.html#_bb2">Programmer's Interface</a></li>
  222. <ul>
  223. <li><a href="runtime.html#_bb3">What ANTLR generates</a></li>
  224. </ul>
  225. <li><a href="runtime.html#sharingstate">Multiple Lexers/Parsers With Shared Input State</a></li>
  226. <li><a href="runtime.html#_bb4">Parser Implementation</a></li>
  227. <ul>
  228. <li><a href="runtime.html#_bb5">Parser Class</a></li>
  229. <li><a href="runtime.html#_bb6">Parser Methods</a></li>
  230. <li><a href="runtime.html#_bb7">EBNF Subrules</a></li>
  231. <li><a href="runtime.html#_bb8">Production Prediction </a></li>
  232. <li><a href="runtime.html#_bb9">Production Element Recognition </a></li>
  233. <li><a href="runtime.html#_bb10">Standard Classes</a></li>
  234. </ul>
  235. <li><a href="runtime.html#_bb11">Lexer Implementation</a></li>
  236. <ul>
  237. <li><a href="runtime.html#_bb12">Lexer Form</a></li>
  238. <li><a href="runtime.html#_bb13">Creating Your Own Lexer</a></li>
  239. <li><a href="runtime.html#_bb14">Lexical Rules </a></li>
  240. </ul>
  241. <li><a href="runtime.html#_bb15">Token Objects</a></li>
  242. <li><a href="runtime.html#_bb16">Token Lookahead Buffer</a></li>
  243. </ul>
  244. <p><big><a href="cpp-runtime.html#_bb1">C++ Runtime model</a></big><ul>
  245. <li><a href="cpp-runtime.html#_buildruntime">Building the runtime</a></li>
  246. <li><a href="cpp-runtime.html#_generatingcpp">Getting C++ output</a></li>
  247. <li><a href="cpp-runtime.html#_changingasttype">Changing the AST Type</a></li>
  248. <li><a href="cpp-runtime.html#_heteroast">Using Heterogeneous AST types</a></li>
  249. <li><a href="cpp-runtime.html#_extras">Extra functionality in C++ mode</a></li>
  250. <li><a href="cpp-runtime.html#_template">A grammar template</a></li>
  251. </ul>
  252. <p>
  253. <p><big><a href="csharp-runtime.html">C# Runtime model</a></big>
  254. <ul>
  255. <li><a href=csharp-runtime.html#t1>Building the ANTLR C# Runtime</a></li>
  256. <li><a href=csharp-runtime.html#t2>Specifying Code Generation</a></li>
  257. <li><a href=csharp-runtime.html#t3>C#-Specific ANTLR Options</a></li>
  258. <li><a href=csharp-runtime.html#t4>A Template C# ANTLR Grammar File</a></li>
  259. </ul>
  260. <!-- Hail Python! -->
  261. <p><big><a href="python-runtime.html">Python Runtime model</a></big>
  262. <ul>
  263. <li><a href="python-runtime.html#t1">Building the ANTLR Python Runtime</a></li>
  264. <li><a href="python-runtime.html#t2">Specifying Code Generation</a></li>
  265. <li><a href="python-runtime.html#t3">Python-Specific ANTLR Options</a></li>
  266. <li><a href="python-runtime.html#t4">A Template Python ANTLR Grammar File</a></li>
  267. </ul>
  268. <p><big><a href="trees.html#_bb1">ANTLR Tree Construction</a></big><ul>
  269. <li><a href="trees.html#_bb2">Notation</a></li>
  270. <li><a href="trees.html#_bb3">Controlling AST construction</a></li>
  271. <li><a href="trees.html#_bb4">Grammar annotations for building ASTs</a></li>
  272. <ul>
  273. <li><a href="trees.html#_bb5">Leaf nodes</a></li>
  274. <li><a href="trees.html#_bb6">Root nodes</a></li>
  275. <li><a href="trees.html#_bb7">Turning off standard tree construction</a></li>
  276. <li><a href="trees.html#_bb8">Tree node construction</a></li>
  277. <li><a href="trees.html#_bb9">AST Action Translation</a></li>
  278. </ul>
  279. <li><a href="trees.html#_bb10">Invoking parsers that build trees</a></li>
  280. <li><a href="trees.html#_bb11">AST Factories</a></li>
  281. <li><a href="trees.html#Heterogeneous ASTs">Heterogeneous ASTs</a><ul>
  282. <li><a href="trees.html#An Expression Tree Example"><font size="3">An Expression Tree
  283. Example</font></a></li>
  284. <li><a href="trees.html#Describing Heterogeneous Trees With Grammars">Describing
  285. Heterogeneous Trees With Grammars</a></li>
  286. </ul>
  287. </li>
  288. <li><a href="trees.html#AST Serialization">AST (XML) Serialization</a></li>
  289. <li><a href="trees.html#_bb12">AST enumerations</a></li>
  290. <li><a href="trees.html#_bb13">A few examples</a></li>
  291. <li><a href="trees.html#_bb14">Labeled subrules</a></li>
  292. <li><a href="trees.html#_bb15">Reference nodes</a></li>
  293. <li><a href="trees.html#_bb16">Required AST functionality and form</a></li>
  294. </ul>
  295. <p><big><a href="inheritance.html#_bb1">Grammar Inheritance</a></big><ul>
  296. <li><a href="inheritance.html#_bb2">Introduction and motivation</a></li>
  297. <li><a href="inheritance.html#_bb3">Functionality</a></li>
  298. <li><a href="inheritance.html#_bb4">Where Are Those Supergrammars?</a></li>
  299. <li><a href="inheritance.html#_bb7">Error Messages</a></li>
  300. </ul>
  301. <p><a href="options.html#Options"><big>Options</big></a><ul>
  302. <li><a href="options.html#File, Grammar, and Rule">File, Grammar, and Rule Options </a><ul>
  303. <li><a href="options.html#_bb2">Options supported in ANTLR</a></li>
  304. <li><a href="options.html#_bb3">language: Setting the generated language</a></li>
  305. <li><a href="options.html#_bb4">k: Setting the lookahead depth </a></li>
  306. <li><a href="options.html#importVocab">importVocab: Initial Grammar Vocabulary</a></li>
  307. <li><a href="options.html#exportVocab">exportVocab: Naming Output Vocabulary</a></li>
  308. <li><a href="options.html#_bb8">testLiterals: Generate literal-testing code</a></li>
  309. <li><a href="options.html#_bb9">defaultErrorHandler: Controlling default exception-handling</a></li>
  310. <li><a href="options.html#_bb10">codeGenMakeSwitchThreshold: controlling code generation</a></li>
  311. <li><a href="options.html#_bb11">codeGenBitsetTestThreshold: controlling code generation</a></li>
  312. <li><a href="options.html#_bb12">buildAST: Automatic AST construction </a></li>
  313. <li><a href="options.html#_bb13">ASTLabelType: Setting label type</a></li>
  314. <li><a href="options.html#_bb14">charVocabulary: Setting the lexer character vocabulary</a></li>
  315. <li><a href="options.html#_bb15">warnWhenFollowAmbig</a></li>
  316. </ul>
  317. </li>
  318. <li><a href="options.html#Command Line Options">Command Line Options</a></li>
  319. </ul>
  320. </div>
  321. </body>
  322. </html>