You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
734 B
38 lines
734 B
package parser.ast;
|
|
|
|
public enum AccumulationSymbol {
|
|
ACCDIAPLUS, ACCDIAMINUS, ACCBOXPLUS, ACCBOXMINUS;
|
|
|
|
public String toString()
|
|
{
|
|
switch(this) {
|
|
case ACCBOXMINUS:
|
|
return "[-]";
|
|
case ACCBOXPLUS:
|
|
return "[+]";
|
|
case ACCDIAMINUS:
|
|
return "<->";
|
|
case ACCDIAPLUS:
|
|
return "<+>";
|
|
default:
|
|
throw new RuntimeException("Unknown accumulation symbol");
|
|
}
|
|
}
|
|
|
|
public boolean isDia() {
|
|
return (this == ACCDIAPLUS) || (this == ACCDIAMINUS);
|
|
}
|
|
|
|
public boolean isBox() {
|
|
return (this == ACCBOXPLUS) || (this == ACCBOXMINUS);
|
|
}
|
|
|
|
public boolean isMinus() {
|
|
return (this == ACCDIAMINUS) || (this == ACCBOXMINUS);
|
|
}
|
|
|
|
public boolean isPlus() {
|
|
return (this == ACCDIAPLUS) || (this == ACCBOXPLUS);
|
|
}
|
|
|
|
}
|