Package webit.script.core.ast.operators

Source Code of webit.script.core.ast.operators.PlusPlusBefore

// Copyright (c) 2013-2014, Webit Team. All Rights Reserved.
package webit.script.core.ast.operators;

import webit.script.Context;
import webit.script.core.ast.Expression;
import webit.script.core.ast.ResetableValueExpression;
import webit.script.util.ALU;
import webit.script.util.StatementUtil;

/**
*
* @author Zqq
*/
public final class PlusPlusBefore extends Expression {

    private final ResetableValueExpression expr;

    public PlusPlusBefore(ResetableValueExpression expr, int line, int column) {
        super(line, column);
        this.expr = expr;
    }

    public Object execute(final Context context) {
        try {
            final ResetableValueExpression resetable;
            return (resetable = this.expr).setValue(context, ALU.plusOne(
                    resetable.execute(context)));
        } catch (Exception e) {
            throw StatementUtil.castToScriptRuntimeException(e, this);
        }
    }
}
TOP

Related Classes of webit.script.core.ast.operators.PlusPlusBefore

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.