--- parser3/src/include/pa_opcode.h 2002/04/16 08:41:04 1.17 +++ parser3/src/include/pa_opcode.h 2005/08/09 08:14:49 1.28 @@ -1,21 +1,15 @@ /** @file Parser: compiled code related decls. - Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) - - $Id: pa_opcode.h,v 1.17 2002/04/16 08:41:04 paf Exp $ */ -#ifndef CODE_H -#define CODE_H - -#include "pa_string.h" -#include "pa_array.h" +#ifndef OPCODE_H +#define OPCODE_H -class Value; -class Array; +static const char * const IDENT_OPCODE_H="$Date: 2005/08/09 08:14:49 $"; /// Compiled operation code enum OPCODE { @@ -33,7 +27,6 @@ enum OPCODE { OP_WRITE_VALUE, OP_WRITE_EXPR_RESULT, OP_STRING__WRITE, OP_GET_ELEMENT_OR_OPERATOR, OP_GET_ELEMENT, OP_GET_ELEMENT__WRITE, OP_OBJECT_POOL, OP_STRING_POOL, - OP_GET_METHOD_FRAME, OP_STORE_PARAM, OP_PREPARE_TO_CONSTRUCT_OBJECT, OP_PREPARE_TO_EXPRESSION, OP_CALL, OP_CALL__WRITE, @@ -47,6 +40,7 @@ enum OPCODE { //@{ /// @name expression ops: binary OP_SUB, OP_ADD, OP_MUL, OP_DIV, OP_MOD, OP_INTDIV, + OP_BIN_SL, OP_BIN_SR, OP_BIN_AND, OP_BIN_OR, OP_BIN_XOR, OP_LOG_AND, OP_LOG_OR, OP_LOG_XOR, OP_NUM_LT, OP_NUM_GT, OP_NUM_LE, OP_NUM_GE, OP_NUM_EQ, OP_NUM_NE, @@ -55,24 +49,4 @@ enum OPCODE { //@} }; -/** - Parser source code got compiled into intermediate form of Operation-s, - which is executed afterwards. - - It is compiled into Array of Operation-s. - Each Operation can be either OPCODE or data pointer, - following the literal-instruction. - - OP_VALUE followed by Value* - - OP_CURLY_CODE__STORE_PARAM followed by Array* - - OP_EXPR_CODE__STORE_PARAM followed by Array* - - OP_NESTED_CODE followed by Array* -*/ -union Operation { - void *cast; ///< casting helper - - OPCODE code; ///< operation code - Value *value; ///< not an operation, but rather value stored after argumented op - Array *array; ///< not an operation, but rather code array stored after argumented op -}; - #endif