orc.runtime.nodes
Class WithLocation

java.lang.Object
  extended by orc.runtime.nodes.Node
      extended by orc.runtime.nodes.WithLocation
All Implemented Interfaces:
java.io.Serializable, Located

public class WithLocation
extends Node
implements Located

Annotates a node with a source location which is tracked by the token (for use in tracing and error messages). I opted to introduce a new node rather than add this capability for existing nodes because that makes it easier to omit this information in an "optimized" build.

Author:
quark
See Also:
Serialized Form

Field Summary
 SourceLocation location
           
 Node next
           
 
Constructor Summary
WithLocation(Node next, SourceLocation location)
           
 
Method Summary
 SourceLocation getSourceLocation()
           
 void process(Token t)
          The process method is the fundamental operation in the execution engine.
 
Methods inherited from class orc.runtime.nodes.Node
isTerminal, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

next

public final Node next

location

public final SourceLocation location
Constructor Detail

WithLocation

public WithLocation(Node next,
                    SourceLocation location)
Method Detail

process

public void process(Token t)
Description copied from class: Node
The process method is the fundamental operation in the execution engine. It is called to perform the action of the node on a token.

Specified by:
process in class Node
Parameters:
t - input token being processed

getSourceLocation

public SourceLocation getSourceLocation()
Specified by:
getSourceLocation in interface Located