Class BaseToken

java.lang.Object
com.tangosol.coherence.dsltools.base.BaseToken
Direct Known Subclasses:
CompoundBaseToken, LeafBaseToken

public abstract class BaseToken extends Object
BaseToken is the abstract base class for all tokens processed by the low level BaseTokenScanner. The resulting hierarchy represents very simple syntactic elements.
Author:
djl 2009.03.14
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the simple class name for this instance.
    abstract boolean
    Answer whether this token is a compound token.
    boolean
    Answer whether this token represents an identifier.
    abstract boolean
    Answer whether this token is a leaf token.
    boolean
    Answer whether this token represents a literal.
    boolean
    Answer whether this token represents a nested collection of tokens.
    boolean
    Answer whether this token represents a know operator.
    boolean
    Answer whether this token represents a punctuation character.
    boolean
    Answer whether this token matches the given string.
    abstract boolean
    match(String s, boolean fIgnoreCaseFlag)
    Answer whether this token matches the given string.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BaseToken

      public BaseToken()
  • Method Details

    • isLeaf

      public abstract boolean isLeaf()
      Answer whether this token is a leaf token.
      Returns:
      the answer to the question "is this token a leaf?"
    • isCompound

      public abstract boolean isCompound()
      Answer whether this token is a compound token.
      Returns:
      the answer to the question "is this token compound?"
    • isLiteral

      public boolean isLiteral()
      Answer whether this token represents a literal.
      Returns:
      the answer to the question "is this token a literal?"
    • isOperator

      public boolean isOperator()
      Answer whether this token represents a know operator.
      Returns:
      the answer to the question "is this token an operator?"
    • isIdentifier

      public boolean isIdentifier()
      Answer whether this token represents an identifier.
      Returns:
      the answer to the question "is this token an identifier?"
    • isNest

      public boolean isNest()
      Answer whether this token represents a nested collection of tokens.
      Returns:
      the answer to the question "is this token a nesting of tokens?"
    • isPunctuation

      public boolean isPunctuation()
      Answer whether this token represents a punctuation character.
      Returns:
      the answer to the question "is this token a punctuation character?"
    • match

      public boolean match(String s)
      Answer whether this token matches the given string. By default case matters.
      Parameters:
      s - the String to match agains
      Returns:
      the answer to the question "does this token match a given string?
    • match

      public abstract boolean match(String s, boolean fIgnoreCaseFlag)
      Answer whether this token matches the given string.
      Parameters:
      s - the String to match agains
      fIgnoreCaseFlag - the flag that controls if case matters
      Returns:
      the answer to the question "does this token match a given string?
    • getSimpleName

      public String getSimpleName()
      Return the simple class name for this instance.
      Returns:
      the class name without the package path