source: dev/trunk/ab5.0/abdev/ab_common/include/Lexical/TypeMisc.h@ 599

Last change on this file since 599 was 599, checked in by dai_9181, 16 years ago

Subscripts型の定義位置を変更。

File size: 2.1 KB
Line 
1#pragma once
2
3#define PTR_SIZE sizeof(LONG_PTR)
4
5#define DEF_NON -1
6
7/* basic\command.sbp内の "_System_Type_***" 定数と同期が必要 */
8#define FLAG_PTR 0x80000000
9#define FLAG_CAST 0x40000000
10
11//整数型
12#define DEF_SBYTE 0x00000001
13#define DEF_BYTE 0x00000002
14#define DEF_INTEGER 0x00000003
15#define DEF_WORD 0x00000004
16#define DEF_LONG 0x00000005
17#define DEF_DWORD 0x00000006
18#define DEF_INT64 0x00000007
19#define DEF_QWORD 0x00000008
20
21//実数型
22#define DEF_SINGLE 0x00000009
23#define DEF_DOUBLE 0x0000000A
24
25//文字型
26#define DEF_CHAR 0x0000000B
27
28//bool型
29#define DEF_BOOLEAN 0x0000000C
30
31//文字列型
32#define DEF_STRING 0x0000000D
33
34//ポインタ型
35#define DEF_PTR_VOID 0x0000000E
36#define DEF_PTR_PROC 0x0000000F
37
38//特殊型
39#define DEF_ANY 0x00000015
40#define DEF_ELLIPSE 0x00000016
41#define DEF_OBJECT 0x00000017 // クラス
42#define DEF_STRUCT 0x00000018 // 構造体
43#define DEF_TYPE_PARAMETER 0x00000019 // 型パラメータ(ジェネリクスサポート)
44
45//ポインタ型
46#define MASK_PTR 0x0000ff00
47#define MASK_NATURAL 0x000000ff
48
49#define PTR_LEVEL(t) (((t)&MASK_PTR)>>8)
50#define NATURAL_TYPE(t) ((t)&MASK_NATURAL)
51#define MAKE_PTR_TYPE(t,p) ((t)|((p)<<8))
52#define PTR_LEVEL_UP(t) t = MAKE_PTR_TYPE(NATURAL_TYPE(t),PTR_LEVEL(t)+1)
53#define PTR_LEVEL_DOWN(t) t = MAKE_PTR_TYPE(NATURAL_TYPE(t),PTR_LEVEL(t)-1)
54
55#define DEF_PTR_OBJECT MAKE_PTR_TYPE(DEF_OBJECT,1)
56#define DEF_PTR_STRUCT MAKE_PTR_TYPE(DEF_STRUCT,1)
57
58
59
60//NumOpe関数の結果がリテラル値の場合、その値の補助情報がindexに格納される
61#define LITERAL_NULL -2
62#define LITERAL_M128_0 -3
63#define LITERAL_0_255 -4
64#define LITERAL_M32768_0 -5
65#define LITERAL_0_65535 -6
66#define LITERAL_OTHER_MINUS -7
67#define LITERAL_OTHER_PLUS -8
68
69#define LITERAL_STRING -9
70
71#define IS_LITERAL(x) (x<=LITERAL_NULL&&x!=LITERAL_STRING)
72#define IS_MINUS_LITERAL(x) (x==LITERAL_M128_0||x==LITERAL_M32768_0||x==LITERAL_OTHER_MINUS)
73#define IS_POSITIVE_LITERAL(x) (x==LITERAL_NULL||x==LITERAL_0_255||x==LITERAL_0_65535||x==LITERAL_OTHER_PLUS)
74
75
76typedef std::vector<int> Subscripts;
Note: See TracBrowser for help on using the repository browser.