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

prompto.csharp.CSharpStatement Maven / Gradle / Ivy

The newest version!
package prompto.csharp;

import prompto.utils.CodeWriter;


public class CSharpStatement {

	CSharpExpression expression;
	boolean isReturn;
	
	public CSharpStatement(CSharpExpression expression,boolean isReturn) {
		this.expression = expression;
		this.isReturn = isReturn;
	}

	@Override
	public String toString() {
		return "" + (isReturn ? "return " : "") + expression.toString() + ";";
	}

	public void toDialect(CodeWriter writer) {
		if(isReturn)
			writer.append("return ");
		expression.toDialect(writer);
		writer.append(';');
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy