pobs.parser
Class PChar

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

public class PChar
extends PParser

Matches only if the next character on input is the character specified. Uses case sensitivity directive. BNF: parser := 'c' (where c is the character specified)

Author:
Martijn W. van der Lee

Constructor Summary
PChar(char character)
          Sole constructor which allows specification of the character to be matched.
 
Method Summary
 PMatch parse(PScanner input, long begin, PContext context)
          Determines if there is any input left and returns a succesful match if the next character on input matches the specified character.
 
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

PChar

public PChar(char character)
Sole constructor which allows specification of the character to be matched.

Parameters:
character - the character that will be matched
Method Detail

parse

public PMatch parse(PScanner input,
                    long begin,
                    PContext context)
Determines if there is any input left and returns a succesful match if the next character on input matches the specified character.

Parameters:
input - Input to be parsed.
begin - Index of first character of input to be parsed.
context - Parsing context.
Returns:
Parsing result.