Java Doc for CSTNode.java in  » Scripting » groovy-1.0 » org » codehaus » groovy » syntax » 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 » Scripting » groovy 1.0 » org.codehaus.groovy.syntax 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.codehaus.groovy.syntax.CSTNode

All known Subclasses:   org.codehaus.groovy.syntax.Reduction,  org.codehaus.groovy.syntax.Token,
CSTNode
abstract public class CSTNode (Code)
An abstract base class for nodes in the concrete syntax tree that is the result of parsing. Note that the CSTNode is inextricably linked with the Token in that every CSTNode has a Token as it's root.
See Also:   antlr.Parser
See Also:   Token
See Also:   org.codehaus.groovy.syntax.Reduction
See Also:   org.codehaus.groovy.syntax.Types
author:
   bob mcwhirter
author:
   Chris Poirier
version:
   $Id: CSTNode.java 4032 2006-08-30 07:18:49Z mguillem $




Method Summary
public  CSTNodeadd(CSTNode element)
     Adds an element to the node.
public  voidaddChildrenOf(CSTNode of)
     Adds all children of the specified node to this one.
abstract public  ReductionasReduction()
     Creates a Reduction from this node.
public  booleancanMean(int type)
     Returns true if the node can be coerced to the specified type.
public  intchildren()
     Returns the number of non-root elements in the node.
abstract public  CSTNodeget(int index)
     Returns the specified element, or null.
public  CSTNodeget(int index, boolean safe)
     Returns the specified element, or Token.NULL if safe is set and the specified element is null (or doesn't exist).
public  StringgetDescription()
     Returns a description of the node.
public  intgetMeaning()
     Returns the meaning of this node.
public  intgetMeaningAs(int[] types)
     Returns the first matching meaning of the specified types.
abstract public  TokengetRoot()
     Returns the root of the node.
public  TokengetRoot(boolean safe)
     Returns the root of the node, the Token that indicates it's type.
public  StringgetRootText()
     Returns the text of the root.
public  intgetStartColumn()
     Returns the starting column of the node.
public  intgetStartLine()
     Returns the starting line of the node.
public  intgetType()
     Returns the actual type of the node.
public  booleanhasChildren()
     Returns true if the node has any non-root elements.
public  booleanisA(int type)
     Returns true if the node's meaning matches the specified type.
public  booleanisAllOf(int[] types)
     Returns true if the node's meaning matches all of the specified types.
public  booleanisAnExpression()
     Returns true if the node is a complete expression.
public  booleanisEmpty()
     Returns true if the node is completely empty (no root, even).
public  booleanisOneOf(int[] types)
     Returns true if the node's meaning matches any of the specified types.
public  voidmarkAsExpression()
     Marks the node a complete expression.
 booleanmatches(int type)
     Returns true if the node matches the specified type.
 booleanmatches(int type, int child1)
     Returns true if the node and it's first child match the specified types.
 booleanmatches(int type, int child1, int child2)
     Returns true if the node and it's first and second child match the specified types.
 booleanmatches(int type, int child1, int child2, int child3)
     Returns true if the node and it's first three children match the specified types.
 booleanmatches(int type, int child1, int child2, int child3, int child4)
     Returns true if the node an it's first four children match the specified types.
public  CSTNodeset(int index, CSTNode element)
     Sets an element node in at the specified index.
public  CSTNodesetMeaning(int meaning)
     Sets the meaning for this node (and it's root Token).
abstract public  intsize()
     Returns the number of elements in the node (including root).
public  StringtoString()
     Formats the node as a String and returns it.
public  voidwrite(PrintWriter writer)
     Formats the node and writes it to the specified Writer.
protected  voidwrite(PrintWriter writer, String indent)
     Formats the node and writes it to the specified Writer.



Method Detail
add
public CSTNode add(CSTNode element)(Code)
Adds an element to the node. Returns the element for convenience. Not all nodes support this operation!



addChildrenOf
public void addChildrenOf(CSTNode of)(Code)
Adds all children of the specified node to this one. Not all nodes support this operation!



asReduction
abstract public Reduction asReduction()(Code)
Creates a Reduction from this node. Returns self if the node is already a Reduction.



canMean
public boolean canMean(int type)(Code)
Returns true if the node can be coerced to the specified type.



children
public int children()(Code)
Returns the number of non-root elements in the node.



get
abstract public CSTNode get(int index)(Code)
Returns the specified element, or null.



get
public CSTNode get(int index, boolean safe)(Code)
Returns the specified element, or Token.NULL if safe is set and the specified element is null (or doesn't exist).



getDescription
public String getDescription()(Code)
Returns a description of the node.



getMeaning
public int getMeaning()(Code)
Returns the meaning of this node. If the node isEmpty(), returns the type of Token.NULL.



getMeaningAs
public int getMeaningAs(int[] types)(Code)
Returns the first matching meaning of the specified types. Returns Types.UNKNOWN if there are no matches.



getRoot
abstract public Token getRoot()(Code)
Returns the root of the node. By convention, all nodes have a Token as the first element (or root), which indicates the type of the node. May return null if the node isEmpty().



getRoot
public Token getRoot(boolean safe)(Code)
Returns the root of the node, the Token that indicates it's type. Returns a Token.NULL if safe and the actual root is null.



getRootText
public String getRootText()(Code)
Returns the text of the root. Uses getRoot(true) to get the root, so you will only receive null in return if the root token returns it.



getStartColumn
public int getStartColumn()(Code)
Returns the starting column of the node. Returns -1 if not known.



getStartLine
public int getStartLine()(Code)
Returns the starting line of the node. Returns -1 if not known.



getType
public int getType()(Code)
Returns the actual type of the node. If the node isEmpty(), returns the type of Token.NULL.



hasChildren
public boolean hasChildren()(Code)
Returns true if the node has any non-root elements.



isA
public boolean isA(int type)(Code)
Returns true if the node's meaning matches the specified type.



isAllOf
public boolean isAllOf(int[] types)(Code)
Returns true if the node's meaning matches all of the specified types.



isAnExpression
public boolean isAnExpression()(Code)
Returns true if the node is a complete expression.



isEmpty
public boolean isEmpty()(Code)
Returns true if the node is completely empty (no root, even).



isOneOf
public boolean isOneOf(int[] types)(Code)
Returns true if the node's meaning matches any of the specified types.



markAsExpression
public void markAsExpression()(Code)
Marks the node a complete expression. Not all nodes support this operation!



matches
boolean matches(int type)(Code)
Returns true if the node matches the specified type. Effectively a synonym for isA(). Missing nodes are Token.NULL.



matches
boolean matches(int type, int child1)(Code)
Returns true if the node and it's first child match the specified types. Missing nodes are Token.NULL.



matches
boolean matches(int type, int child1, int child2)(Code)
Returns true if the node and it's first and second child match the specified types. Missing nodes are Token.NULL.



matches
boolean matches(int type, int child1, int child2, int child3)(Code)
Returns true if the node and it's first three children match the specified types. Missing nodes are Token.NULL.



matches
boolean matches(int type, int child1, int child2, int child3, int child4)(Code)
Returns true if the node an it's first four children match the specified types. Missing nodes have type Types.NULL.



set
public CSTNode set(int index, CSTNode element)(Code)
Sets an element node in at the specified index. Returns the element for convenience. Not all nodes support this operation!



setMeaning
public CSTNode setMeaning(int meaning)(Code)
Sets the meaning for this node (and it's root Token). Not valid if the node isEmpty(). Returns the node, for convenience.



size
abstract public int size()(Code)
Returns the number of elements in the node (including root).



toString
public String toString()(Code)
Formats the node as a String and returns it.



write
public void write(PrintWriter writer)(Code)
Formats the node and writes it to the specified Writer.



write
protected void write(PrintWriter writer, String indent)(Code)
Formats the node and writes it to the specified Writer. The indent is prepended to each output line, and is increased for each recursion.



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.