Class ComparisonChainToSwitch

  • All Implemented Interfaces:
    ASTTransform

    public class ComparisonChainToSwitch
    extends Object
    implements ASTTransform
    Folds a dispatch written as a nested chain of constant equality guards back into a switch:
    • Constructor Detail

      • ComparisonChainToSwitch

        public ComparisonChainToSwitch()
    • Method Detail

      • getName

        public String getName()
        Specified by:
        getName in interface ASTTransform
        Returns:
        the name of this transform for logging/debugging
      • transform

        public boolean transform​(BlockStmt root)
        Description copied from interface: ASTTransform
        Transforms the given block statement in place.
        Specified by:
        transform in interface ASTTransform
        Parameters:
        root - the block to transform
        Returns:
        true if any changes were made