Class CQLLexer

java.lang.Object
org.z3950.zing.cql.CQLLexer
All Implemented Interfaces:
CQLTokenizer

public class CQLLexer extends Object implements CQLTokenizer
Implementation of the CQL lexical syntax analyzer
Author:
jakub
  • Constructor Details

    • CQLLexer

      public CQLLexer(String cql, boolean debug)
  • Method Details

    • move

      public void move()
      Description copied from interface: CQLTokenizer
      Consume next input token
      Specified by:
      move in interface CQLTokenizer
    • value

      public String value()
      Description copied from interface: CQLTokenizer
      Return the value of the last consumed token
      Specified by:
      value in interface CQLTokenizer
      Returns:
      value of the token
    • what

      public int what()
      Description copied from interface: CQLTokenizer
      Return the type of the last consumed token
      Specified by:
      what in interface CQLTokenizer
      Returns:
      last consumed token
    • render

      public String render()
      Description copied from interface: CQLTokenizer
      Render the type and value of the last consumed token
      Specified by:
      render in interface CQLTokenizer
      Returns:
      human-readable string
    • render

      public String render(int token, boolean quoteChars)
      Description copied from interface: CQLTokenizer
      Render specified token type
      Specified by:
      render in interface CQLTokenizer
      Parameters:
      token - token type
      quoteChars - true, if single characters should be quoted for readability
      Returns:
      human-readable string
    • getStart

      public int getStart()
      Returns the current token's inclusive UTF-16 source start, or -1 before the first move. Quotes are included; leading whitespace is excluded. At end of input the span is empty at the input length.
      Returns:
      token start
    • getEnd

      public int getEnd()
      Returns the current token's exclusive UTF-16 source end, or -1 before the first move.
      Returns:
      token end
    • pos

      public int pos()
      Specified by:
      pos in interface CQLTokenizer
    • main

      public static void main(String[] args) throws Exception
      Throws:
      Exception