Annotation of parser3/src/include/pa_operation.h, revision 1.1.2.2
1.1.2.1 paf 1: /** @file
2: Parser: compiled code related decls.
3:
4: Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com)
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.2 ! paf 12: static const char* IDENT_OPERATION_H="$Date: 2003/01/30 09:14:57 $";
1.1.2.1 paf 13:
14: #include "pa_array.h"
15:
16: // forwards
17:
18: enum OPCODE;
19: class Value;
20: class ArrayOperation;
21:
22: /**
23: Parser source code got compiled into intermediate form of Operation-s,
24: which is executed afterwards.
25:
26: It is compiled into Array of Operation-s.
27: Each Operation can be either OPCODE or data pointer,
28: following the literal-instruction.
29: - OP_VALUE followed by Value*
30: - OP_CURLY_CODE__STORE_PARAM followed by Array*
31: - OP_EXPR_CODE__STORE_PARAM followed by Array*
32: - OP_NESTED_CODE followed by Array*
33: */
34: union Operation {
1.1.2.2 ! paf 35: //void *cast; ///< casting helper
1.1.2.1 paf 36:
37: OPCODE code; ///< operation code
38: Value* value; ///< not an operation, but rather value stored after argumented op
39: ArrayOperation* array; ///< not an operation, but rather code array stored after argumented op
1.1.2.2 ! paf 40:
! 41: Operation(OPCODE acode): code(acode) {}
! 42: Operation(Value *avalue): value(avalue) {}
! 43: Operation(ArrayOperation* aarray): array(aarray) {}
1.1.2.1 paf 44: };
45:
46:
47: class ArrayOperation: public Array<Operation> {
48: public:
49: /// goes through byte-code and deletes value/array, see execute.C
50: override ~ArrayOperation();
51: };
52: DECLARE_OBJECT_PTR(ArrayOperation);
53:
54:
55: #endif
E-mail: