blob: abf299aba30028f57d3c456a730f0476dd9a0aef [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2021, 2022 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
import java.util.function.Supplier;
import org.eclipse.jdt.internal.compiler.codegen.BranchLabel;
import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
public abstract class Pattern extends Expression {
/* package */ boolean isTotalTypeNode = false;
public boolean isTotalForType(TypeBinding type) {
return false;
}
public TypeBinding resolveAtType(BlockScope scope, TypeBinding type) {
return null;
}
public void setTargetSupplier(Supplier<BranchLabel> targetSupplier) {
// default implementation does nothing
}
public abstract boolean dominates(Pattern p);
public Pattern primary() {
return this;
}
@Override
public StringBuffer print(int indent, StringBuffer output) {
return this.printExpression(indent, output);
}
}