def exitObservationExpressionOr( self, ctx: STIXPatternParser.ObservationExpressionOrContext): logger.debug("{} {} {}".format("ObservationExpressionOr", ctx, ctx.getText())) if ctx.OR(): # Check if there's OR'd Observation Expressions expr2 = self.pop() expr1 = self.pop() operator = ObservationOperators.Or self.push(CombinedObservationExpression(expr1, expr2, operator))
def exitObservationExpressions( self, ctx: STIXPatternParser.ObservationExpressionsContext): logger.debug("{} {} {}".format("ObservationExpressions", ctx, ctx.getText())) if ctx.FOLLOWEDBY(): expr2 = self.pop() expr1 = self.pop() operator = ObservationOperators.FollowedBy self.push(CombinedObservationExpression(expr1, expr2, operator))
def exitObservationExpressionAnd( self, ctx: STIXPatternParser.ObservationExpressionAndContext): logger.debug("{} {} {}".format("ObservationExpressionAnd", ctx, ctx.getText())) if ctx.AND(): expr2 = self.pop() expr1 = self.pop() operator = ObservationOperators.And self.push(CombinedObservationExpression(expr1, expr2, operator))