*** empty log message ***

This commit is contained in:
hyung-hwan 2005-07-07 16:52:48 +00:00
parent 839ca4a16c
commit 32285ddc5b
4 changed files with 26 additions and 13 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: bytecode.c,v 1.2 2005-07-07 16:32:37 bacon Exp $
* $Id: bytecode.c,v 1.3 2005-07-07 16:52:48 bacon Exp $
*/
#include <xp/stx/bytecode.h>
#include <xp/stx/class.h>
@ -37,17 +37,17 @@ static const xp_char_t* opcode_names[] =
{
XP_TEXT("PUSH_VARIABLE"),
XP_TEXT("PUSH_TEMPORARY"),
XP_TEXT("PUSH_LITERAL"),
XP_TEXT("PUSH_LITERAL_CONSTANT"),
XP_TEXT("PUSH_LITERAL_VARIABLE"),
XP_TEXT("STORE_VARIABLE"),
XP_TEXT("STORE_TEMPORARY"),
XP_TEXT("DO_SPECIAL"),
XP_TEXT("DO_PRIMITIVE"),
XP_TEXT("UNKNOWN"),
XP_TEXT("UNKNOWN"),
XP_TEXT("UNKNOWN"),
XP_TEXT("UNKNOWN"),
XP_TEXT("UNKNOWN"),
XP_TEXT("PUSH_VARIABLE_EXTENDED"),
XP_TEXT("PUSH_TEMPORARY_EXTENDED"),
XP_TEXT("UNKNOWN"),
XP_TEXT("STORE_TEMPORARY_EXTENDED"),
XP_TEXT("UNKNOWN"),
XP_TEXT("UNKNOWN"),
XP_TEXT("DO_PRIMITIVE_EXTENDED")

View File

@ -1,5 +1,5 @@
/*
* $Id: bytecode.h,v 1.3 2005-07-07 16:32:37 bacon Exp $
* $Id: bytecode.h,v 1.4 2005-07-07 16:52:48 bacon Exp $
*/
#ifndef _XP_STX_BYTECODE_H_
@ -9,11 +9,15 @@
#define PUSH_VARIABLE 0x0
#define PUSH_TEMPORARY 0x1
#define PUSH_LITERAL 0x2
#define DO_SPECIAL 0x3
#define DO_PRIMITIVE 0x4
#define PUSH_LITERAL_CONSTANT 0x2
#define PUSH_LITERAL_VARIABLE 0x3
#define STORE_VARIABLE 0x4
#define STORE_TEMPORARY 0x5
#define DO_SPECIAL 0x6
#define DO_PRIMITIVE 0x7
#define PUSH_VARIABLE_EXTENDED 0xA
#define PUSH_TEMPORARY_EXTENDED 0xB
#define STORE_TEMPORARY_EXTENDED 0xC
#define DO_PRIMITIVE_EXTENDED 0xF
#ifdef __cplusplus

View File

@ -1,5 +1,5 @@
/*
* $Id: parser.c,v 1.57 2005-07-07 16:32:37 bacon Exp $
* $Id: parser.c,v 1.58 2005-07-07 16:52:48 bacon Exp $
*/
#include <xp/stx/parser.h>
@ -703,7 +703,16 @@ static int __parse_assignment (
xp_char_t buf[100];
if (__parse_expression(parser) == -1) return -1;
xp_sprintf (buf, xp_countof(buf), XP_TEXT("%d"), i);
EMIT_CODE_TEST (parser, XP_TEXT("ASSIGN_TEMPORARY"), buf);
if (i <= 0x0F) {
EMIT_CODE_TEST (parser, XP_TEXT("STORE_TEMPORARY"), buf);
EMIT_CODE (parser, (STORE_TEMPORARY << 4) | i);
}
else {
EMIT_CODE_TEST (parser, XP_TEXT("STORE_TEMPORARY_EXTENDED"), buf);
EMIT_CODE (parser, (STORE_TEMPORARY_EXTENDED << 4) | (i & 0x0F));
EMIT_CODE (parser, i >> 4);
}
return 0;
}
}

View File

@ -1,5 +1,5 @@
"isNil" "test if self is nil"
perform: method with: x with: y with: z with: a with: b with: c
perform: method with: x with: y with: z with: a1 with: b2 with: c2
| a b c d e f g |