Exemple #1
0
  def Parse(self, expression):
    """Parses an event filter expression.

    Args:
      expression (str): event filter expression.

    Returns:
      Expression: expression.
    """
    if not expression:
      return expressions.IdentityExpression()

    self._Reset()
    self._buffer = expression

    token = self._GetNextToken()
    while token:
      token = self._GetNextToken()

    return self._Reduce()
Exemple #2
0
 def testCompile(self):
   """Tests the Compile function."""
   expression = expressions.IdentityExpression()
   expression.Compile()