[Bprocessor-commit] bscript/src/net/sourceforge/bprocessor/model/evaluator Primitive.java, 1.5, 1.
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2006-10-10 14:41:38
|
Update of /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21574/src/net/sourceforge/bprocessor/model/evaluator Modified Files: Primitive.java Log Message: Syntax for creating strings and literal arrays Index: Primitive.java =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator/Primitive.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Primitive.java 29 Sep 2006 07:13:16 -0000 1.5 --- Primitive.java 10 Oct 2006 14:41:36 -0000 1.6 *************** *** 8,11 **** --- 8,12 ---- package net.sourceforge.bprocessor.model.evaluator; + import java.util.ArrayList; import java.util.List; import java.util.Stack; *************** *** 33,37 **** /** get */ public static final int GET = 9; ! /** opcode */ private int opcode; --- 34,39 ---- /** get */ public static final int GET = 9; ! /** list */ ! public static final int LST = 10; /** opcode */ private int opcode; *************** *** 106,109 **** --- 108,126 ---- break; } + case LST: { + int length = stack.search(Function.mark) - 1; + List arguments = new ArrayList(length); + for (int i = 0; i < length; i++) { + arguments.add(null); + } + while (length > 0) { + Object current = stack.pop(); + arguments.set(length - 1, current); + length--; + } + stack.pop(); + stack.push(arguments); + break; + } } return 1; |