java.lang.Object
jpicedt.graphic.io.parser.AbstractRegularExpression
- All Implemented Interfaces:
- ExpressionConstants
- Direct Known Subclasses:
- AlternateExpression, EnclosingExpression, GNURegExpression, LiteralExpression, NumericalExpression, OptionalExpression, PicPointExpression, RepeatExpression, SequenceExpression, StatementExpression, TerminalExpression, WildCharExpression, WordExpression
- public abstract class AbstractRegularExpression
- extends java.lang.Object
- implements ExpressionConstants
This is the abstract superclass for all regular expression that build up the LaTeX parser.
It mimics the RegExp scheme, while at the same time allowing expression to send ParserEvent when
a piece of text was successfully parsed (instead of delegating to a separate ParserHandler,
events are handled directly in the core of the action
method).
A Context
is then used to feed successive pieces of text to the reg-exp's that build up
the grammar tree,
and a Pool
(currently implemented as an inner class of the LaTeXParser) allow reg-exp to
share data.
Fields inherited from interface jpicedt.graphic.io.parser.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 |
Method Summary |
void |
action(ParserEvent e)
Called during interpret operation at the end of a SUCCESSFUL interpret operation. |
abstract boolean |
interpret(Context c)
Parses this expression, possibly using 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 |
AbstractRegularExpression
public AbstractRegularExpression()
interpret
public abstract boolean interpret(Context c)
throws ParserException
- Parses this expression, possibly using Context to fetch the String to interpret
if this Expression is a leaf expression.
action
public void action(ParserEvent e)
throws ParserException
- Called during interpret operation at the end of a SUCCESSFUL interpret operation.
Should be overriden by daughter classes to process proper action, e.g. set object properties...
Current implementation does nothing.