pobs.parser
Class PSequence

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

public class PSequence
extends PParser

Matches any number of specified parsers in the given order, each one following the previous in sequence. Uses the skip directive. BNF: this := parser[0] .. parser[..] (any number of parsers can be specified)

Author:
Martijn W. van der Lee

Constructor Summary
PSequence(PObject[] parsers)
          Constructor taking an array of parsers.
PSequence(PObject parser1, PObject parser2)
          Stub constructor taking two parsers.
PSequence(PObject parser1, PObject parser2, PObject parser3)
          Stub constructor taking three parsers.
PSequence(PObject parser1, PObject parser2, PObject parser3, PObject parser4)
          Stub constructor taking four parsers.
PSequence(PObject parser1, PObject parser2, PObject parser3, PObject parser4, PObject parser5)
          Stub constructor taking five parsers.
 
Method Summary
 PMatch parse(PScanner input, long begin, PContext context)
           
 
Methods inherited from class pobs.PParser
addControl, getErrorInfo, process, setErrorInfo, setMatchAction, setMismatchAction
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PSequence

public PSequence(PObject[] parsers)
Constructor taking an array of parsers.

Parameters:
parsers - an array of parsers
Throws:
java.lang.IllegalArgumentException - if either no array is specified or array is empty.

PSequence

public PSequence(PObject parser1,
                 PObject parser2)
Stub constructor taking two parsers.


PSequence

public PSequence(PObject parser1,
                 PObject parser2,
                 PObject parser3)
Stub constructor taking three parsers.


PSequence

public PSequence(PObject parser1,
                 PObject parser2,
                 PObject parser3,
                 PObject parser4)
Stub constructor taking four parsers.


PSequence

public PSequence(PObject parser1,
                 PObject parser2,
                 PObject parser3,
                 PObject parser4,
                 PObject parser5)
Stub constructor taking five parsers.

Method Detail

parse

public PMatch parse(PScanner input,
                    long begin,
                    PContext context)
Parameters:
input - Input to be parsed.
begin - Index of first character of input to be parsed.
context - Parsing context.
Returns:
Parsing result.