orc.runtime.nodes
Class WithLocation
java.lang.Object
orc.runtime.nodes.Node
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
next
public final Node next
location
public final SourceLocation location
WithLocation
public WithLocation(Node next,
SourceLocation location)
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