cminus/submit/ast/ParenExpression.java

27 lines
474 B
Java

/*
* Code formatter project
* CS 4481
*/
package submit.ast;
/**
*
* @author edwajohn
*/
public class ParenExpression extends AbstractNode implements Expression {
private final Expression expression;
public ParenExpression(Expression expression) {
this.expression = expression;
}
@Override
public void toCminus(StringBuilder builder, String prefix) {
builder.append("(");
expression.toCminus(builder, prefix);
builder.append(")");
}
}