Java Doc for NFAState.java in  » Parser » antlr-3.0.1 » org » antlr » analysis » 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 » antlr 3.0.1 » org.antlr.analysis 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.antlr.analysis.State
      org.antlr.analysis.NFAState

NFAState
public class NFAState extends State (Code)
A state within an NFA. At most 2 transitions emanate from any NFA state.


Field Summary
final public static  intBLOCK_START
    
final public static  intBYPASS
    
protected  booleanEOTTargetState
    
final public static  intLOOPBACK
    
final public static  intMAX_TRANSITIONS
    
final public static  intOPTIONAL_BLOCK_START
    
final public static  intRIGHT_EDGE_OF_BLOCK
    
protected  GrammarASTassociatedASTNode
     Associate this NFAState with the corresponding GrammarAST node from which this node was created.
protected  intdecisionNumber
    
public  intdecisionStateType
     Subrules (...)* and (...)+ have more than one decision point in the NFA created for them.
protected  Stringdescription
     During debugging and for nondeterminism warnings, it's useful to know what relationship this node has to the original grammar.
protected  StringenclosingRule
    
public  intendOfBlockStateNumber
     Jean Bovet needs in the GUI to know which state pairs correspond to the start/stop of a block.
public  NFAnfa
    
 intnumTransitions
    
 Transition[]transition
    

Constructor Summary
public  NFAState(NFA nfa)
    

Method Summary
public  voidaddTransition(Transition e)
    
public  GrammarASTgetAssociatedASTNode()
    
public  intgetDecisionNumber()
    
public  StringgetDescription()
    
public  StringgetEnclosingRule()
    
public  intgetNumberOfTransitions()
    
public  booleanisDecisionState()
    
public  booleanisEOTTargetState()
    
public  voidsetAssociatedASTNode(GrammarAST ASTNode)
    
public  voidsetDecisionASTNode(GrammarAST decisionASTNode)
     What AST node is associated with this NFAState? When you set the AST node, I set the node to point back to this NFA state.
public  voidsetDecisionNumber(int decisionNumber)
    
public  voidsetDescription(String description)
    
public  voidsetEOTTargetState(boolean eot)
    
public  voidsetEnclosingRuleName(String rule)
    
public  voidsetTransition0(Transition e)
     Used during optimization to reset a state to have the (single) transition another state has.
public  StringtoString()
    
public  Transitiontransition(int i)
    
public  inttranslateDisplayAltToWalkAlt(DFA dfa, int displayAlt)
     The DFA decision for this NFA decision state always has an exit path for loops as n+1 for n alts in the loop. That is really useful for displaying nondeterministic alts and so on, but for walking the NFA to get a sequence of edge labels or for actually parsing, we need to get the real alt number.

Field Detail
BLOCK_START
final public static int BLOCK_START(Code)



BYPASS
final public static int BYPASS(Code)



EOTTargetState
protected boolean EOTTargetState(Code)
Is this state the sole target of an EOT transition?



LOOPBACK
final public static int LOOPBACK(Code)



MAX_TRANSITIONS
final public static int MAX_TRANSITIONS(Code)



OPTIONAL_BLOCK_START
final public static int OPTIONAL_BLOCK_START(Code)



RIGHT_EDGE_OF_BLOCK
final public static int RIGHT_EDGE_OF_BLOCK(Code)



associatedASTNode
protected GrammarAST associatedASTNode(Code)
Associate this NFAState with the corresponding GrammarAST node from which this node was created. This is useful not only for associating the eventual lookahead DFA with the associated Grammar position, but also for providing users with nondeterminism warnings. Mainly used by decision states to report line:col info. Could also be used to track line:col for elements such as token refs.



decisionNumber
protected int decisionNumber(Code)
What's its decision number from 1..n?



decisionStateType
public int decisionStateType(Code)
Subrules (...)* and (...)+ have more than one decision point in the NFA created for them. They both have a loop-exit-or-stay-in decision node (the loop back node). They both have a normal alternative block decision node at the left edge. The (...)* is worse as it even has a bypass decision (2 alts: stay in or bypass) node at the extreme left edge. This is not how they get generated in code as a while-loop or whatever deals nicely with either. For error messages (where I need to print the nondeterministic alts) and for interpretation, I need to use the single DFA that is created (for efficiency) but interpret the results differently depending on which of the 2 or 3 decision states uses the DFA. For example, the DFA will always report alt n+1 as the exit branch for n real alts, so I need to translate that depending on the decision state. If decisionNumber>0 then this var tells you what kind of decision state it is.



description
protected String description(Code)
During debugging and for nondeterminism warnings, it's useful to know what relationship this node has to the original grammar. For example, "start of alt 1 of rule a".



enclosingRule
protected String enclosingRule(Code)
What rule do we live in?



endOfBlockStateNumber
public int endOfBlockStateNumber(Code)
Jean Bovet needs in the GUI to know which state pairs correspond to the start/stop of a block.



nfa
public NFA nfa(Code)
Which NFA are we in?



numTransitions
int numTransitions(Code)
How many transitions; 0, 1, or 2 transitions



transition
Transition[] transition(Code)




Constructor Detail
NFAState
public NFAState(NFA nfa)(Code)




Method Detail
addTransition
public void addTransition(Transition e)(Code)



getAssociatedASTNode
public GrammarAST getAssociatedASTNode()(Code)



getDecisionNumber
public int getDecisionNumber()(Code)



getDescription
public String getDescription()(Code)



getEnclosingRule
public String getEnclosingRule()(Code)



getNumberOfTransitions
public int getNumberOfTransitions()(Code)



isDecisionState
public boolean isDecisionState()(Code)



isEOTTargetState
public boolean isEOTTargetState()(Code)



setAssociatedASTNode
public void setAssociatedASTNode(GrammarAST ASTNode)(Code)



setDecisionASTNode
public void setDecisionASTNode(GrammarAST decisionASTNode)(Code)
What AST node is associated with this NFAState? When you set the AST node, I set the node to point back to this NFA state.



setDecisionNumber
public void setDecisionNumber(int decisionNumber)(Code)



setDescription
public void setDescription(String description)(Code)



setEOTTargetState
public void setEOTTargetState(boolean eot)(Code)



setEnclosingRuleName
public void setEnclosingRuleName(String rule)(Code)



setTransition0
public void setTransition0(Transition e)(Code)
Used during optimization to reset a state to have the (single) transition another state has.



toString
public String toString()(Code)



transition
public Transition transition(int i)(Code)



translateDisplayAltToWalkAlt
public int translateDisplayAltToWalkAlt(DFA dfa, int displayAlt)(Code)
The DFA decision for this NFA decision state always has an exit path for loops as n+1 for n alts in the loop. That is really useful for displaying nondeterministic alts and so on, but for walking the NFA to get a sequence of edge labels or for actually parsing, we need to get the real alt number. The real alt number for exiting a loop is always 1 as transition 0 points at the exit branch (we compute DFAs always for loops at the loopback state). For walking/parsing the loopback state: 1 2 3 display alt (for human consumption) 2 3 1 walk alt For walking the block start: 1 2 3 display alt 1 2 3 For walking the bypass state of a (...)* loop: 1 2 3 display alt 1 1 2 all block alts map to entering loop exit means take bypass Non loop EBNF do not need to be translated; they are ignored by this method as decisionStateType==0. Return same alt if we can't translate.



Fields inherited from org.antlr.analysis.State
final public static int INVALID_STATE_NUMBER(Code)(Java Doc)
protected boolean acceptState(Code)(Java Doc)
public int stateNumber(Code)(Java Doc)

Methods inherited from org.antlr.analysis.State
abstract public void addTransition(Transition e)(Code)(Java Doc)
abstract public int getNumberOfTransitions()(Code)(Java Doc)
public boolean isAcceptState()(Code)(Java Doc)
public void setAcceptState(boolean acceptState)(Code)(Java Doc)
abstract public Transition transition(int i)(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.