Package com.github.beothorn.agent.parser
Class Lexer
- java.lang.Object
-
- com.github.beothorn.agent.parser.Lexer
-
public class Lexer extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Lexer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Deque<Token>tokenize(java.lang.String input)This Lexer will generate tokens for our string matcher.
-
-
-
Method Detail
-
tokenize
public static java.util.Deque<Token> tokenize(java.lang.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
-
-