Annotation of parser3/src/include/pa_operation.h, revision 1.1.2.6.2.3

1.1.2.1   paf         1: /** @file
                      2:        Parser: compiled code related decls.
                      3: 
1.1.2.4   paf         4:        Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com)
1.1.2.1   paf         5: 
                      6:        Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
                      7: */
                      8: 
1.1.2.2   paf         9: #ifndef OPERATION_H
                     10: #define OPERATION_H
1.1.2.1   paf        11: 
1.1.2.6.2.3! paf        12: static const char* IDENT_OPERATION_H="$Date: 2003/04/02 12:42:42 $";
1.1.2.1   paf        13: 
                     14: #include "pa_array.h"
1.1.2.6   paf        15: #include "pa_opcode.h"
                     16: #include "pa_value.h"
1.1.2.1   paf        17: 
                     18: // forwards
                     19: 
1.1.2.6.2.2  paf        20: union Operation;
1.1.2.6.2.1  paf        21: typedef Array<Operation> ArrayOperation;
1.1.2.1   paf        22: 
                     23: /** 
                     24:        Parser source code got compiled into intermediate form of Operation-s, 
1.1.2.3   paf        25:        which are executed afterwards.
1.1.2.1   paf        26: 
                     27:        It is compiled into Array of Operation-s.
                     28:        Each Operation can be either OPCODE or data pointer, 
                     29:        following the literal-instruction.
                     30:                - OP_VALUE followed by Value*
1.1.2.3   paf        31:                - OP_CURLY_CODE__STORE_PARAM followed by ArrayOperation*
                     32:                - OP_EXPR_CODE__STORE_PARAM followed by ArrayOperation*
                     33:                - OP_NESTED_CODE followed by ArrayOperation*
1.1.2.1   paf        34: */
1.1.2.6.2.2  paf        35: union Operation {
1.1.2.3   paf        36: public:
1.1.2.6.2.3! paf        37:        struct {
        !            38:                uint fcode:6; ///< operation code [at the moment, max=58. 2^6=64
1.1.2.6.2.2  paf        39:                //@{ origin
1.1.2.6.2.3! paf        40:                uint file_no:7; ///< file number (max: 128): index in Request::files table
        !            41:                uint line:12; ///< line number (max: 4096)
        !            42:                uint col:7; ///< column number (max: 128)
1.1.2.6.2.2  paf        43:                //@}
                     44:        };
1.1.2.6.2.3! paf        45:        OPCODE code() const { return (OPCODE)fcode; }
1.1.2.6.2.1  paf        46:        Value* value; ///< not an operation, but rather value stored after argumented op
                     47:        ArrayOperation* ops; ///< not an operation, but rather code array stored after argumented op
1.1.2.2   paf        48: 
1.1.2.3   paf        49:        /// needed to fill unused Array entries
                     50:        Operation() {}
1.1.2.6.2.3! paf        51:        Operation(OPCODE acode): fcode(acode), file_no(0), line(0), col(0) {}
1.1.2.6.2.2  paf        52:        Operation(OPCODE acode, uint afile_no, uint aline, uint acol): 
1.1.2.6.2.3! paf        53:                fcode(acode),
1.1.2.6.2.2  paf        54:                file_no(afile_no),
                     55:                line(aline), col(acol) {}
1.1.2.6.2.1  paf        56:        Operation(Value* avalue): value(avalue) {}
                     57:        Operation(ArrayOperation* aops): ops(aops) {}   
1.1.2.1   paf        58: };
                     59: 
                     60: #endif

E-mail: