forked from JavaTX/JavaCompilerCore
38 lines
922 B
Java
38 lines
922 B
Java
package de.dhbwstuttgart.syntaxtree.statement;
|
|
|
|
import de.dhbwstuttgart.syntaxtree.Pattern;
|
|
import org.antlr.v4.runtime.Token;
|
|
|
|
import de.dhbwstuttgart.syntaxtree.StatementVisitor;
|
|
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
|
|
|
public class SwitchLabel extends Expression {
|
|
|
|
private Pattern pattern;
|
|
private Boolean defaultCase = false;
|
|
|
|
public SwitchLabel(Pattern pattern, RefTypeOrTPHOrWildcardOrGeneric type, Token offset) {
|
|
super(type, offset);
|
|
this.pattern = pattern;
|
|
}
|
|
|
|
public SwitchLabel(RefTypeOrTPHOrWildcardOrGeneric type, Token offset) {
|
|
super(type, offset);
|
|
this.defaultCase = true;
|
|
}
|
|
|
|
public Pattern getPattern() {
|
|
return pattern;
|
|
}
|
|
|
|
public Boolean isDefault() {
|
|
return this.defaultCase;
|
|
}
|
|
|
|
@Override
|
|
public void accept(StatementVisitor visitor) {
|
|
visitor.visit(this);
|
|
}
|
|
|
|
}
|