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 SequenceExpression

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

All Implemented Interfaces:
  ExpressionConstants

Direct Known Subclasses:
  BeginPictureExpression, BeginPsPictureExpression, CommentExpression, DefaultParser, EepicDrawlineCommand, EepicPathCommand, LaTeXBox, LaTeXCircle, LaTeXLine, LaTeXOval, LaTeXPutExpression, LineThicknessExpression, PicEllipseExpression, PicLineExpression, PicPolygonExpression, PicRectangleExpression, PsArcExpression, PsBezierExpression, PsBox, PsCircleExpression, PsEllipseExpression, PsFrameExpression, PsPolygonExpression, PsQDiskExpression, PsQLineExpression, PsRPutExpression, PSTArrowExpression, PSTBooleanExpression, PSTColorExpression, PSTDashExpression, PSTDotStyleExpression, PSTFillStyleExpression, PSTLengthParameter, PSTLineStyleExpression, PsUnitLengthExpression, UnitLengthExpression

public class SequenceExpression
extends AbstractRegularExpression

An expression that represents a sequence of expressions to be matched exactly in the same order they're being added to the sequence.

Since:
  jpicedt 1.3
Version:
  $Id: SequenceExpression.java,v 1.4.2.1 2007/09/02 11:56:14 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
`SequenceExpression()` constructs a sequence that contains no sub-expression and doesn't throw IncompleteSequenceException
`SequenceExpression(AbstractRegularExpression expr)` constructs a sequence with the given expression as the first sub-expression and which doesn't throw IncompleteSequenceException.
`SequenceExpression(AbstractRegularExpression expr1, AbstractRegularExpression expr2)` constructs a sequence with the given expression as the first and second sub-expression and which doesn't throw Exception
`SequenceExpression(AbstractRegularExpression expr1, AbstractRegularExpression expr2, AbstractRegularExpression expr3, boolean throwIncompleteSequenceException)` constructs a sequence with three sub-expressions
`SequenceExpression(AbstractRegularExpression expr1, AbstractRegularExpression expr2, boolean throwIncompleteSequenceException)` constructs a sequence with the given expression as the first and second sub-expression
`SequenceExpression(AbstractRegularExpression expr, boolean throwIncompleteSequenceException)` constructs a sequence with the given expression as the first sub-expression.
`SequenceExpression(boolean throwIncompleteSequenceException)` constructs a sequence that contains no sub-expression.

Method Summary
`void` | `add(AbstractRegularExpression expr)` add the given expression to the sequence
`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.
`String` | `toString()`

Methods inherited from class jpicedt.format.input.util.AbstractRegularExpression
`action`

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

Constructor Detail

### SequenceExpression

    public SequenceExpression()

  constructs a sequence that contains no sub-expression and doesn't throw IncompleteSequenceException

### SequenceExpression

    public SequenceExpression(boolean throwIncompleteSequenceException)

  constructs a sequence that contains no sub-expression.

Parameters:
  `throwIncompleteSequenceException` - if TRUE, and if the first sub-expression has been found but any ensuing expression hasn't been found, throw a REParserException.IncompleteSequenceException.

### SequenceExpression

    public SequenceExpression(AbstractRegularExpression expr)

  constructs a sequence with the given expression as the first sub-expression and which doesn't throw IncompleteSequenceException.

### SequenceExpression

    public SequenceExpression(AbstractRegularExpression expr,
                              boolean throwIncompleteSequenceException)

  constructs a sequence with the given expression as the first sub-expression.

Parameters:
  `throwIncompleteSequenceException` - if TRUE, and if the first sub-expression has been found but any ensuing sub-expression hasn't been found, throw a REParserException.IncompleteSequenceException.

### SequenceExpression

    public SequenceExpression(AbstractRegularExpression expr1,
                              AbstractRegularExpression expr2)

  constructs a sequence with the given expression as the first and second sub-expression and which doesn't throw Exception

### SequenceExpression

    public SequenceExpression(AbstractRegularExpression expr1,
                              AbstractRegularExpression expr2,
                              boolean throwIncompleteSequenceException)

  constructs a sequence with the given expression as the first and second sub-expression

Parameters:
  `throwIncompleteSequenceException` - if TRUE, and if the first sub-expression has been found but any ensuing sub-expression hasn't been found, throw a REParserException.IncompleteSequenceException.

### SequenceExpression

    public SequenceExpression(AbstractRegularExpression expr1,
                              AbstractRegularExpression expr2,
                              AbstractRegularExpression expr3,
                              boolean throwIncompleteSequenceException)

  constructs a sequence with three sub-expressions

Parameters:
  `throwIncompleteSequenceException` - if TRUE, and if the first sub-expression has been found but any ensuing sub-expression hasn't been found, throw a REParserException.IncompleteSequenceException.

Method Detail

### add

    public void add(AbstractRegularExpression expr)

  add the given expression to the sequence

### interpret

    public boolean interpret(Context c)
                      throws REParserException

  Description copied from class: `AbstractRegularExpression`
  Parses this expression, possibly using the given Context to fetch the String to interpret if this Expression is a leaf expression.

  Specified by:
    `interpret` in class `AbstractRegularExpression`
  Returns:
    TRUE if and only if every expression contained in this SequenceExpression were found, in the same order as they were added to the sequence. FALSE otherwise.
  Throws:
    `REParserException.IncompleteSequence` - if flag throwIncompleteSequenceException is TRUE and any expression but the first one wasn't found Whether TRUE or FALSE, calls action with key="&" and value=new Integer(index of last expression parsed with success)
    `REParserException` - if an error occur during parsing

### toString

    public String toString()

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