xtc.tree
Class LineMarker

java.lang.Object
  extended by xtc.tree.Node
      extended by xtc.tree.Annotation
          extended by xtc.tree.LineMarker
All Implemented Interfaces:
java.lang.Iterable<java.lang.Object>, Locatable

public class LineMarker
extends Annotation

A line marker (as used by GCC).

Version:
$Revision: 1.9 $
Author:
Robert Grimm

Field Summary
 java.lang.String file
          The file name.
static int FLAG_EXTERN_C
          The extern C flag.
static int FLAG_RETURN_TO_FILE
          The return to file flag.
static int FLAG_START_FILE
          The start file flag.
static int FLAG_SYSTEM_HEADER
          The system header flag.
 int flags
          The flags.
 int line
          The line number.
 
Constructor Summary
LineMarker(int line, java.lang.String file, int flags, Node node)
          Create a new line marker.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.Object get(int index)
          Get the child at the specified index.
 int hashCode()
           
 boolean hasTraversal()
          Determine whether this node supports generic traversal of its children.
 java.lang.Object set(int index, java.lang.Object value)
          Set the child at the specified index to the specified value.
 int size()
          Get the number of children.
 
Methods inherited from class xtc.tree.Annotation
getNode, getTokenText, innerMost, isAnnotation, setNode, strip, toAnnotation
 
Methods inherited from class xtc.tree.Node
add, add, addAll, addAll, addAll, addAll, addAllTo, addNode, contains, getBoolean, getBooleanProperty, getGeneric, getList, getLocation, getName, getNode, getProperty, getString, getStringProperty, hasLocation, hasName, hasProperty, hasVariable, indexOf, isEmpty, isGeneric, isList, isToken, iterator, lastIndexOf, properties, remove, removeProperty, setLocation, setLocation, setProperty, toList, toString, toToken, write
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FLAG_START_FILE

public static final int FLAG_START_FILE
The start file flag.

See Also:
Constant Field Values

FLAG_RETURN_TO_FILE

public static final int FLAG_RETURN_TO_FILE
The return to file flag.

See Also:
Constant Field Values

FLAG_SYSTEM_HEADER

public static final int FLAG_SYSTEM_HEADER
The system header flag.

See Also:
Constant Field Values

FLAG_EXTERN_C

public static final int FLAG_EXTERN_C
The extern C flag.

See Also:
Constant Field Values

line

public int line
The line number.


file

public java.lang.String file
The file name.


flags

public int flags
The flags.

Constructor Detail

LineMarker

public LineMarker(int line,
                  java.lang.String file,
                  int flags,
                  Node node)
Create a new line marker.

Parameters:
line - The line number.
file - The file name.
flags - The flags.
node - The marked node.
Method Detail

hasTraversal

public boolean hasTraversal()
Description copied from class: Node
Determine whether this node supports generic traversal of its children. The default implementation returns false.

Overrides:
hasTraversal in class Node
Returns:
true if this node supports generic traversal of its children.

size

public int size()
Description copied from class: Node
Get the number of children. The default implementation signals an unsupported operation exception.

Overrides:
size in class Node
Returns:
The number of children.

get

public java.lang.Object get(int index)
Description copied from class: Node
Get the child at the specified index. The default implementation signals an unsupported operation exception.

Note that instance tests on the returned object may not behave as expected. Notably, any node may be wrapped in annotations. Furthermore, any string may be wrapped in a token (and, recursively, in annotations).

Overrides:
get in class Node
Parameters:
index - The index.
Returns:
The child at that positioin.
See Also:
Token.test(Object), Token.cast(Object), GNode.test(Object), GNode.cast(Object)

set

public java.lang.Object set(int index,
                            java.lang.Object value)
Description copied from class: Node
Set the child at the specified index to the specified value. The default implementation signals an unsupported operation exception.

Overrides:
set in class Node
Parameters:
index - The index.
value - The new value.
Returns:
The old value.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object


Copyright © 2012. All Rights Reserved.