Add |from x import names| support.
1 /* vim: set ts=4 sw=4 tw=99 et:
3 * Copyright (C) 2012 David Anderson
5 * This file is part of SourcePawn.
7 * SourcePawn is free software: you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License as published by the Free
9 * Software Foundation, either version 3 of the License, or (at your option)
12 * SourcePawn is distributed in the hope that it will be useful, but WITHOUT ANY
13 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with
17 * SourcePawn. If not, see http://www.gnu.org/licenses/.
19 #ifndef _include_opcodes_h_
20 #define _include_opcodes_h_
38 SourcePosition(unsigned line, unsigned col)
47 #define OPDEF(name, text, length, uses, defs) \
49 #include "Opcodes.tbl"
54 #define OPDEF(name, text, length, uses, defs) \
55 static const unsigned name##_LENGTH = length;
56 #include "Opcodes.tbl"
67 typedef unsigned char bytecode;
69 extern OpInfo OpcodeInfo[];
71 static const unsigned MAX_TABLESWITCH_ENTRIES = 256;
73 static inline unsigned
74 TableSwitchEntries(int low, int high)
76 return unsigned(high - low) + 1;
80 READ_INT32(bytecode *pc)
82 return *reinterpret_cast<int *>(pc + 1);
84 static inline unsigned
85 READ_UINT32(bytecode *pc)
87 return *reinterpret_cast<unsigned *>(pc + 1);
90 READ_FLOAT(bytecode *pc)
92 return *reinterpret_cast<float *>(pc + 1);
96 READ_TABLESWITCH_LOW(bytecode *pc)
98 return READ_INT32(pc);
102 READ_TABLESWITCH_HIGH(bytecode *pc)
104 return READ_INT32(pc + sizeof(int));
109 void Disassemble(Code *code, FILE *fp);
113 #endif // _include_opcodes_h_