pmp
Class RegExps

java.lang.Object
  extended by pmp.Macroprocessor.Component
      extended by pmp.RegExps

public class RegExps
extends Macroprocessor.Component

List of regular expressions with associated tokens.

Title: PMP: Macroprocessor

Description: Java macroprocessor

Copyright: Copyright (c) 2005

Version:
1.0
Author:
Luděk Hlaváček

Field Summary
protected static int CHUNK_SIZE
           
 
Constructor Summary
RegExps(Macroprocessor mp)
           
 
Method Summary
(package private)  void addRegExp(java.lang.String regexp, Token token)
          Adds new regular expression.
(package private)  void clear()
          Remove all active regular expressions.
static java.util.regex.Pattern compilePattern(java.lang.String pattern)
          Creates Pattern objects using cache if possible.
 Token outputToken()
          Returns next token.
(package private)  void reset()
          Returns all unprocessed input and resets all states of Matchers.
(package private)  int size()
          Returns number of active regular expressions.
 java.lang.String toString()
           
 
Methods inherited from class pmp.Macroprocessor.Component
error, getMP, getMPAnalyzer, getMPIO, getMPIQ, getMPMacros, notice, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CHUNK_SIZE

protected static final int CHUNK_SIZE
See Also:
Constant Field Values
Constructor Detail

RegExps

public RegExps(Macroprocessor mp)
Method Detail

compilePattern

public static java.util.regex.Pattern compilePattern(java.lang.String pattern)
Creates Pattern objects using cache if possible.

All patterns are compiled with flag Pattern.DOTALL.

Parameters:
pattern - given regex
Returns:
Pattern object for given regex
See Also:
Pattern.compile(java.lang.String, int)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

reset

void reset()
Returns all unprocessed input and resets all states of Matchers.


clear

void clear()
Remove all active regular expressions.


size

int size()
Returns number of active regular expressions.

Returns:
number of inems in internal list of reg. exppressions

addRegExp

void addRegExp(java.lang.String regexp,
               Token token)
Adds new regular expression.

Parameters:
regexp - regular expression
token - Token object that will be returned if input matches regexp. Field string will contain matching string.

outputToken

public Token outputToken()
Returns next token.

Returns:
token with processed string, type and ID