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


java.lang.Object
   xtc.lang.CParserState

All known Subclasses:   xtc.lang.c4.C4ParserState,
CParserState
public class CParserState implements State(Code)
The global state for parsing C. This class provides a simplified symbol table that is organized as a stack of parsing contexts, with a new context being pushed onto the stack through CParserState.start() and popped again through CParserState.commit() or CParserState.abort() .
author:
   Robert Grimm
version:
   $Revision: 1.15 $

Inner Class :protected static class Context

Field Summary
final protected static  booleanDEBUG
     The flag for whether to print debug information to the console.
final protected static  intFLAG_MODIFIED
     The flag for having modified the bindings.
final protected static  intFLAG_PARAMS
     The flag for having parsed a function parameter list.
final protected static  intFLAG_SCOPE
     The flag for scopes.
final protected static  intFLAG_STRUCTURE
     The flag for structure/union declaration lists.
final protected static  intFLAG_TYPEDEF
     The flag for typedefs.
final protected static  intFLAG_TYPE_SPEC
     The flag for having parsed a type specifier.
final protected static  intPOOL_INCR
     The increment of the context pool.
final protected static  intPOOL_INIT
     The initial size of the context pool.
protected  Annotationannotation
     The current annotation, if any.
protected  intnesting
     The current nesting level.
protected  Contexttop
     The top of the context stack.

Constructor Summary
public  CParserState()
     Create a C parser state object.

Method Summary
public  voidabort()
    
protected  voidaddToPool(Context c)
     Return the specified context to the pool, clearing it along the way.
public  Nodeannotate(Node node)
     Annotate the specified node.
public  voidbind(String id)
     Implicitly bind the specified identifier.
public  voidbind(String id, boolean isType)
     Explicitly bind the specified identifier.
public  voidcommit()
    
public  voidenterStructure()
     Enter a structure declaration list.
public  voidexitStructure()
     Exit a structure declaration list.
protected  voidfillPool(int n)
     Add the specified number of fresh contexts to the pool.
public  voidfunctionDeclarator()
     Record a function declarator.
public  voidident(String ident, Location location)
     Record an ident directive.
public  booleanisType(String id)
     Determine whether the specified identifier names a type.
Parameters:
  id - The identifier.
public  booleanisValid(Node idl)
     Determine whether a declaration actually is a declaration.
public  voidlineMarker(String file, int line, String isStartFile, String isReturnToFile, String isSystemHeader, String isExternC, Location location)
     Record a line marker.
public  voidmark()
     Mark the current annotation.
public  voidparameters()
     Record a function parameter list.
protected  Contextpop()
     Pop a context from the context stack.
public  voidpopScope()
     Exit the last scope.
public  voidpragma(String directive, Location location)
     Record a pragma.
protected  voidpush(Context c)
     Push the specified context onto the context stack.
public  voidpushScope()
     Enter a new scope.
public  voidreset(String file)
    
public  voidstart()
    
protected  ContexttakeFromPool()
     Take a context from the pool, refilling the pool if necessary.
public  voidtypeSpecifier()
     Record a type specifier.
public  voidtypedef()
     Record a typedef storage class specifier.

Field Detail
DEBUG
final protected static boolean DEBUG(Code)
The flag for whether to print debug information to the console.



FLAG_MODIFIED
final protected static int FLAG_MODIFIED(Code)
The flag for having modified the bindings.



FLAG_PARAMS
final protected static int FLAG_PARAMS(Code)
The flag for having parsed a function parameter list.



FLAG_SCOPE
final protected static int FLAG_SCOPE(Code)
The flag for scopes.



FLAG_STRUCTURE
final protected static int FLAG_STRUCTURE(Code)
The flag for structure/union declaration lists.



FLAG_TYPEDEF
final protected static int FLAG_TYPEDEF(Code)
The flag for typedefs.



FLAG_TYPE_SPEC
final protected static int FLAG_TYPE_SPEC(Code)
The flag for having parsed a type specifier.



POOL_INCR
final protected static int POOL_INCR(Code)
The increment of the context pool.



POOL_INIT
final protected static int POOL_INIT(Code)
The initial size of the context pool.



annotation
protected Annotation annotation(Code)
The current annotation, if any.



nesting
protected int nesting(Code)
The current nesting level.



top
protected Context top(Code)
The top of the context stack. The implementation assumes that this field always references at least one context, which corresponds to the global namespace.




Constructor Detail
CParserState
public CParserState()(Code)
Create a C parser state object.




Method Detail
abort
public void abort()(Code)



addToPool
protected void addToPool(Context c)(Code)
Return the specified context to the pool, clearing it along the way.
Parameters:
  c - The context to return.



annotate
public Node annotate(Node node)(Code)
Annotate the specified node. If any annotations have been recorded and CParserState.mark() marked , the specified node is wrapped by those annotations and the outer-most annotation is returned. Otherwise, the specified node is returned.
Parameters:
  node - The node. The annotated node.



bind
public void bind(String id)(Code)
Implicitly bind the specified identifier. Depending on the current parsing context, the identifier is either bound as a type or as an object/function/constant.
Parameters:
  id - The identifier.



bind
public void bind(String id, boolean isType)(Code)
Explicitly bind the specified identifier.
Parameters:
  id - The identifier.
Parameters:
  isType - The flag for whether the identifier represents atype.



commit
public void commit()(Code)



enterStructure
public void enterStructure()(Code)
Enter a structure declaration list.



exitStructure
public void exitStructure()(Code)
Exit a structure declaration list.



fillPool
protected void fillPool(int n)(Code)
Add the specified number of fresh contexts to the pool.
Parameters:
  n - The number to add.



functionDeclarator
public void functionDeclarator()(Code)
Record a function declarator.



ident
public void ident(String ident, Location location)(Code)
Record an ident directive.
See Also:   SourceIdentity
Parameters:
  ident - The actual identity marker.
Parameters:
  location - The ident directive's source location.



isType
public boolean isType(String id)(Code)
Determine whether the specified identifier names a type.
Parameters:
  id - The identifier. true if the specified identifier names a type.



isValid
public boolean isValid(Node idl)(Code)
Determine whether a declaration actually is a declaration. This method determines whether the sequence
 DeclarationSpecifiers l:InitializedDeclaratorList?
 
can actually represent a declaration. It assumes that any type specifier encountered while parsing DeclarationSpecifiers has been marked through CParserState.typeSpecifier() .
Parameters:
  idl - The result of parsing the optional initializeddeclarator list. true if the declaration is a declaration.



lineMarker
public void lineMarker(String file, int line, String isStartFile, String isReturnToFile, String isSystemHeader, String isExternC, Location location)(Code)
Record a line marker. Note that string values for the four flags are interpreted as follows: Any non-null string counts for true, while null counts for false.
See Also:   LineMarker
Parameters:
  file - The file name (without quotes).
Parameters:
  line - The line number.
Parameters:
  isStartFile - The start file flag.
Parameters:
  isReturnToFile - The return to file flag.
Parameters:
  isSystemHeader - The system header flag.
Parameters:
  isExternC - The extern C flag.
Parameters:
  location - The line marker's source location.



mark
public void mark()(Code)
Mark the current annotation. This method must be called before recognizing the nonterminals to be annotated. Furthermore, it must be called within the context of a stateful production.



parameters
public void parameters()(Code)
Record a function parameter list.



pop
protected Context pop()(Code)
Pop a context from the context stack. The top-most context.



popScope
public void popScope()(Code)
Exit the last scope.



pragma
public void pragma(String directive, Location location)(Code)
Record a pragma.
See Also:   Pragma
Parameters:
  directive - The actual directive.
Parameters:
  location - The pragma's source location.



push
protected void push(Context c)(Code)
Push the specified context onto the context stack.
Parameters:
  c - The context to push.



pushScope
public void pushScope()(Code)
Enter a new scope.



reset
public void reset(String file)(Code)



start
public void start()(Code)



takeFromPool
protected Context takeFromPool()(Code)
Take a context from the pool, refilling the pool if necessary. A fresh context.



typeSpecifier
public void typeSpecifier()(Code)
Record a type specifier.



typedef
public void typedef()(Code)
Record a typedef storage class specifier.



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.