예제 #1
0
 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))
예제 #2
0
 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))
예제 #3
0
 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))