Class PatternVariableVisitor

    • Constructor Detail

      • PatternVariableVisitor

        public PatternVariableVisitor()
    • Method Detail

      • getVariablesIntroducedByAnd

        private static PatternVariableResult getVariablesIntroducedByAnd​(BinaryExpr expression)
        The following rules apply to a conditional-and expression a && b: - A pattern variable is introduced by a && b when true iff either (i) it is introduced by a when true or (ii) it is introduced by b when true. It should be noted that there is no rule for introducing a pattern variable by a && b when false. This is because it cannot be determined at compile time which operand will evaluate to false. https://docs.oracle.com/javase/specs/jls/se22/html/jls-6.html#jls-6.3.1.1
      • getVariablesIntroducedByOr

        private static PatternVariableResult getVariablesIntroducedByOr​(BinaryExpr expression)
        The following rules apply to a conditional-or expression a || b: - A pattern variable is introduced by a || b when false iff either (i) it is introduced by a when false or (ii) it is introduced by b when false. It should be noted that there is no rule for introducing a pattern variable by a || b when true. This is because it cannot be determined at compile time which operand will evaluate to true. https://docs.oracle.com/javase/specs/jls/se22/html/jls-6.html#jls-6.3.1.2
      • getVariablesIntroducedByLogicalComplement

        private static PatternVariableResult getVariablesIntroducedByLogicalComplement​(UnaryExpr unaryExpr)
        The following rules apply to a logical complement expression !a: - A pattern variable is introduced by !a when true iff it is introduced by a when false. - A pattern variable is introduced by !a when false iff it is introduced by a when true. https://docs.oracle.com/javase/specs/jls/se22/html/jls-6.html#jls-6.3.1.3