Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.port80.eclipse.csharp.llk.parser
Class LLKNode  view LLKNode download LLKNode.java

java.lang.Object
  extended bycom.port80.eclipse.csharp.llk.parser.LLKNode
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
ASTArgument, ASTArgumentList, ASTArrayCreation, ASTAssignmentExpression, ASTAttribute, ASTAttributeArguments, ASTAttributeSection, ASTAttributeSections, ASTBaseAccess, ASTBooleanExpression, ASTBooleanLiteral, ASTBreakStatement, ASTBuiltinTypes, ASTCastExpression, ASTCatchClause, ASTCatchClauses, ASTCharLiteral, ASTCheckedExpression, ASTCheckedStatement, ASTClassMemberDeclaration, ASTConditionalExpression, ASTConstantDeclaration, ASTConstructorBaseInitializer, ASTConstructorDeclarator, ASTConstructorInitializer, ASTConstructorThisInitializer, ASTContinueStatement, ASTConversionOperatorDeclarator, ASTDeclarationStatement, ASTDelegate, ASTDoStatement, ASTElementAccess, ASTEmbeddedStatement, ASTEmptyStatement, ASTExpression, ASTExpressionStatement, ASTFieldDeclaration, ASTFixedPointerDeclarator, ASTFixedPointerDeclarators, ASTFixedStatement, ASTForeachStatement, ASTForInitializer, ASTForIterator, ASTForStatement, ASTGotoStatement, ASTIfStatement, ASTIndexer, ASTInterfaceEventDeclaration, ASTInterfaceIndexerDeclaration, ASTInterfaceMemberDeclaration, ASTLabeledStatement, ASTLiteral, ASTLocalConstantDeclaration, ASTLocalVariableDeclaration, ASTLockStatement, ASTNamedArgument, ASTNamedArgumentList, ASTNewExpression, ASTNullLiteral, ASTObjectCreation, ASTObjectCreationExpression, ASTOperatorDeclarator, ASTParameter, ASTParameterList, ASTParenthesizedExpression, ASTPositionalArgumentList, ASTPrimaryExpression, ASTPrimaryPrefix, ASTPrimarySuffix, ASTResourceAcquisition, ASTReturnStatement, ASTSizeofExpression, ASTStatement, ASTStatementExpression, ASTStatementExpressionList, ASTStatementList, ASTStringLiteral, ASTSwitchBlock, ASTSwitchLabel, ASTSwitchLabels, ASTSwitchSection, ASTSwitchStatement, ASTThisAccess, ASTThrowStatement, ASTTryStatement, ASTType, ASTTypeofExpression, ASTTypePrefix, ASTUnary, ASTUncheckedExpression, ASTUncheckedStatement, ASTUnsafeStatement, ASTUsingAliasDirective, ASTUsingNamespaceDirective, ASTUsingStatement, ASTVariableInitializer, ASTWhileStatement, com.port80.eclipse.csharp.llk.ast.BinaryExpression, com.port80.eclipse.csharp.llk.ast.LLKScope, com.port80.eclipse.csharp.llk.ast.Variable

public class LLKNode
extends java.lang.Object
implements java.lang.Cloneable


Field Summary
protected  LLKNode first
           
protected  LLKToken firstToken
           
protected  LLKToken lastToken
           
protected  int modifier
           
protected  java.lang.String name
           
protected  LLKToken namePosition
           
protected  LLKNode next
           
protected  LLKNode parent
           
protected  java.lang.String text
           
protected  int type
           
 
Constructor Summary
LLKNode(int type)
           
 
Method Summary
 java.lang.Object accept(ILLKCSharpParserVisitor visitor, java.lang.Object data)
           
 void addAll(LLKNode list, LLKNode child)
          Insert all nodes in the given list to the children list after the given child.
 void addChild(LLKNode c)
          Decouple given node from its parent and siblings and append it to end of children list.
 void addChild(LLKNode node, LLKNode child)
          Decouple given node from its parent and siblings and insert it after the given child.
 void addModifier(int mod)
           
 java.lang.String ASSERT()
           
 boolean checkDistinct(LLKNode a, LLKNode b)
           
private  boolean checkDistinct1(LLKNode a, LLKNode b)
           
 java.lang.Object childrenAccept(ILLKCSharpParserVisitor visitor, java.lang.Object data)
           
 int childrenCount()
           
 java.lang.Object clone()
          This method may be called to create a new copy of the Object.
 int countDescendent(int[] types)
           
 void detach()
          Remove this node from its parent's children list.
 void dumpXml(FormatBuffer buf, boolean withtext)
           
 void dumpXml(FormatBuffer buf, boolean withtext, boolean preserve)
           
 java.util.List findDescendent(int type, java.util.List ret)
           
 LLKNode getChild(int n)
          Get the nth child.
 int getColumn()
           
 LLKNode getFirstChild()
           
 LLKToken getFirstToken()
           
 LLKNode getLastChild()
           
 LLKToken getLastToken()
           
 int getLine()
           
 java.lang.String getLocationString()
           
 int getModifier()
           
 java.lang.String getName()
           
 int getNameOffset()
           
 LLKToken getNamePosition()
           
 LLKNode getNextSibling()
           
 LLKNode getParent()
           
 java.lang.String getText()
           
 int getType()
           
 boolean hasAncestor(int type)
           
 boolean hasChildren()
           
 boolean hasDescendent(int type)
           
 boolean hasDescendent(int[] types)
           
 boolean hasModifier(int mod)
           
 boolean hasOneOrLessChild()
           
 boolean hasOnlyDescendent(int type)
           
 boolean hasOnlyDescendent(int[] types)
           
 boolean hasSingleChild()
           
 int indexOf(LLKNode c)
           
 void init(int mod, LLKToken pos)
           
 void init(int mod, java.lang.String name, LLKToken pos)
           
 void prependChild(LLKNode c)
          Decouple given node from its parent and insert it as first child in the children list.
 void removeChild(LLKNode c)
          Remove given child from children list.
 LLKNode removeChildren()
          Remove all children.
 void removeModifier(int mod)
           
 void setFirstToken(LLKToken t)
           
 void setLastToken(LLKToken t)
           
 void setModifier(int mod)
           
 void setName(java.lang.String name)
           
 void setNamePosition(LLKToken t)
           
 void setParent(LLKNode n)
           
 void setText(java.lang.String text)
           
 void setType(int type)
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

protected int type

modifier

protected int modifier

name

protected java.lang.String name

text

protected java.lang.String text

parent

protected LLKNode parent

first

protected LLKNode first

next

protected LLKNode next

namePosition

protected LLKToken namePosition

firstToken

protected LLKToken firstToken

lastToken

protected LLKToken lastToken
Constructor Detail

LLKNode

public LLKNode(int type)
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from class: java.lang.Object
This method may be called to create a new copy of the Object. The typical behavior is as follows:
  • o == o.clone() is false
  • o.getClass() == o.clone().getClass() is true
  • o.equals(o) is true

However, these are not strict requirements, and may be violated if necessary. Of the three requirements, the last is the most commonly violated, particularly if the subclass does not override Object.equals(Object)>Object.equals(Object) 55 .

If the Object you call clone() on does not implement java.lang.Cloneable (which is a placeholder interface), then a CloneNotSupportedException is thrown. Notice that Object does not implement Cloneable; this method exists as a convenience for subclasses that do.

Object's implementation of clone allocates space for the new Object using the correct class, without calling any constructors, and then fills in all of the new field values with the old field values. Thus, it is a shallow copy. However, subclasses are permitted to make a deep copy.

All array types implement Cloneable, and override this method as follows (it should never fail):

 public Object clone()
 {
   try
     {
       super.clone();
     }
   catch (CloneNotSupportedException e)
     {
       throw new InternalError(e.getMessage());
     }
 }
 


accept

public java.lang.Object accept(ILLKCSharpParserVisitor visitor,
                               java.lang.Object data)

childrenAccept

public java.lang.Object childrenAccept(ILLKCSharpParserVisitor visitor,
                                       java.lang.Object data)

ASSERT

public java.lang.String ASSERT()

init

public void init(int mod,
                 LLKToken pos)

init

public void init(int mod,
                 java.lang.String name,
                 LLKToken pos)

getType

public int getType()

setType

public void setType(int type)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getNamePosition

public LLKToken getNamePosition()

setNamePosition

public void setNamePosition(LLKToken t)

getNameOffset

public int getNameOffset()

setModifier

public void setModifier(int mod)

addModifier

public void addModifier(int mod)

removeModifier

public void removeModifier(int mod)

getModifier

public int getModifier()

hasModifier

public boolean hasModifier(int mod)

getParent

public LLKNode getParent()

setParent

public void setParent(LLKNode n)

getFirstChild

public LLKNode getFirstChild()

getNextSibling

public LLKNode getNextSibling()

getLastChild

public LLKNode getLastChild()

getChild

public LLKNode getChild(int n)
Get the nth child. First child at n==0.


indexOf

public int indexOf(LLKNode c)

childrenCount

public int childrenCount()

hasChildren

public boolean hasChildren()

hasSingleChild

public boolean hasSingleChild()

hasOneOrLessChild

public boolean hasOneOrLessChild()

prependChild

public void prependChild(LLKNode c)
Decouple given node from its parent and insert it as first child in the children list.


addChild

public void addChild(LLKNode c)
Decouple given node from its parent and siblings and append it to end of children list.


addChild

public void addChild(LLKNode node,
                     LLKNode child)
Decouple given node from its parent and siblings and insert it after the given child. If given child==null, insert node as first child.


addAll

public void addAll(LLKNode list,
                   LLKNode child)
Insert all nodes in the given list to the children list after the given child. If given child==null, insert node as first child.


removeChild

public void removeChild(LLKNode c)
Remove given child from children list. Removed child is keep intact, ie. all its fields are not modified.


removeChildren

public LLKNode removeChildren()
Remove all children.


detach

public void detach()
Remove this node from its parent's children list. Keep node intact ie. all its fields are not modified.


getFirstToken

public LLKToken getFirstToken()

setFirstToken

public void setFirstToken(LLKToken t)

getLastToken

public LLKToken getLastToken()

setLastToken

public void setLastToken(LLKToken t)

setText

public void setText(java.lang.String text)

getText

public java.lang.String getText()

getLine

public int getLine()

getColumn

public int getColumn()

getLocationString

public java.lang.String getLocationString()

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


hasAncestor

public boolean hasAncestor(int type)

hasDescendent

public boolean hasDescendent(int type)

hasDescendent

public boolean hasDescendent(int[] types)

hasOnlyDescendent

public boolean hasOnlyDescendent(int type)

hasOnlyDescendent

public boolean hasOnlyDescendent(int[] types)

countDescendent

public int countDescendent(int[] types)

findDescendent

public java.util.List findDescendent(int type,
                                     java.util.List ret)

checkDistinct

public boolean checkDistinct(LLKNode a,
                             LLKNode b)

checkDistinct1

private boolean checkDistinct1(LLKNode a,
                               LLKNode b)

dumpXml

public void dumpXml(FormatBuffer buf,
                    boolean withtext)

dumpXml

public void dumpXml(FormatBuffer buf,
                    boolean withtext,
                    boolean preserve)