Annotation of parser3/src/include/pa_opcode.h, revision 1.22

1.1       paf         1: /** @file
                      2:        Parser: compiled code related decls.
                      3: 
1.13      paf         4:        Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com)
1.1       paf         5: 
1.14      paf         6:        Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.1       paf         7: */
                      8: 
                      9: #ifndef CODE_H
                     10: #define CODE_H
1.19      paf        11: 
1.22    ! paf        12: static const char* IDENT_OPCODE_H="$Date: 2002/09/18 13:15:43 $";
1.1       paf        13: 
                     14: #include "pa_string.h"
                     15: #include "pa_array.h"
                     16: 
                     17: class Value;
                     18: class Array;
                     19: 
                     20: ///    Compiled operation code
                     21: enum OPCODE {
                     22:        //@{ 
                     23:        /// @name literals
                     24:        OP_VALUE,  OP_CURLY_CODE__STORE_PARAM,  OP_EXPR_CODE__STORE_PARAM,
1.10      paf        25:        OP_NESTED_CODE,
1.1       paf        26:        //@}
                     27: 
                     28:        //@{
                     29:        /// @name actions
1.6       parser     30:        OP_WITH_ROOT,   OP_WITH_SELF,   OP_WITH_READ,   OP_WITH_WRITE,
1.1       paf        31:        OP_GET_CLASS,
1.3       parser     32:        OP_CONSTRUCT_VALUE, OP_CONSTRUCT_EXPR, OP_CURLY_CODE__CONSTRUCT,
1.1       paf        33:        OP_WRITE_VALUE,  OP_WRITE_EXPR_RESULT, OP_STRING__WRITE,
1.22    ! paf        34:        OP_GET_ELEMENT_OR_OPERATOR, OP_GET_ELEMENT_OR_JUNCTION_EXPAND, 
        !            35:        OP_GET_ELEMENT, OP_GET_ELEMENT__WRITE,
1.17      paf        36:        OP_OBJECT_POOL, OP_STRING_POOL,
1.1       paf        37:        OP_STORE_PARAM,
1.17      paf        38:        OP_PREPARE_TO_CONSTRUCT_OBJECT, OP_PREPARE_TO_EXPRESSION, 
                     39:        OP_CALL, OP_CALL__WRITE,
1.1       paf        40:        //@}
                     41: 
                     42:        //@{
                     43:        /// @name expression ops: unary
                     44:        OP_NEG, OP_INV, OP_NOT, OP_DEF, OP_IN, OP_FEXISTS, OP_DEXISTS,
                     45:        //@}
                     46: 
                     47:        //@{
                     48:        /// @name expression ops: binary
1.7       paf        49:        OP_SUB, OP_ADD, OP_MUL, OP_DIV, OP_MOD, OP_INTDIV,
1.21      paf        50:        OP_BIN_SL, OP_BIN_SR,
1.1       paf        51:        OP_BIN_AND, OP_BIN_OR, OP_BIN_XOR,
                     52:        OP_LOG_AND, OP_LOG_OR, OP_LOG_XOR,
                     53:        OP_NUM_LT, OP_NUM_GT, OP_NUM_LE, OP_NUM_GE, OP_NUM_EQ, OP_NUM_NE,
                     54:        OP_STR_LT, OP_STR_GT, OP_STR_LE, OP_STR_GE, OP_STR_EQ, OP_STR_NE,
                     55:        OP_IS
                     56:        //@}
                     57: };
                     58: 
                     59: /** 
                     60:        Parser source code got compiled into intermediate form of Operation-s, 
                     61:        which is executed afterwards.
                     62: 
                     63:        It is compiled into Array of Operation-s.
                     64:        Each Operation can be either OPCODE or data pointer, 
                     65:        following the literal-instruction.
                     66:                - OP_VALUE followed by Value*
                     67:                - OP_CURLY_CODE__STORE_PARAM followed by Array*
                     68:                - OP_EXPR_CODE__STORE_PARAM followed by Array*
1.10      paf        69:                - OP_NESTED_CODE followed by Array*
1.1       paf        70: */
                     71: union Operation {
                     72:        void *cast; ///< casting helper 
                     73: 
                     74:        OPCODE code; ///< operation code
                     75:        Value *value; ///< not an operation, but rather value stored after argumented op
                     76:        Array *array; ///< not an operation, but rather code array stored after argumented op
                     77: };
                     78: 
                     79: #endif

E-mail: