+
+ /**
+ * Assuming that a complete assignable (lvalue) has just been
+ * parsed and the object and key are on the stack,
+ * <tt>continueExprAfterAssignable</tt> will attempt to parse an
+ * expression that modifies the assignable. This method always
+ * decreases the stack depth by exactly one element.
+ */
+ private void continueExprAfterAssignable(CompiledFunction b) throws IOException {
+ int saveParserLine = parserLine;
+ _continueExprAfterAssignable(b);
+ parserLine = saveParserLine;
+ }
+ private void _continueExprAfterAssignable(CompiledFunction b) throws IOException {
+ if (b == null) throw new Error("got null b; this should never happen");
+ int tok = getToken();
+ switch(tok) {
+ case ASSIGN_BITOR: case ASSIGN_BITXOR: case ASSIGN_BITAND: case ASSIGN_LSH: case ASSIGN_RSH: case ASSIGN_URSH:
+ case ASSIGN_ADD: case ASSIGN_SUB: case ASSIGN_MUL: case ASSIGN_DIV: case ASSIGN_MOD: {
+ b.add(parserLine, GET_PRESERVE);
+ startExpr(b, -1);
+ b.add(parserLine, tok - 1);
+ b.add(parserLine, PUT);
+ b.add(parserLine, SWAP);
+ b.add(parserLine, POP);
+ break;
+ }
+ case INC: case DEC: { // postfix
+ b.add(parserLine, GET_PRESERVE);
+ b.add(parserLine, LITERAL, new Integer(1));
+ b.add(parserLine, tok == INC ? ADD : SUB);
+ b.add(parserLine, PUT);
+ b.add(parserLine, SWAP);
+ b.add(parserLine, POP);
+ b.add(parserLine, LITERAL, new Integer(1));
+ b.add(parserLine, tok == INC ? SUB : ADD);
+ break;
+ }
+ case ASSIGN: {
+ startExpr(b, -1);
+ b.add(parserLine, PUT);
+ b.add(parserLine, SWAP);
+ b.add(parserLine, POP);
+ break;
+ }
+ default: {
+ pushBackToken();
+ b.add(parserLine, GET);
+ return;
+ }
+ }
+ }
+
+