All Downloads are FREE. Search and download functionalities are using the official Maven repository.

prompto.java.JavaParenthesisExpression Maven / Gradle / Ivy

The newest version!
package prompto.java;

import prompto.error.PromptoError;
import prompto.parser.CodeSection;
import prompto.runtime.Context;
import prompto.type.IType;
import prompto.utils.CodeWriter;

public class JavaParenthesisExpression extends CodeSection implements JavaExpression {

	JavaExpression expression;
	
	public JavaParenthesisExpression(JavaExpression expression) {
		this.expression = expression;
	}
	
	@Override
	public void toDialect(CodeWriter writer) {
		writer.append('(');
		expression.toDialect(writer);
		writer.append(')');
	}
	
	@Override
	public IType check(Context context) {
		return expression.check(context);
	}
	
	@Override
	public Object interpret(Context context) throws PromptoError {
		return expression.interpret(context);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy