Constructor
new LEMInterpreter(ast)
Parameters:
Name | Type | Description |
---|---|---|
ast |
AST | The abstract syntax tree that represents the query |
- Source:
Methods
interpret(logEvent) → {Boolean}
Parameters:
Name | Type | Description |
---|---|---|
logEvent |
LogEvent | The LogEvent to check |
- Source:
Returns:
- Type
- Boolean
(protected) visitBinaryOp(ast, env) → {LEMInterpreterValue}
Visits and interprets a BinaryOp in accordance with the visitor pattern
This method always produces a boolean-valued LEMInterpreterValue. The exact value of that boolean is the result of evaluating the binary operation represented by the BinaryOp that this method is visiting. See BinaryOp for information on the semantics of each operator.
Parameters:
Name | Type | Description |
---|---|---|
ast |
BinaryOp | |
env |
Object.<String, String> | The environment - the binding of identifiers to values as pure-object mapping of strings to strings. |
- Source:
Returns:
- Type
- LEMInterpreterValue
(protected) visitIdentifier(ast, env) → {LEMInterpreterValue}
Visits and interprets an Identifer in accordance with the visitor pattern
The value returned will be a string-valued LEMInterpreterValue whose value is the value bound to the identifier represented by the Identifier ast node that this method is visiting. If the identifier is unbound in the current environment, an exception is thrown
Parameters:
Name | Type | Description |
---|---|---|
ast |
BinaryOp | |
env |
Object.<String, String> | The environment - the binding of identifiers to values as pure-object mapping of strings to strings. |
Throws:
-
an exception if the identifier does not exist in the current environment
- Type
- Exception
Returns:
- Type
- LEMInterpreterValue
(protected) visitImplicitSearch(ast, env) → {LEMInterpreterValue}
Visits and interprets an ImplicitSearch in accordance with the visitor pattern
The value returned will be boolean-valued LEMInterpreterValue. The boolean value will be true if the ImplictSearch's query can be "found" in the environment. For a precise definition of found, see ImplicitSearch
Parameters:
Name | Type | Description |
---|---|---|
ast |
BinaryOp | |
env |
Object.<String, String> | The environment - the binding of identifiers to values as pure-object mapping of strings to strings. |
Returns:
- Type
- LEMInterpreterValue
(protected) visitRegexLiteral(ast, env) → {LEMInterpreterValue}
Visits and interprets a RegexLiteral in accordance with the visitor pattern
The value returned will be a regex-valued LEMInterpreterValue whose value is the regex literal represented by the RegexLiteral ast node this method is visiting.
Parameters:
Name | Type | Description |
---|---|---|
ast |
BinaryOp | |
env |
Object.<String, String> | The environment - the binding of identifiers to values as pure-object mapping of strings to strings. |
Returns:
- Type
- LEMInterpreterValue
(protected) visitStringLiteral(ast, env) → {LEMInterpreterValue}
Visits and interprets a StringLiteral in accordance with the visitor pattern
The value returned will be a string-valued LEMInterpreterValue whose value is the string literal represented by the StringLiteral ast node this method is visiting.
Parameters:
Name | Type | Description |
---|---|---|
ast |
BinaryOp | |
env |
Object.<String, String> | The environment - the binding of identifiers to values as pure-object mapping of strings to strings. |
Returns:
- Type
- LEMInterpreterValue