Class ExpressionPiece

java.lang.Object
net.diversionmc.parser.util.Pointable
net.diversionmc.parser.expression.ExpressionPiece
Direct Known Subclasses:
CharPiece, CommentPiece, GroupPiece, NamePiece, NumberPiece, StringPiece

public abstract class ExpressionPiece extends Pointable

Expression Pieces are the units of the text format. They represent single characters or sequences of characters digested into structural form by first parsing pass.

A piece usually features a PiecePredicate determining which piece type should start processing at a current point in file given a character. There must be only one valid piece type at a given point. Piece never starts with a whitespace character (space, tab, newline, etc), when there is no currently set piece, the whitespace characters are skipped.

  • Constructor Details

    • ExpressionPiece

      public ExpressionPiece(FilePointer ptr)
      Construct a piece at a position.
      Parameters:
      ptr - Creation position.
  • Method Details