Java Doc for Parser.java in  » IDE-Netbeans » cnd » antlr » 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 » IDE Netbeans » cnd » antlr 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   antlr.MatchExceptionState
      antlr.Parser

All known Subclasses:   antlr.LLkParser,
Parser
abstract public class Parser extends MatchExceptionState (Code)


Field Summary
final public static  intINITIAL_FOLLOW_STACK_SIZE
    
final public static  intMEMO_RULE_FAILED
    
final public static  intMEMO_RULE_UNKNOWN
    
protected  ASTFactoryastFactory
     AST support code; parser delegates to this object.
protected  ParserSharedInputStateinputState
    
protected  ASTreturnAST
    
protected  Map[]ruleMemo
     An array[size num rules] of Map that tracks the stop token index for each rule.
protected  String[]tokenNames
    
protected  HashtabletokenTypeToASTClassMap
     Constructed if any AST types specified in tokens{..}.
protected  inttraceDepth
    

Constructor Summary
public  Parser()
    
public  Parser(ParserSharedInputState state)
    

Method Summary
abstract public  intLA(int i)
     Return the token type of the ith token of lookahead where i=1 is the current token being examined by the parser (i.e., it has not been matched yet).
abstract public  TokenLT(int i)
    
public  voidaddMessageListener(MessageListener l)
    
public  voidaddParserListener(ParserListener l)
    
public  voidaddParserMatchListener(ParserMatchListener l)
    
public  voidaddParserTokenListener(ParserTokenListener l)
    
public  voidaddSemanticPredicateListener(SemanticPredicateListener l)
    
public  voidaddSyntacticPredicateListener(SyntacticPredicateListener l)
    
public  voidaddTraceListener(TraceListener l)
    
public  booleanalreadyParsedRule(int ruleIndex)
     Has this rule already parsed input at the current index in the input stream? Return the stop token index or MEMO_RULE_UNKNOWN.
abstract public  voidconsume()
    
public  voidconsumeUntil(int tokenType)
    
public  voidconsumeUntil(BitSet set)
    
protected  voiddefaultDebuggingSetup(TokenStream lexer, TokenBuffer tokBuf)
    
public  ASTgetAST()
    
public  ASTFactorygetASTFactory()
    
public  StringgetFilename()
    
public  ParserSharedInputStategetInputState()
    
public  intgetRuleMemoization(int ruleIndex, int ruleStartIndex)
     Given a rule number and a start token index number, return MEMO_RULE_UNKNOWN if the rule has not parsed input starting from start index.
public  StringgetTokenName(int num)
    
public  String[]getTokenNames()
    
public  HashtablegetTokenTypeToASTClassMap()
     If the user specifies a tokens{} section with heterogeneous AST node types, then ANTLR generates code to fill this mapping.
public  booleanisDebugMode()
    
public  intmark()
    
public  voidmatch(int t)
     Make sure current lookahead symbol matches token type t.
public  voidmatch(BitSet b)
     Make sure current lookahead symbol matches the given set Throw an exception upon mismatch, which is catch by either the error handler or by the syntactic predicate.
public  voidmatchNot(int t)
    
public  voidmemoize(int ruleIndex, int ruleStartIndex)
     Record whether or not this rule parsed the input at this position successfully.
public static  voidpanic()
    
public  voidrecover(RecognitionException ex, BitSet tokenSet)
    
public  voidremoveMessageListener(MessageListener l)
    
public  voidremoveParserListener(ParserListener l)
    
public  voidremoveParserMatchListener(ParserMatchListener l)
    
public  voidremoveParserTokenListener(ParserTokenListener l)
    
public  voidremoveSemanticPredicateListener(SemanticPredicateListener l)
    
public  voidremoveSyntacticPredicateListener(SyntacticPredicateListener l)
    
public  voidremoveTraceListener(TraceListener l)
    
public  voidreportError(RecognitionException ex)
    
public  voidreportError(String s)
    
public  voidreportWarning(String s)
    
public  voidrewind(int pos)
    
public  voidsetASTFactory(ASTFactory f)
     Specify an object with support code (shared by Parser and TreeParser.
public  voidsetASTNodeClass(String cl)
    
public  voidsetASTNodeType(String nodeType)
     Specify the type of node to create during tree building; use setASTNodeClass now to be consistent with Token Object Type accessor.
public  voidsetDebugMode(boolean debugMode)
    
public  voidsetFilename(String f)
    
public  voidsetIgnoreInvalidDebugCalls(boolean value)
    
public  voidsetInputState(ParserSharedInputState state)
    
public  voidsetTokenBuffer(TokenBuffer t)
    
public  voidtraceIn(String rname)
    
public  voidtraceIndent()
    
public  voidtraceOut(String rname)
    

Field Detail
INITIAL_FOLLOW_STACK_SIZE
final public static int INITIAL_FOLLOW_STACK_SIZE(Code)



MEMO_RULE_FAILED
final public static int MEMO_RULE_FAILED(Code)



MEMO_RULE_UNKNOWN
final public static int MEMO_RULE_UNKNOWN(Code)



astFactory
protected ASTFactory astFactory(Code)
AST support code; parser delegates to this object. This is set during parser construction by default to either "new ASTFactory()" or a ctor that has a token type to class map for hetero nodes.



inputState
protected ParserSharedInputState inputState(Code)



returnAST
protected AST returnAST(Code)
AST return value for a rule is squirreled away here



ruleMemo
protected Map[] ruleMemo(Code)
An array[size num rules] of Map that tracks the stop token index for each rule. ruleMemo[ruleIndex] is the memoization table for ruleIndex. For key ruleStartIndex, you get back the stop token for associated rule or MEMO_RULE_FAILED.



tokenNames
protected String[] tokenNames(Code)
Table of token type to token names



tokenTypeToASTClassMap
protected Hashtable tokenTypeToASTClassMap(Code)
Constructed if any AST types specified in tokens{..}. Maps an Integer->Class object.



traceDepth
protected int traceDepth(Code)
Used to keep track of indentdepth for traceIn/Out




Constructor Detail
Parser
public Parser()(Code)
Set to true upon any error; reset upon first valid token match



Parser
public Parser(ParserSharedInputState state)(Code)




Method Detail
LA
abstract public int LA(int i)(Code)
Return the token type of the ith token of lookahead where i=1 is the current token being examined by the parser (i.e., it has not been matched yet).



LT
abstract public Token LT(int i)(Code)
Return the ith token of lookahead



addMessageListener
public void addMessageListener(MessageListener l)(Code)



addParserListener
public void addParserListener(ParserListener l)(Code)



addParserMatchListener
public void addParserMatchListener(ParserMatchListener l)(Code)



addParserTokenListener
public void addParserTokenListener(ParserTokenListener l)(Code)



addSemanticPredicateListener
public void addSemanticPredicateListener(SemanticPredicateListener l)(Code)



addSyntacticPredicateListener
public void addSyntacticPredicateListener(SyntacticPredicateListener l)(Code)



addTraceListener
public void addTraceListener(TraceListener l)(Code)



alreadyParsedRule
public boolean alreadyParsedRule(int ruleIndex)(Code)
Has this rule already parsed input at the current index in the input stream? Return the stop token index or MEMO_RULE_UNKNOWN. If we attempted but failed to parse properly before, return MEMO_RULE_FAILED. This method has a side-effect: if we have seen this input for this rule and successfully parsed before, then seek ahead to 1 past the stop token matched for this rule last time.



consume
abstract public void consume()(Code)
Get another token object from the token stream



consumeUntil
public void consumeUntil(int tokenType)(Code)
Consume tokens until one matches the given token



consumeUntil
public void consumeUntil(BitSet set)(Code)
Consume tokens until one matches the given token set



defaultDebuggingSetup
protected void defaultDebuggingSetup(TokenStream lexer, TokenBuffer tokBuf)(Code)



getAST
public AST getAST()(Code)
Get the AST return value squirreled away in the parser



getASTFactory
public ASTFactory getASTFactory()(Code)



getFilename
public String getFilename()(Code)



getInputState
public ParserSharedInputState getInputState()(Code)



getRuleMemoization
public int getRuleMemoization(int ruleIndex, int ruleStartIndex)(Code)
Given a rule number and a start token index number, return MEMO_RULE_UNKNOWN if the rule has not parsed input starting from start index. If this rule has parsed input starting from the start index before, then return where the rule stopped parsing. It returns the index of the last token matched by the rule. For now we use a hashtable and just the slow Object-based one. Later, we can make a special one for ints and also one that tosses out data after we commit past input position i.



getTokenName
public String getTokenName(int num)(Code)



getTokenNames
public String[] getTokenNames()(Code)



getTokenTypeToASTClassMap
public Hashtable getTokenTypeToASTClassMap()(Code)
If the user specifies a tokens{} section with heterogeneous AST node types, then ANTLR generates code to fill this mapping.



isDebugMode
public boolean isDebugMode()(Code)



mark
public int mark()(Code)



match
public void match(int t) throws MismatchedTokenException(Code)
Make sure current lookahead symbol matches token type t. Throw an exception upon mismatch, which is catch by either the error handler or by the syntactic predicate.



match
public void match(BitSet b) throws MismatchedTokenException(Code)
Make sure current lookahead symbol matches the given set Throw an exception upon mismatch, which is catch by either the error handler or by the syntactic predicate.



matchNot
public void matchNot(int t) throws MismatchedTokenException(Code)



memoize
public void memoize(int ruleIndex, int ruleStartIndex)(Code)
Record whether or not this rule parsed the input at this position successfully. Use a standard java hashtable for now.



panic
public static void panic()(Code)



recover
public void recover(RecognitionException ex, BitSet tokenSet)(Code)



removeMessageListener
public void removeMessageListener(MessageListener l)(Code)



removeParserListener
public void removeParserListener(ParserListener l)(Code)



removeParserMatchListener
public void removeParserMatchListener(ParserMatchListener l)(Code)



removeParserTokenListener
public void removeParserTokenListener(ParserTokenListener l)(Code)



removeSemanticPredicateListener
public void removeSemanticPredicateListener(SemanticPredicateListener l)(Code)



removeSyntacticPredicateListener
public void removeSyntacticPredicateListener(SyntacticPredicateListener l)(Code)



removeTraceListener
public void removeTraceListener(TraceListener l)(Code)



reportError
public void reportError(RecognitionException ex)(Code)
Parser error-reporting function can be overridden in subclass



reportError
public void reportError(String s)(Code)
Parser error-reporting function can be overridden in subclass



reportWarning
public void reportWarning(String s)(Code)
Parser warning-reporting function can be overridden in subclass



rewind
public void rewind(int pos)(Code)



setASTFactory
public void setASTFactory(ASTFactory f)(Code)
Specify an object with support code (shared by Parser and TreeParser. Normally, the programmer does not play with this, using setASTNodeType instead.



setASTNodeClass
public void setASTNodeClass(String cl)(Code)



setASTNodeType
public void setASTNodeType(String nodeType)(Code)
Specify the type of node to create during tree building; use setASTNodeClass now to be consistent with Token Object Type accessor.



setDebugMode
public void setDebugMode(boolean debugMode)(Code)



setFilename
public void setFilename(String f)(Code)



setIgnoreInvalidDebugCalls
public void setIgnoreInvalidDebugCalls(boolean value)(Code)



setInputState
public void setInputState(ParserSharedInputState state)(Code)



setTokenBuffer
public void setTokenBuffer(TokenBuffer t)(Code)
Set or change the input token buffer



traceIn
public void traceIn(String rname)(Code)



traceIndent
public void traceIndent()(Code)



traceOut
public void traceOut(String rname)(Code)



Fields inherited from antlr.MatchExceptionState
final public static RecognitionException defaultException(Code)(Java Doc)
public boolean matchError(Code)(Java Doc)
public RecognitionException matchException(Code)(Java Doc)
final protected static boolean throwRecExceptions(Code)(Java Doc)

Methods inherited from antlr.MatchExceptionState
public void resetMatchError()(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.