Class ExpressionLexer

java.lang.Object
edu.cmu.tetrad.calculator.parser.ExpressionLexer

public class ExpressionLexer extends Object
Parses the tokens of an expression.
Version:
$Id: $Id
Author:
Tyler Gibson
  • Constructor Details

    • ExpressionLexer

      public ExpressionLexer(CharSequence seq)

      Constructor for ExpressionLexer.

      Parameters:
      seq - a CharSequence object
  • Method Details

    • nextToken

      public final Token nextToken()

      nextToken.

      Returns:
      the type of the next token. For words and quoted charSequence tokens, the charSequence that the token represents can be fetched by calling the getString method.
    • nextTokenIncludingWhitespace

      public final Token nextTokenIncludingWhitespace()

      nextTokenIncludingWhitespace.

      Returns:
      a Token object
    • getTokenString

      public String getTokenString()

      getTokenString.

      Returns:
      the string corresponding to the last token lexed.
    • getCurrentOffset

      public int getCurrentOffset()

      Getter for the field currentOffset.

      Returns:
      the previous offset, before the getModel token was read (i.e. the offset of the getModel token.
    • getNextOffset

      public int getNextOffset()

      Getter for the field nextOffset.

      Returns:
      the getModel offset.