package com.sap.finex.interpreter.expressions;
import structure.Association;
import structure.Field;
import structure.FinexClass;
import structure.Type;
import behavior.actions.Statement;
import behavior.expressions.Expression;
import behavior.expressions.literals.BooleanLiteral;
import behavior.functions.NativeImpl;
import behavior.functions.SignatureImplementation;
import com.sap.finex.interpreter.FinexInterpreter;
import com.sap.finex.interpreter.FinexStackFrame;
import com.sap.finex.interpreter.objects.FinexNativeObject;
import com.sap.runlet.abstractinterpreter.Interpreter;
public class BooleanLiteralInterpreter
implements Interpreter<BooleanLiteral, FinexClass, Type, FinexClass, Association, Field, Statement, Expression,
SignatureImplementation, FinexStackFrame, NativeImpl, FinexInterpreter> {
private BooleanLiteral literal;
public BooleanLiteralInterpreter(BooleanLiteral literal) {
this.literal = literal;
}
@Override
public FinexNativeObject evaluate(FinexInterpreter interpreter) {
// a native object is used to encode the number value
return new FinexNativeObject((FinexClass) literal.getType(),
new Boolean(literal.getLiteral()), interpreter.getDefaultSnapshot(), interpreter);
}
}