Java Doc for FirstPassAnalyzer.java in  » Parser » grammatica » net » percederberg » grammatica » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Parser » grammatica » net.percederberg.grammatica 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


net.percederberg.grammatica.GrammarAnalyzer
   net.percederberg.grammatica.FirstPassAnalyzer

FirstPassAnalyzer
class FirstPassAnalyzer extends GrammarAnalyzer (Code)
A first pass grammar analyzer. This class processes the grammar parse tree and creates the token and production patterns. Both token and production patterns are added to the grammar, but the production patterns will all be empty. In order to analyze the production pattern rules, all the production pattern names and identifiers must be present in the grammar, so the pattern rules must be analyzed in a second pass. This analyzer also adds all header declarations to the grammar.
author:
   Per Cederberg,
version:
   1.0



Constructor Summary
public  FirstPassAnalyzer(Grammar grammar)
     Creates a new grammar analyser.

Method Summary
protected  NodeexitError(Token node)
     Sets the node value to the error message.
protected  NodeexitHeaderDeclaration(Production node)
     Adds the header declaration to the grammar.
protected  NodeexitHeaderPart(Production node)
     Removes the header part from the parse tree by returning null.
protected  NodeexitIdentifier(Token node)
     Sets the node value to the identifier string.
protected  NodeexitIgnore(Token node)
     Sets the node value to the ignore message.
protected  NodeexitProductionDeclaration(Production node)
     Adds an empty production pattern to the grammar.
protected  NodeexitQuotedString(Token node)
     Sets the node value to the contents of the quoted string.
protected  NodeexitRegexp(Token node)
     Sets the node value to the regular expression string.
protected  NodeexitTokenDeclaration(Production node)
     Adds a token pattern to the grammar.
protected  NodeexitTokenHandling(Production node)
     Sets the node values to the error or ignore token.
protected  NodeexitTokenPart(Production node)
     Removes the token part from the parse tree by returning null.
protected  NodeexitTokenValue(Production node)
     Sets the node values to the token pattern type and the token pattern string.


Constructor Detail
FirstPassAnalyzer
public FirstPassAnalyzer(Grammar grammar)(Code)
Creates a new grammar analyser.
Parameters:
  grammar - the grammar where objects are added




Method Detail
exitError
protected Node exitError(Token node)(Code)
Sets the node value to the error message. If no message is set, no node value will be added.
Parameters:
  node - the token node the token node



exitHeaderDeclaration
protected Node exitHeaderDeclaration(Production node) throws ParseException(Code)
Adds the header declaration to the grammar. This method will also remove the header declaration from the parse tree by returning null.
Parameters:
  node - the production node the new production node
throws:
  ParseException - if the node analysis discovered errors



exitHeaderPart
protected Node exitHeaderPart(Production node)(Code)
Removes the header part from the parse tree by returning null.
Parameters:
  node - the production node the new production node



exitIdentifier
protected Node exitIdentifier(Token node)(Code)
Sets the node value to the identifier string.
Parameters:
  node - the token node the token node



exitIgnore
protected Node exitIgnore(Token node)(Code)
Sets the node value to the ignore message. If no message is set, no node value will be added.
Parameters:
  node - the token node the token node



exitProductionDeclaration
protected Node exitProductionDeclaration(Production node) throws ParseException(Code)
Adds an empty production pattern to the grammar. This metod will return the production node to make it available for the second pass analyzer.
Parameters:
  node - the production node the new production node
throws:
  ParseException - if the node analysis discovered errors



exitQuotedString
protected Node exitQuotedString(Token node)(Code)
Sets the node value to the contents of the quoted string. The quotation marks will be removed, but any escaped character will be left intact.
Parameters:
  node - the token node the token node



exitRegexp
protected Node exitRegexp(Token node)(Code)
Sets the node value to the regular expression string. The quotation marks will be removed, and the "\<" and "\>" will be unescaped (replaced by the '<' and '>' characters). The rest of the expression is left intact.
Parameters:
  node - the token node the token node



exitTokenDeclaration
protected Node exitTokenDeclaration(Production node) throws ParseException(Code)
Adds a token pattern to the grammar. This method will also remove the token declaration from the parse tree by reutrning null.
Parameters:
  node - the production node the new production node
throws:
  ParseException - if the node analysis discovered errors



exitTokenHandling
protected Node exitTokenHandling(Production node) throws ParseException(Code)
Sets the node values to the error or ignore token. If present, the message string will also be added as a node value.
Parameters:
  node - the production node the new production node
throws:
  ParseException - if the node analysis discovered errors



exitTokenPart
protected Node exitTokenPart(Production node)(Code)
Removes the token part from the parse tree by returning null.
Parameters:
  node - the production node the new production node



exitTokenValue
protected Node exitTokenValue(Production node) throws ParseException(Code)
Sets the node values to the token pattern type and the token pattern string.
Parameters:
  node - the production node the new production node
throws:
  ParseException - if the node analysis discovered errors



Methods inherited from net.percederberg.grammatica.GrammarAnalyzer
protected void child(Production node, Node child) throws ParseException(Code)(Java Doc)
protected void childGrammar(Production node, Node child) throws ParseException(Code)(Java Doc)
protected void childHeaderDeclaration(Production node, Node child) throws ParseException(Code)(Java Doc)
protected void childHeaderPart(Production node, Node child) throws ParseException(Code)(Java Doc)
protected void childProduction(Production node, Node child) throws ParseException(Code)(Java Doc)
protected void childProductionAtom(Production node, Node child) throws ParseException(Code)(Java Doc)
protected void childProductionDeclaration(Production node, Node child) throws ParseException(Code)(Java Doc)
protected void childProductionPart(Production node, Node child) throws ParseException(Code)(Java Doc)
protected void childTokenDeclaration(Production node, Node child) throws ParseException(Code)(Java Doc)
protected void childTokenHandling(Production node, Node child) throws ParseException(Code)(Java Doc)
protected void childTokenPart(Production node, Node child) throws ParseException(Code)(Java Doc)
protected void childTokenValue(Production node, Node child) throws ParseException(Code)(Java Doc)
protected void enter(Node node) throws ParseException(Code)(Java Doc)
protected void enterAsterisk(Token node) throws ParseException(Code)(Java Doc)
protected void enterEquals(Token node) throws ParseException(Code)(Java Doc)
protected void enterError(Token node) throws ParseException(Code)(Java Doc)
protected void enterGrammar(Production node) throws ParseException(Code)(Java Doc)
protected void enterHeader(Token node) throws ParseException(Code)(Java Doc)
protected void enterHeaderDeclaration(Production node) throws ParseException(Code)(Java Doc)
protected void enterHeaderPart(Production node) throws ParseException(Code)(Java Doc)
protected void enterIdentifier(Token node) throws ParseException(Code)(Java Doc)
protected void enterIgnore(Token node) throws ParseException(Code)(Java Doc)
protected void enterLeftBrace(Token node) throws ParseException(Code)(Java Doc)
protected void enterLeftBracket(Token node) throws ParseException(Code)(Java Doc)
protected void enterLeftParen(Token node) throws ParseException(Code)(Java Doc)
protected void enterPlusSign(Token node) throws ParseException(Code)(Java Doc)
protected void enterProduction(Production node) throws ParseException(Code)(Java Doc)
protected void enterProductionAtom(Production node) throws ParseException(Code)(Java Doc)
protected void enterProductionDeclaration(Production node) throws ParseException(Code)(Java Doc)
protected void enterProductionPart(Production node) throws ParseException(Code)(Java Doc)
protected void enterProductions(Token node) throws ParseException(Code)(Java Doc)
protected void enterQuestionMark(Token node) throws ParseException(Code)(Java Doc)
protected void enterQuotedString(Token node) throws ParseException(Code)(Java Doc)
protected void enterRegexp(Token node) throws ParseException(Code)(Java Doc)
protected void enterRightBrace(Token node) throws ParseException(Code)(Java Doc)
protected void enterRightBracket(Token node) throws ParseException(Code)(Java Doc)
protected void enterRightParen(Token node) throws ParseException(Code)(Java Doc)
protected void enterSemicolon(Token node) throws ParseException(Code)(Java Doc)
protected void enterTokenDeclaration(Production node) throws ParseException(Code)(Java Doc)
protected void enterTokenHandling(Production node) throws ParseException(Code)(Java Doc)
protected void enterTokenPart(Production node) throws ParseException(Code)(Java Doc)
protected void enterTokenValue(Production node) throws ParseException(Code)(Java Doc)
protected void enterTokens(Token node) throws ParseException(Code)(Java Doc)
protected void enterUnterminatedDirective(Token node) throws ParseException(Code)(Java Doc)
protected void enterVerticalBar(Token node) throws ParseException(Code)(Java Doc)
protected Node exit(Node node) throws ParseException(Code)(Java Doc)
protected Node exitAsterisk(Token node) throws ParseException(Code)(Java Doc)
protected Node exitEquals(Token node) throws ParseException(Code)(Java Doc)
protected Node exitError(Token node) throws ParseException(Code)(Java Doc)
protected Node exitGrammar(Production node) throws ParseException(Code)(Java Doc)
protected Node exitHeader(Token node) throws ParseException(Code)(Java Doc)
protected Node exitHeaderDeclaration(Production node) throws ParseException(Code)(Java Doc)
protected Node exitHeaderPart(Production node) throws ParseException(Code)(Java Doc)
protected Node exitIdentifier(Token node) throws ParseException(Code)(Java Doc)
protected Node exitIgnore(Token node) throws ParseException(Code)(Java Doc)
protected Node exitLeftBrace(Token node) throws ParseException(Code)(Java Doc)
protected Node exitLeftBracket(Token node) throws ParseException(Code)(Java Doc)
protected Node exitLeftParen(Token node) throws ParseException(Code)(Java Doc)
protected Node exitPlusSign(Token node) throws ParseException(Code)(Java Doc)
protected Node exitProduction(Production node) throws ParseException(Code)(Java Doc)
protected Node exitProductionAtom(Production node) throws ParseException(Code)(Java Doc)
protected Node exitProductionDeclaration(Production node) throws ParseException(Code)(Java Doc)
protected Node exitProductionPart(Production node) throws ParseException(Code)(Java Doc)
protected Node exitProductions(Token node) throws ParseException(Code)(Java Doc)
protected Node exitQuestionMark(Token node) throws ParseException(Code)(Java Doc)
protected Node exitQuotedString(Token node) throws ParseException(Code)(Java Doc)
protected Node exitRegexp(Token node) throws ParseException(Code)(Java Doc)
protected Node exitRightBrace(Token node) throws ParseException(Code)(Java Doc)
protected Node exitRightBracket(Token node) throws ParseException(Code)(Java Doc)
protected Node exitRightParen(Token node) throws ParseException(Code)(Java Doc)
protected Node exitSemicolon(Token node) throws ParseException(Code)(Java Doc)
protected Node exitTokenDeclaration(Production node) throws ParseException(Code)(Java Doc)
protected Node exitTokenHandling(Production node) throws ParseException(Code)(Java Doc)
protected Node exitTokenPart(Production node) throws ParseException(Code)(Java Doc)
protected Node exitTokenValue(Production node) throws ParseException(Code)(Java Doc)
protected Node exitTokens(Token node) throws ParseException(Code)(Java Doc)
protected Node exitUnterminatedDirective(Token node) throws ParseException(Code)(Java Doc)
protected Node exitVerticalBar(Token node) throws ParseException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.