pobs.parser
Class PPointer

java.lang.Object
  extended bypobs.parser.PPointer
All Implemented Interfaces:
PObject

public class PPointer
extends java.lang.Object
implements PObject

Pointer to a single parser object. It is used to implement recursive parsers more easily by creating the pointers prior to assigning them their parser. Does nothing but pass through the parse call to the specified parser object.

Author:
Martijn W. van der Lee

Constructor Summary
PPointer()
           
 
Method Summary
 PMatch process(PScanner input, long begin, PContext context)
          Delegates call to the wrapped parser object.
 void set(PObject pObject)
          Sets the parser to which this pointer references.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PPointer

public PPointer()
Method Detail

set

public void set(PObject pObject)
Sets the parser to which this pointer references.

Parameters:
pObject - the references parser

process

public PMatch process(PScanner input,
                      long begin,
                      PContext context)
Delegates call to the wrapped parser object.

Specified by:
process in interface PObject
Parameters:
input - a PScanner which contains the entire input sequence
begin - the index location into the input from where to start processing
context - the current processing context
Returns:
the processing result
Throws:
java.lang.IllegalStateException - if no parser object has been set by set(PObject).
See Also:
PMatch