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

webit.script.core.ast.expressions.ArrayValue Maven / Gradle / Ivy

The newest version!
// Copyright (c) 2013-2014, Webit Team. All Rights Reserved.
package webit.script.core.ast.expressions;

import webit.script.Context;
import webit.script.core.ast.Expression;

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

    private final Expression[] valueExprs;

    public ArrayValue(Expression[] valueExprs, int line, int column) {
        super(line, column);
        this.valueExprs = valueExprs;
    }

    public Object execute(final Context context) {
        final Expression[] exprs;
        final int len;
        final Object[] value = new Object[len = (exprs = this.valueExprs).length];
        for (int i = 0;i < len; i++) {
            value[i] = exprs[i].execute(context);
        }
        return value;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy