blob: a67e3a87ff245556df138dab790d87870d91f490 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
package com.modulus.qbar.lang;
import com.modulus.common.collections.Stack;
import com.modulus.qbar.core.QBObject;
import com.modulus.qbar.core.interpreter.QBInterpreter;
import com.modulus.qbar.core.parser.ByteOperation;
public class QBArrayListConstructor extends ListConstructor{
private ByteOperation[][] expressions;
public QBArrayListConstructor(ByteOperation[][] exp){
this.expressions = exp;
}
@Override
protected QBList makeList() {
QBObject[] objs = new QBObject[expressions.length];
Stack<QBObject> stack = QBInterpreter.instance().getStack();
for(int i = 0;i < expressions.length;i++){
this.exec( expressions[i], stack);
objs[i] = returnedValue;
}
QBList arr = new QBArrayList(objs);
return arr;
}
}
|