Class Lexer

java.lang.Object
com.github.beothorn.agent.parser.Lexer

public class Lexer extends Object
  • Constructor Details

    • Lexer

      public Lexer()
  • Method Details

    • tokenize

      public static Deque<Token> tokenize(String input) throws CompilationException
      This Lexer will generate tokens for our string matcher. For example given the expression: (foobar||endsWith(baz) && !qux) we would get the tokens: {LEFT_PAREN, STRING_VALUE("foobar"), OPERATOR_OR("||"), FUNCTION_CALL("endsWith"), LEFT_PAREN("())") STRING_VALUE("baz"), OPERATOR_AND("&&"), OPERATOR_NOT("!"), RIGHT_PAREN(")")}
      Parameters:
      input - The expression to be tokenized
      Throws:
      CompilationException - with clear error message