
    <i                     :    S SK JrJrJr  SSKJr   " S S\5      rg)   )
INDEX_STAR_PatternData_string_literal_to_string   )STIXPatternListenerc                       \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rS rS rS rS rS rS rS rS rS rS rS rS rSrg)InspectionListener   zThis listener collects info about a pattern and puts it
in a python structure.  It is intended to assist apps which wish to
look "inside" a pattern and know what's in there.
c                 j    0 U l         [        5       U l        [        5       U l        S U l        S U l        g N)$_InspectionListener__comparison_dataset_InspectionListener__qualifiers$_InspectionListener__observation_ops_InspectionListener__obj_type_InspectionListener__obj_pathselfs    U/home/james-whalen/.local/lib/python3.13/site-packages/stix2patterns/v21/inspector.py__init__InspectionListener.__init__   s,    !#E!$    c                 X    [        U R                  U R                  U R                  5      $ r   )r   r   r   r   r   s    r   pattern_dataInspectionListener.pattern_data   s(    D22D4J4J --/ 	/r   c                     XR                   ;  a  / U R                   U'   U R                   U   R                  X#U45        g r   )r   append)r   obj_typeobj_pathopvalues        r   __add_prop_tuple#InspectionListener.__add_prop_tuple   s<    111/1D""8,x(//u0EFr   c                 f    UR                  5       (       a  U R                  R                  S5        g g )N
FOLLOWEDBY)r%   r   addr   ctxs     r   exitObservationExpressions-InspectionListener.exitObservationExpressions   s(    >>""&&}5 r   c                 f    UR                  5       (       a  U R                  R                  S5        g g )NOR)r,   r   r&   r'   s     r   exitObservationExpressionOr.InspectionListener.exitObservationExpressionOr    s&    6688""&&u- r   c                 f    UR                  5       (       a  U R                  R                  S5        g g )NAND)r0   r   r&   r'   s     r   exitObservationExpressionAnd/InspectionListener.exitObservationExpressionAnd$   s&    7799""&&v. r   c                     U R                   R                  SR                  UR                  S5      UR                  S5      5      5        g )NzSTART {0} STOP {1}    r   )r   r&   formatTimestampLiteralr'   s     r   exitStartStopQualifier)InspectionListener.exitStartStopQualifier(   s?    !(($$Q')=)=a)@	
r   c                     U R                   R                  SR                  UR                  5       =(       d    UR	                  5       5      5        g )NzWITHIN {0} SECONDS)r   r&   r5   IntPosLiteralFloatPosLiteralr'   s     r   exitWithinQualifier&InspectionListener.exitWithinQualifier/   s>    !((!!#<s':':'<	
r   c                 t    U R                   R                  SR                  UR                  5       5      5        g )NzREPEATS {0} TIMES)r   r&   r5   r:   r'   s     r   exitRepeatedQualifier(InspectionListener.exitRepeatedQualifier6   s0     ''!!#	
r   c                 4   UR                  5       =(       d    UR                  5       nUR                  5       (       a  SOSnX2R                  5       -  nUR	                  5       R                  5       nU R                  U R                  U R                  UU5        g NNOT  )EQNEQNOTgetTextprimitiveLiteral#_InspectionListener__add_prop_tupler   r   r   r(   op_tokop_strr!   s        r   exitPropTestEqual$InspectionListener.exitPropTestEqual=   sn    &SWWYGGII3..""$$&..0doot#	%r   c                    UR                  5       =(       d>    UR                  5       =(       d'    UR                  5       =(       d    UR                  5       nUR	                  5       (       a  SOSnX2R                  5       -  nUR                  5       R                  5       nU R                  U R                  U R                  UU5        g rB   )
GTLTGELErG   rH   orderableLiteralrJ   r   r   rK   s        r   exitPropTestOrder$InspectionListener.exitPropTestOrderG   s    =SVVX==SVVXGGII3..""$$&..0doot#	%r   c                     UR                  5       (       a  SOSnUS-  nUR                  5       R                  5       nU R                  U R                  U R
                  UU5        g )NrC   rD   IN)rG   
setLiteralrH   rJ   r   r   r   r(   rM   r!   s       r   exitPropTestSet"InspectionListener.exitPropTestSetQ   sP    GGII3% ((*doot#	%r   c                     UR                  5       (       a  SOSnUS-  nUR                  5       R                  5       nU R                  U R                  U R
                  UU5        g )NrC   rD   LIKErG   StringLiteralrH   rJ   r   r   r[   s       r   exitPropTestLike#InspectionListener.exitPropTestLikeZ   sS    GGII3'!!#++-doot#	%r   c                     UR                  5       (       a  SOSnUS-  nUR                  5       R                  5       nU R                  U R                  U R
                  UU5        g )NrC   rD   MATCHESr`   r[   s       r   exitPropTestRegex$InspectionListener.exitPropTestRegexc   sS    GGII3*!!#++-doot#	%r   c                     UR                  5       (       a  SOSnUS-  nUR                  5       R                  5       nU R                  U R                  U R
                  UU5        g )NrC   rD   ISSUBSETr`   r[   s       r   exitPropTestIsSubset'InspectionListener.exitPropTestIsSubsetl   sS    GGII3+!!#++-doot#	%r   c                     UR                  5       (       a  SOSnUS-  nUR                  5       R                  5       nU R                  U R                  U R
                  UU5        g )NrC   rD   
ISSUPERSETr`   r[   s       r   exitPropTestIsSuperset)InspectionListener.exitPropTestIsSupersetu   sS    GGII3-!!#++-doot#	%r   c                 .    UR                  5       U l        g r   )rH   r   r'   s     r   exitObjectType!InspectionListener.exitObjectType~   s    ++-r   c                     UR                  5       (       a  [        UR                  5       5      nOUR                  5       nU/U l        g r   )ra   r   rH   r   r   r(   path_components      r   exitFirstPathComponent)InspectionListener.exitFirstPathComponent   s9    6s7H7H7JKN [[]N)*r   c                     UR                  5       (       a  UR                  5       R                  5       nO[        UR                  5       5      nU R                  R                  U5        g r   )IdentifierWithoutHyphenrH   r   ra   r   r   rt   s      r   exitKeyPathStep"InspectionListener.exitKeyPathStep   sM    &&(( 88:BBDN6s7H7H7JKN~.r   c                     UR                  5       (       a   U R                  R                  [        5        g U R                  R                  [	        UR                  5       R                  5       5      5        g r   )ASTERISKr   r   r   intr:   rH   r'   s     r   exitIndexPathStep$InspectionListener.exitIndexPathStep   sH    <<>>OO"":.OO""3s'8'8':'B'B'D#EFr   )__comparison_data
__obj_path
__obj_type__observation_ops__qualifiersN)__name__
__module____qualname____firstlineno____doc__r   r   rJ   r)   r-   r1   r7   r<   r?   rN   rV   r\   rb   rf   rj   rn   rq   rv   rz   r   __static_attributes__ r   r   r	   r	      sm    
/G6./


%%%%%%%(+/Gr   r	   N)	inspectorr   r   r   grammars.STIXPatternListenerr   r	   r   r   r   <module>r      s    K K =PG, PGr   