Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| http://www.jpicedt.org
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jpicedt.format.input.util
Class AbstractRegularExpression

    java.lang.Object
      jpicedt.format.input.util.AbstractRegularExpression

All Implemented Interfaces:
  ExpressionConstants

Direct Known Subclasses:
  AlternateExpression, EnclosingExpression, LiteralExpression, NumericalExpression, OptionalExpression, PicEndExpression, PicPointExpression, PsObjectExpression, RegExExpression, RepeatExpression, SequenceExpression, StatementExpression, WildCharExpression, WordExpression

public abstract class AbstractRegularExpression
extends Object
implements ExpressionConstants

This is the abstract superclass for all regular expressions that may help building a RegExp-based parser. It mimics the RegExp scheme, while at the same time allowing expressions to send ParserEvent's when a piece of input text was successfully parsed (that is, instead of delegating to a separate ParserHandler through a callback mechanism, events are handled in the core of the `action` method). A `Context` is then used to feed successive pieces of text to the set of reg-exp's that build up the grammar tree, and a `Pool` allow reg-exp's to share data across the whole grammar tree.

Since:
  jpicedt 1.3
Version:
  $Id: AbstractRegularExpression.java,v 1.4.2.1 2007/09/02 11:56:13 reynal Exp $
Author:
  Sylvain Reynal

Field Summary

Fields inherited from interface jpicedt.format.input.util.ExpressionConstants
`ANY_CHAR, ANY_CHAR_EOL, ANY_SIGN, AT_LEAST, AT_MOST, DEBUG, DOUBLE, EOL, EXACTLY, INTEGER, NEGATIVE, NON_NULL, POSITIVE, STRICTLY_NEGATIVE, STRICTLY_POSITIVE, WHITE_SPACES, WHITE_SPACES_OR_EOL`

Constructor Summary
`AbstractRegularExpression()`

Method Summary
`void` | `action(ParserEvent e)` Called in the course of the interpret operation at the end of a SUCCESSFUL interpret operation.
`abstract boolean` | `interpret(Context c)` Parses this expression, possibly using the given Context to fetch the String to interpret if this Expression is a leaf expression.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AbstractRegularExpression

    public AbstractRegularExpression()

Method Detail

### interpret

    public abstract boolean interpret(Context c)
                               throws REParserException

  Parses this expression, possibly using the given Context to fetch the String to interpret if this Expression is a leaf expression.

  Returns:
    TRUE if parsing was successful
  Throws:
    `REParserException` - if an error occur during parsing

### action

    public void action(ParserEvent e)
                throws REParserException

  Called in the course of the interpret operation at the end of a SUCCESSFUL interpret operation. Should be overriden by daughter classes to process proper action, e.g. set Element's attributes... Current implementation does nothing, but sending a debugging string.

  Throws:
    `REParserException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| http://www.jpicedt.org
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a bug : syd@jpicedt.org