Java Doc for Resolver.java in  » Parser » Rats-Parser-Generators » xtc » parser » 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 » Rats Parser Generators » xtc.parser 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   xtc.tree.Visitor
      xtc.parser.Resolver

Resolver
public class Resolver extends Visitor (Code)
Visitor to resolve grammar module dependencies.

Note that this visitor TextTester marks text-only productions as such. It also LeftRecurser detects left recursions and marks direct left recursions. Furthermore, it sets a grammar's Properties.GENERIC and Properties.RECURSIVE properties as appropriate.
author:
   Robert Grimm
version:
   $Revision: 1.124 $



Field Summary
final protected  Analyzeranalyzer
     The analyzer utility.
final protected  ASTast
     The type operations.
protected  Map<NonTerminal, NonTerminal>badNTs
     The identity hash map of erroneous nonterminals.
protected  booleanhasState
     The flag for whether the current module has a stateful attribute.
protected  booleanisMofunctor
     The flag for whether the current module is a mofunctor.
protected  booleanisPredicate
     Flag for whether the current expression is a predicate.
protected  intphase
     The current checking phase.
final protected  Runtimeruntime
     The runtime.
protected  Set<SequenceName>sequenceNames
     The set of sequence names for the current production.

Constructor Summary
public  Resolver(Runtime runtime, Analyzer analyzer, AST ast)
     Create a new resolver.

Method Summary
protected  voidapply(AlternativeAddition p1, FullProduction p2)
     Apply the specified alternative addition to the specified full production.
protected  voidapply(AlternativeRemoval p1, FullProduction p2)
     Apply the specified alternative removal to the specified full production.
protected  voidapply(ProductionOverride p1, FullProduction p2)
     Apply the specified production override to the specified full production.
protected  voidapplyModifications(Grammar g)
     Apply any module modifications.
protected  List<Attribute>check(Grammar g)
     Perform basic checking for the specified grammar.
protected  voidcheckRecursions(Grammar g)
     Check for left-recursive productions.
protected  voidcheckRepetitions(Grammar g)
     Check repetitions for elements that accept the empty input.
protected  Modulecombine(Grammar g, List<Attribute> attributes)
     Combine the modules in the specified grammar.
protected  voidinternTypes(Grammar g)
     Intern the grammar's types.
protected  Moduleload(String name)
     Load the module with the specified name.
Parameters:
  name - The name.
protected  Grammarload(Module m)
     Load all dependent modules.
protected  voidrename(Module module, ModuleMap renaming)
     Rename the specified module.
protected  voidsignature(Module m)
     Print the specified module's signature.
protected  Productionstrip(Production p)
     Strip the specified production's ordered choice.
See Also:   Analyzer.stripChoices
Parameters:
  p - The production to strip.
public  Objectvisit(Module m)
     Visit the specified module.
Parameters:
  m - The module to resolve.
public  voidvisit(Production p)
     Analyze the specified production.
public  voidvisit(OrderedChoice c)
     Analyze the specified ordered choice.
public  voidvisit(Repetition r)
     Analyze the specified repetition.
public  voidvisit(Option o)
     Analyze the specified option.
public  voidvisit(Sequence s)
     Analyze the specified sequence.
public  voidvisit(Predicate p)
     Analyze the specified predicate.
public  voidvisit(SemanticPredicate p)
     Analyze the specified semantic predicate.
public  voidvisit(VoidedElement v)
     Analyze the specified voided element.
public  voidvisit(Binding b)
     Analyze the specified binding.
public  voidvisit(StringMatch m)
     Analyze the specified string match.
public  voidvisit(NonTerminal nt)
     Analyze the specified nonterminal.
public  voidvisit(Terminal t)
     Analyze the specified terminal.
public  voidvisit(StringLiteral l)
     Analyze the specified string literal.
public  voidvisit(CharClass c)
     Analyze the specified character class.
public  voidvisit(NullLiteral l)
     Analyze the specified null literal.
public  voidvisit(NodeMarker m)
     Analyze the specified node marker.
public  voidvisit(Action a)
     Analyze the specified action.
public  voidvisit(ParserAction pa)
     Analyze the specified parser action.
public  voidvisit(InternalElement e)
     Analyze the specified internal element.

Field Detail
analyzer
final protected Analyzer analyzer(Code)
The analyzer utility.



ast
final protected AST ast(Code)
The type operations.



badNTs
protected Map<NonTerminal, NonTerminal> badNTs(Code)
The identity hash map of erroneous nonterminals.



hasState
protected boolean hasState(Code)
The flag for whether the current module has a stateful attribute.



isMofunctor
protected boolean isMofunctor(Code)
The flag for whether the current module is a mofunctor.



isPredicate
protected boolean isPredicate(Code)
Flag for whether the current expression is a predicate.



phase
protected int phase(Code)
The current checking phase.



runtime
final protected Runtime runtime(Code)
The runtime.



sequenceNames
protected Set<SequenceName> sequenceNames(Code)
The set of sequence names for the current production.




Constructor Detail
Resolver
public Resolver(Runtime runtime, Analyzer analyzer, AST ast)(Code)
Create a new resolver.
Parameters:
  runtime - The runtime.
Parameters:
  analyzer - The analyzer utility.
Parameters:
  ast - The type operations.




Method Detail
apply
protected void apply(AlternativeAddition p1, FullProduction p2)(Code)
Apply the specified alternative addition to the specified full production.
Parameters:
  p1 - The alternative addition.
Parameters:
  p2 - The full production.



apply
protected void apply(AlternativeRemoval p1, FullProduction p2)(Code)
Apply the specified alternative removal to the specified full production.
Parameters:
  p1 - The alternative removal.
Parameters:
  p2 - The full production.



apply
protected void apply(ProductionOverride p1, FullProduction p2)(Code)
Apply the specified production override to the specified full production.
Parameters:
  p1 - The production override.
Parameters:
  p2 - The full production.



applyModifications
protected void applyModifications(Grammar g)(Code)
Apply any module modifications. This method applies all module modifications appearing in the specified grammar. It also removes unused modules from the grammar. This method assumes that all module dependencies have been successfully resolved, i.e., the specified grammar contains all module dependencies. This method also assumes that each module modification's Module.modification modification field has been correctly initialized.
Parameters:
  g - The grammar.



check
protected List<Attribute> check(Grammar g)(Code)
Perform basic checking for the specified grammar. This method does all correctness checking besides checking the contents of partial productions and checking for left-recursive definitions. Note that this method initializes the analyzer with the specified grammar.
Parameters:
  g - The grammar. The list of global attributes, if any.



checkRecursions
protected void checkRecursions(Grammar g)(Code)
Check for left-recursive productions. This method assumes that all module modifications have been applied.
Parameters:
  g - The grammar.



checkRepetitions
protected void checkRepetitions(Grammar g)(Code)
Check repetitions for elements that accept the empty input. This method assumes that all module modifications have been applied.
Parameters:
  g - The grammar.



combine
protected Module combine(Grammar g, List<Attribute> attributes)(Code)
Combine the modules in the specified grammar. This method combines the modules in the grammar by modifying the grammar's top-level module and then returns that module.
Parameters:
  g - The grammar.
Parameters:
  attributes - The list of global attributes. The grammar as a single module.



internTypes
protected void internTypes(Grammar g)(Code)
Intern the grammar's types. This method assumes that all module modifications have been applied.
Parameters:
  g - The grammar.



load
protected Module load(String name) throws IOException, ParseException(Code)
Load the module with the specified name.
Parameters:
  name - The name. The corresponding grammar module.
throws:
  IllegalArgmentException - Signals that the file is too large.
throws:
  FileNotFoundException - Signals that the file does not exist.
throws:
  IOException - Signals an exceptional condition while accessing the file.
throws:
  ParseException - Signals a parse error.



load
protected Grammar load(Module m)(Code)
Load all dependent modules. This method loads the transitive closure of all dependent modules for the specified top-level module and returns the closure as a list, with the specified module being the first list element. It checks that the specified top-level module is not parameterized, that the parameters of parameterized modules are well-formed, that arguments match parameters when instantiating parameterized modules, that different instantiations are consistent with each other, that a module does not have more than one modifies clause, and that module modifications do not result in circular dependencies. This method also reports any file access and parsing errors. Finally, this method fills in the auxiliary modification field for all loaded modules.
Parameters:
  m - The module. The corresponding grammar or null in thecase of errors.



rename
protected void rename(Module module, ModuleMap renaming)(Code)
Rename the specified module. This method renames all module names in the specified module, including the module's Module.name name , the module's Module.dependenciesdependencies , and each production's Production.qNamequalified name (if it is not null).
Parameters:
  module - The module.
Parameters:
  renaming - The renaming.



signature
protected void signature(Module m)(Code)
Print the specified module's signature.
Parameters:
  m - The module.



strip
protected Production strip(Production p)(Code)
Strip the specified production's ordered choice.
See Also:   Analyzer.stripChoices
Parameters:
  p - The production to strip. The specified production.



visit
public Object visit(Module m)(Code)
Visit the specified module.
Parameters:
  m - The module to resolve. A single, self-contained grammar module ornull on an error condition.



visit
public void visit(Production p)(Code)
Analyze the specified production.



visit
public void visit(OrderedChoice c)(Code)
Analyze the specified ordered choice.



visit
public void visit(Repetition r)(Code)
Analyze the specified repetition.



visit
public void visit(Option o)(Code)
Analyze the specified option.



visit
public void visit(Sequence s)(Code)
Analyze the specified sequence.



visit
public void visit(Predicate p)(Code)
Analyze the specified predicate.



visit
public void visit(SemanticPredicate p)(Code)
Analyze the specified semantic predicate.



visit
public void visit(VoidedElement v)(Code)
Analyze the specified voided element.



visit
public void visit(Binding b)(Code)
Analyze the specified binding.



visit
public void visit(StringMatch m)(Code)
Analyze the specified string match.



visit
public void visit(NonTerminal nt)(Code)
Analyze the specified nonterminal.



visit
public void visit(Terminal t)(Code)
Analyze the specified terminal.



visit
public void visit(StringLiteral l)(Code)
Analyze the specified string literal.



visit
public void visit(CharClass c)(Code)
Analyze the specified character class.



visit
public void visit(NullLiteral l)(Code)
Analyze the specified null literal.



visit
public void visit(NodeMarker m)(Code)
Analyze the specified node marker.



visit
public void visit(Action a)(Code)
Analyze the specified action.



visit
public void visit(ParserAction pa)(Code)
Analyze the specified parser action.



visit
public void visit(InternalElement e)(Code)
Analyze the specified internal element.



Methods inherited from xtc.tree.Visitor
public Object dispatch(Node node)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.