@@ -740,7 +740,7 @@ abstract class TranslatedSpecificJump extends TranslatedStmt {
740740 override Instruction getChildSuccessor ( TranslatedElement child ) { none ( ) }
741741
742742 /**
743- * The instruction that is the target of the jump.
743+ * The instruction that gets the target of the jump.
744744 */
745745 abstract Instruction getTargetInstruction ( ) ;
746746}
@@ -749,39 +749,39 @@ class TranslatedBreakStmt extends TranslatedSpecificJump {
749749 override BreakStmt stmt ;
750750
751751 override Instruction getTargetInstruction ( ) {
752- result = this . getEnclosingLoopOrSwitchNextInstr ( stmt )
752+ result = getEnclosingLoopOrSwitchNextInstr ( stmt )
753753 }
754+ }
754755
755- private Instruction getEnclosingLoopOrSwitchNextInstr ( Stmt crtStmt ) {
756- if crtStmt instanceof LoopStmt or crtStmt instanceof SwitchStmt
757- then
758- result = getTranslatedStmt ( crtStmt ) .getParent ( ) .getChildSuccessor ( getTranslatedStmt ( crtStmt ) )
759- else result = this .getEnclosingLoopOrSwitchNextInstr ( crtStmt .getParent ( ) )
760- }
756+ private Instruction getEnclosingLoopOrSwitchNextInstr ( Stmt crtStmt ) {
757+ if crtStmt instanceof LoopStmt or crtStmt instanceof SwitchStmt
758+ then
759+ result = getTranslatedStmt ( crtStmt ) .getParent ( ) .getChildSuccessor ( getTranslatedStmt ( crtStmt ) )
760+ else result = getEnclosingLoopOrSwitchNextInstr ( crtStmt .getParent ( ) )
761761}
762762
763763class TranslatedContinueStmt extends TranslatedSpecificJump {
764764 override ContinueStmt stmt ;
765765
766766 override Instruction getTargetInstruction ( ) {
767- result = this . getEnclosingLoopTargetInstruction ( stmt )
767+ result = getEnclosingLoopTargetInstruction ( stmt )
768768 }
769+ }
769770
770- private Instruction getEnclosingLoopTargetInstruction ( Stmt crtStmt ) {
771- if crtStmt instanceof ForStmt
772- then result = getNextForInstruction ( crtStmt )
773- else if crtStmt instanceof LoopStmt
774- then result = getTranslatedStmt ( crtStmt ) .getFirstInstruction ( )
775- else result = this . getEnclosingLoopTargetInstruction ( crtStmt .getParent ( ) )
776- }
771+ private Instruction getEnclosingLoopTargetInstruction ( Stmt crtStmt ) {
772+ if crtStmt instanceof ForStmt
773+ then result = getNextForInstruction ( crtStmt )
774+ else if crtStmt instanceof LoopStmt
775+ then result = getTranslatedStmt ( crtStmt ) .getFirstInstruction ( )
776+ else result = getEnclosingLoopTargetInstruction ( crtStmt .getParent ( ) )
777+ }
777778
778- private Instruction getNextForInstruction ( ForStmt for ) {
779- if exists ( for .getUpdate ( 0 ) )
780- then result = getTranslatedStmt ( for ) .( TranslatedForStmt ) .getUpdate ( 0 ) .getFirstInstruction ( )
781- else if exists ( for .getCondition ( ) )
782- then result = getTranslatedStmt ( for ) .( TranslatedForStmt ) .getCondition ( ) .getFirstInstruction ( )
783- else result = getTranslatedStmt ( for ) .( TranslatedForStmt ) .getBody ( ) .getFirstInstruction ( )
784- }
779+ private Instruction getNextForInstruction ( ForStmt for ) {
780+ if exists ( for .getUpdate ( 0 ) )
781+ then result = getTranslatedStmt ( for ) .( TranslatedForStmt ) .getUpdate ( 0 ) .getFirstInstruction ( )
782+ else if exists ( for .getCondition ( ) )
783+ then result = getTranslatedStmt ( for ) .( TranslatedForStmt ) .getCondition ( ) .getFirstInstruction ( )
784+ else result = getTranslatedStmt ( for ) .( TranslatedForStmt ) .getBody ( ) .getFirstInstruction ( )
785785}
786786
787787class TranslatedGotoLabelStmt extends TranslatedSpecificJump {
@@ -796,21 +796,21 @@ class TranslatedGotoCaseStmt extends TranslatedSpecificJump {
796796 override GotoCaseStmt stmt ;
797797
798798 override Instruction getTargetInstruction ( ) {
799- result = this . getCase ( stmt , stmt .getExpr ( ) ) .getFirstInstruction ( )
799+ result = getCase ( stmt , stmt .getExpr ( ) ) .getFirstInstruction ( )
800800 }
801+ }
801802
802- private TranslatedStmt getCase ( Stmt crtStmt , Expr expr ) {
803- if crtStmt instanceof SwitchStmt
804- then
805- exists ( CaseStmt caseStmt |
806- caseStmt = crtStmt .( SwitchStmt ) .getACase ( ) and
807- // We check for the constant value of the expression
808- // since we can't check for equality between `PatternExpr` and `Expr`
809- caseStmt .getPattern ( ) .getValue ( ) = expr .getValue ( ) and
810- result = getTranslatedStmt ( caseStmt )
811- )
812- else result = this .getCase ( crtStmt .getParent ( ) , expr )
813- }
803+ private TranslatedStmt getCase ( Stmt crtStmt , Expr expr ) {
804+ if crtStmt instanceof SwitchStmt
805+ then
806+ exists ( CaseStmt caseStmt |
807+ caseStmt = crtStmt .( SwitchStmt ) .getACase ( ) and
808+ // We check for the constant value of the expression
809+ // since we can't check for equality between `PatternExpr` and `Expr`
810+ caseStmt .getPattern ( ) .getValue ( ) = expr .getValue ( ) and
811+ result = getTranslatedStmt ( caseStmt )
812+ )
813+ else result = getCase ( crtStmt .getParent ( ) , expr )
814814}
815815
816816class TranslatedGotoDefaultStmt extends TranslatedSpecificJump {
@@ -819,16 +819,16 @@ class TranslatedGotoDefaultStmt extends TranslatedSpecificJump {
819819 override Instruction getTargetInstruction ( ) {
820820 result = getDefaultCase ( stmt ) .getFirstInstruction ( )
821821 }
822+ }
822823
823- private TranslatedStmt getDefaultCase ( Stmt crtStmt ) {
824- if crtStmt instanceof SwitchStmt
825- then
826- exists ( CaseStmt caseStmt |
827- caseStmt = crtStmt .( SwitchStmt ) .getDefaultCase ( ) and
828- result = getTranslatedStmt ( caseStmt )
829- )
830- else result = this .getDefaultCase ( crtStmt .getParent ( ) )
831- }
824+ private TranslatedStmt getDefaultCase ( Stmt crtStmt ) {
825+ if crtStmt instanceof SwitchStmt
826+ then
827+ exists ( CaseStmt caseStmt |
828+ caseStmt = crtStmt .( SwitchStmt ) .getDefaultCase ( ) and
829+ result = getTranslatedStmt ( caseStmt )
830+ )
831+ else result = getDefaultCase ( crtStmt .getParent ( ) )
832832}
833833
834834class TranslatedSwitchStmt extends TranslatedStmt {
0 commit comments