final public OpCode.PushConstant parseOpCodePushCharConstant() throws ParseException {char c; jj_consume_token(OP_CODE_PUSH_CHAR_CONSTANT); c = parseCharLiteral(); jj_consume_token(STRING_QUOTE); {if ("" != null) return new OpCode.PushConstant(c, false);} throw new Error("Missing return statement in function"); }
@Test public void testOpIntegerConstant() { assertParseInstr("%{0}", new OpCode.PushConstant(0, true)); assertParseInstr("%{1}", new OpCode.PushConstant(1, true)); assertParseInstr("%{01}", new OpCode.PushConstant(1, true)); assertParseInstr("%{2}", new OpCode.PushConstant(2, true)); assertParseInstr("%{10}", new OpCode.PushConstant(10, true)); assertParseInstr("%{11}", new OpCode.PushConstant(11, true)); }
final public OpCode.PushConstant parseOpCodePushIntegerConstant() throws ParseException {Token t; t = jj_consume_token(OP_CODE_PUSH_INTEGER_CONSTANT); {if ("" != null) return new OpCode.PushConstant(Integer.parseInt(t.image.substring(2, t.image.length() - 1)), true);} throw new Error("Missing return statement in function"); }
@Test public void testOpPushConstant() { assertParseInstr("%'a'", new OpCode.PushConstant('a', false)); assertParseInstr("%'\''", new OpCode.PushConstant('\'', false)); assertParseInstr("%'\\123'", new OpCode.PushConstant((char) 83, false)); assertParseInstr("%'\\0'", new OpCode.PushConstant(0, false)); }
@Test public void testEvalPushConstant() throws Exception { OpCode.PushConstant opcode = new OpCode.PushConstant(65, false); StringBuilder result = new StringBuilder(); EvalContext context = new EvalContext(new String[0], result); opcode.eval(context); assertEquals(Arrays.asList("A"), context.stack); assertEquals("", result.toString()); }
@Test public void testOpPushConstant() { assertParseInstr("%'a'", new OpCode.PushConstant('a', false)); assertParseInstr("%'\''", new OpCode.PushConstant('\'', false)); assertParseInstr("%'\\123'", new OpCode.PushConstant((char) 83, false)); assertParseInstr("%'\\0'", new OpCode.PushConstant(0, false)); }
final public OpCode.PushConstant parseOpCodePushCharConstant() throws ParseException {char c; jj_consume_token(OP_CODE_PUSH_CHAR_CONSTANT); c = parseCharLiteral(); jj_consume_token(STRING_QUOTE); {if ("" != null) return new OpCode.PushConstant(c, false);} throw new Error("Missing return statement in function"); }
@Test public void testOpPushConstant() { assertParseInstr("%'a'", new OpCode.PushConstant('a', false)); assertParseInstr("%'\''", new OpCode.PushConstant('\'', false)); assertParseInstr("%'\\123'", new OpCode.PushConstant((char) 83, false)); assertParseInstr("%'\\0'", new OpCode.PushConstant(0, false)); }
@Test public void testEvalPushConstant() throws Exception { OpCode.PushConstant opcode = new OpCode.PushConstant(65, false); StringBuilder result = new StringBuilder(); EvalContext context = new EvalContext(new String[0], result); opcode.eval(context); assertEquals(Arrays.asList("A"), context.stack); assertEquals("", result.toString()); }
@Test public void testOpIntegerConstant() { assertParseInstr("%{0}", new OpCode.PushConstant(0, true)); assertParseInstr("%{1}", new OpCode.PushConstant(1, true)); assertParseInstr("%{01}", new OpCode.PushConstant(1, true)); assertParseInstr("%{2}", new OpCode.PushConstant(2, true)); assertParseInstr("%{10}", new OpCode.PushConstant(10, true)); assertParseInstr("%{11}", new OpCode.PushConstant(11, true)); }
@Test public void testEvalPushConstant() throws Exception { OpCode.PushConstant opcode = new OpCode.PushConstant(65, false); StringBuilder result = new StringBuilder(); EvalContext context = new EvalContext(new String[0], result); opcode.eval(context); assertEquals(Arrays.asList("A"), context.stack); assertEquals("", result.toString()); }
final public OpCode.PushConstant parseOpCodePushIntegerConstant() throws ParseException {Token t; t = jj_consume_token(OP_CODE_PUSH_INTEGER_CONSTANT); {if ("" != null) return new OpCode.PushConstant(Integer.parseInt(t.image.substring(2, t.image.length() - 1)), true);} throw new Error("Missing return statement in function"); }
@Test public void testOpIntegerConstant() { assertParseInstr("%{0}", new OpCode.PushConstant(0, true)); assertParseInstr("%{1}", new OpCode.PushConstant(1, true)); assertParseInstr("%{01}", new OpCode.PushConstant(1, true)); assertParseInstr("%{2}", new OpCode.PushConstant(2, true)); assertParseInstr("%{10}", new OpCode.PushConstant(10, true)); assertParseInstr("%{11}", new OpCode.PushConstant(11, true)); }