Overview   Project   Class   Tree   Deprecated   Index 
Grammatica 1.5 Documentation
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

PerCederberg.Grammatica.Runtime
Class Node

System.Object
   |
   +--Node

   in Node.cs
Direct Known Subclasses:
Production, Token

public abstract class Node
extends System.Object

An abstract parse tree node. This class is inherited by all nodes in the parse tree, i.e. by the token and production classes.


Field Summary
 virtual int Count
          The child node count property (read-only).
 virtual int EndColumn
          The column number property of the last character in this node (read-only).
 virtual int EndLine
          The line number property of the last character in this node (read-only).
 abstract int Id
          The node type id property (read-only).
 abstract string Name
          The node name property (read-only).
 Node Parent
          The parent node property (read-only).
 virtual int StartColumn
          The column number property of the first character in this node (read-only).
 virtual int StartLine
          The line number property of the first character in this node (read-only).
 virtual Node[ int index ] this
          The child node index (read-only).
 ArrayList Values
          The node values property.
 
Method Summary
 void AddValue( object value )
          Deprecated. Use the Values property and the Values.Add method instead.
 void AddValues( ArrayList values )
          Deprecated. Use the Values property and the Values.AddRange method instead.
 ArrayList GetAllValues()
          Deprecated. Use the Values property instead. Note that the Values property will never be null, but possibly empty.
 virtual Node GetChildAt( int index )
          Deprecated. Use the class indexer instead.
 virtual int GetChildCount()
          Deprecated. Use the Count property instead.
 int GetDescendantCount()
          Returns the number of descendant nodes.
 virtual int GetEndColumn()
          Deprecated. Use the EndColumn property instead.
 virtual int GetEndLine()
          Deprecated. Use the EndLine property instead.
 virtual int GetId()
          Deprecated. Use the Id property instead.
 virtual string GetName()
          Deprecated. Use the Name property instead.
 Node GetParent()
          Deprecated. Use the Parent property instead.
 virtual int GetStartColumn()
          Deprecated. Use the StartColumn property instead.
 virtual int GetStartLine()
          Deprecated. Use the StartLine property instead.
 object GetValue( int pos )
          Deprecated. Use the Values property and it's array indexer instead.
 int GetValueCount()
          Deprecated. Use the Values and Values.Count properties instead.
 internal virtual bool IsHidden()
          Checks if this node is hidden, i.
 void PrintTo( TextWriter output )
          Prints this node and all subnodes to the specified output stream.
 void RemoveAllValues()
          Deprecated. Use the Values property and the Values.Clear method instead. Alternatively the Values property can be set to null.
 internal void SetParent( Node parent )
          Sets the parent node.
 

Field Detail

Count

public virtual int Count;
The child node count property (read-only).
Since:
1.5

EndColumn

public virtual int EndColumn;
The column number property of the last character in this node (read-only). If the node has child elements, this value will be fetched from the last child.
Since:
1.5

EndLine

public virtual int EndLine;
The line number property of the last character in this node (read-only). If the node has child elements, this value will be fetched from the last child.
Since:
1.5

Id

public abstract int Id;
The node type id property (read-only). This value is set as a unique identifier for each type of node, in order to simplify later identification.
Since:
1.5

Name

public abstract string Name;
The node name property (read-only).
Since:
1.5

Parent

public Node Parent;
The parent node property (read-only).
Since:
1.5

StartColumn

public virtual int StartColumn;
The column number property of the first character in this node (read-only). If the node has child elements, this value will be fetched from the first child.
Since:
1.5

StartLine

public virtual int StartLine;
The line number property of the first character in this node (read-only). If the node has child elements, this value will be fetched from the first child.
Since:
1.5

this

public virtual Node this[ int index ];
The child node index (read-only).
Parameters:
index - the child index, 0 <= index < Count
Returns:
the child node found, or null if index out of bounds
Since:
1.5

Values

public ArrayList Values;
The node values property. This property provides direct access to the list of computed values associated with this node during analysis. Note that setting this property to null will remove all node values. Any operation on the value array list is allowed and is immediately reflected through the various value reading and manipulation methods.
Since:
1.5


Method Detail

AddValue

public void AddValue( object value );
Deprecated. Use the Values property and the Values.Add method instead.

Adds a computed value to this node. The computed value may be used for storing intermediate results in the parse tree during analysis.

Parameters:
value - the node value
See Also:
Values

AddValues

public void AddValues( ArrayList values );
Deprecated. Use the Values property and the Values.AddRange method instead.

Adds a set of computed values to this node.

Parameters:
values - the vector with node values
See Also:
Values

GetAllValues

public ArrayList GetAllValues();
Deprecated. Use the Values property instead. Note that the Values property will never be null, but possibly empty.

Returns the list with all the computed values for this node. Note that the list is not a copy, so changes will affect the values in this node (as it is the same object).

Returns:
a list with all values, or null if no values have been set
See Also:
Values

GetChildAt

public virtual Node GetChildAt( int index );
Deprecated. Use the class indexer instead.

Returns the child node with the specified index.

Parameters:
index - the child index, 0 <= index < count
Returns:
the child node found, or null if index out of bounds

GetChildCount

public virtual int GetChildCount();
Deprecated. Use the Count property instead.

Returns the number of child nodes.

Returns:
the number of child nodes

GetDescendantCount

public int GetDescendantCount();
Returns the number of descendant nodes.
Returns:
the number of descendant nodes
Since:
1.2

GetEndColumn

public virtual int GetEndColumn();
Deprecated. Use the EndColumn property instead.

The column number of the last character in this node. If the node has child elements, this value will be fetched from the last child.

Returns:
the column number of the last token character, or -1 if not applicable
See Also:
EndColumn

GetEndLine

public virtual int GetEndLine();
Deprecated. Use the EndLine property instead.

The line number of the last character in this node. If the node has child elements, this value will be fetched from the last child.

Returns:
the line number of the last token character, or -1 if not applicable
See Also:
EndLine

GetId

public virtual int GetId();
Deprecated. Use the Id property instead.

Returns the node type id. This value is set as a unique identifier for each type of node, in order to simplify later identification.

Returns:
the node type id
See Also:
Id

GetName

public virtual string GetName();
Deprecated. Use the Name property instead.

Returns the node name.

Returns:
the node name
See Also:
Name

GetParent

public Node GetParent();
Deprecated. Use the Parent property instead.

Returns the parent node.

Returns:
the parent parse tree node
See Also:
Parent

GetStartColumn

public virtual int GetStartColumn();
Deprecated. Use the StartColumn property instead.

The column number of the first character in this node. If the node has child elements, this value will be fetched from the first child.

Returns:
the column number of the first token character, or -1 if not applicable
See Also:
StartColumn

GetStartLine

public virtual int GetStartLine();
Deprecated. Use the StartLine property instead.

The line number of the first character in this node. If the node has child elements, this value will be fetched from the first child.

Returns:
the line number of the first character, or -1 if not applicable
See Also:
StartLine

GetValue

public object GetValue( int pos );
Deprecated. Use the Values property and it's array indexer instead.

Returns a computed value of this node, if previously set. A value may be used for storing intermediate results in the parse tree during analysis.

Parameters:
pos - the value position, 0 <= pos < count
Returns:
the computed node value, or null if not set
See Also:
Values

GetValueCount

public int GetValueCount();
Deprecated. Use the Values and Values.Count properties instead.

Returns the number of computed values associated with this node. Any number of values can be associated with a node through calls to AddValue().

Returns:
the number of values associated with this node
See Also:
Values

IsHidden

 internal virtual bool IsHidden();
Checks if this node is hidden, i.e. if it should not be visible outside the parser.
Returns:
true if the node should be hidden, or false otherwise

PrintTo

public void PrintTo( TextWriter output );
Prints this node and all subnodes to the specified output stream.
Parameters:
output - the output stream to use

RemoveAllValues

public void RemoveAllValues();
Deprecated. Use the Values property and the Values.Clear method instead. Alternatively the Values property can be set to null.

Removes all computed values stored in this node.

See Also:
Values

SetParent

 internal void SetParent( Node parent );
Sets the parent node.
Parameters:
parent - the new parent node

 Overview   Project   Class   Tree   Deprecated   Index 
Grammatica 1.5 Documentation
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD