@@ -772,28 +772,33 @@ private module IteratorAccessSynth {
772
772
// TODO: We could join on something other than the string if we wanted (i.e., the raw parameter).
773
773
v .getPropertyName ( ) .toLowerCase ( ) = result and
774
774
result =
775
- pb .getScriptBlock ( )
776
- .getParamBlock ( )
777
- .getAPipelineByPropertyNameParameter ( )
778
- .getLowerCaseName ( )
775
+ pb .getScriptBlock ( ) .getParamBlock ( ) .getAPipelineByPropertyNameParameter ( ) .getLowerCaseName ( )
779
776
}
780
777
778
+ private Raw:: Ast getParent ( Raw:: Ast a ) { a .getParent ( ) = result }
779
+
780
+ private predicate isVarAccess ( Raw:: VarAccess va ) { any ( ) }
781
+
782
+ private predicate isProcessBlock ( Raw:: ProcessBlock pb ) { any ( ) }
783
+
784
+ private Raw:: ProcessBlock getProcessBlock ( Raw:: VarAccess va ) =
785
+ doublyBoundedFastTC( getParent / 1 , isVarAccess / 1 , isProcessBlock / 1 ) ( va , result )
786
+
781
787
private class IteratorAccessSynth extends Synthesis {
782
788
final override predicate isRelevant ( Raw:: Ast a ) {
783
- exists ( Raw:: ProcessBlock pb , Raw:: VarAccess va |
784
- va = a and
785
- pb = va .getParent + ( )
786
- |
789
+ exists ( Raw:: VarAccess va | va = a |
787
790
va .getUserPath ( ) = "_"
788
791
or
789
- va .getUserPath ( ) .toLowerCase ( ) =
790
- pb .getScriptBlock ( ) .getParamBlock ( ) .getPipelineParameter ( ) .getLowerCaseName ( )
791
- or
792
- va .getUserPath ( ) .toLowerCase ( ) =
793
- pb .getScriptBlock ( )
794
- .getParamBlock ( )
795
- .getAPipelineByPropertyNameParameter ( )
796
- .getLowerCaseName ( )
792
+ exists ( Raw:: ProcessBlock pb | pb = getProcessBlock ( va ) |
793
+ va .getUserPath ( ) .toLowerCase ( ) =
794
+ pb .getScriptBlock ( ) .getParamBlock ( ) .getPipelineParameter ( ) .getLowerCaseName ( )
795
+ or
796
+ va .getUserPath ( ) .toLowerCase ( ) =
797
+ pb .getScriptBlock ( )
798
+ .getParamBlock ( )
799
+ .getAPipelineByPropertyNameParameter ( )
800
+ .getLowerCaseName ( )
801
+ )
797
802
)
798
803
}
799
804
@@ -811,7 +816,7 @@ private module IteratorAccessSynth {
811
816
812
817
private PipelineOrPipelineByPropertyNameIteratorVariable varAccess ( Raw:: VarAccess va ) {
813
818
exists ( Raw:: ProcessBlock pb |
814
- pb = va . getParent + ( ) and
819
+ pb = getProcessBlock ( va ) and
815
820
result = TVariableSynth ( pb , _) and
816
821
va .getUserPath ( ) .toLowerCase ( ) = getAPipelineIteratorName ( pb , result )
817
822
)
0 commit comments