3 * Copyright (C) 2001-2008, Parrot Foundation.
5 * enums shared by much of the stack-handling code
6 * Data Structure and Algorithms:
12 #ifndef PARROT_ENUMS_H_GUARD
13 #define PARROT_ENUMS_H_GUARD
16 NO_STACK_ENTRY_TYPE
= 0,
18 STACK_ENTRY_DESTINATION
= 2,
19 STACK_ENTRY_ACTION
= 3,
24 NO_STACK_ENTRY_FLAGS
= 0,
25 STACK_ENTRY_CLEANUP_FLAG
= 1 << 0
29 NO_STACK_CHUNK_FLAGS
= 0,
30 STACK_CHUNK_COW_FLAG
= 1 << 0
34 /* &gen_from_enum(iterator.pasm) */
37 ITERATE_FROM_START_KEYS
,
45 /* &gen_from_enum(call_bits.pasm lib/Parrot/Pmc2c/PCCMETHOD_BITS.pm) */
47 /* 4 low bits are argument types */
48 PARROT_ARG_INTVAL
= 0x000, /* 0 */
49 PARROT_ARG_STRING
= 0x001, /* 1 */
50 PARROT_ARG_PMC
= 0x002, /* 2 */
51 PARROT_ARG_FLOATVAL
= 0x003, /* 3 */
52 PARROT_ARG_TYPE_MASK
= 0x00f,
53 /* argument meaning and conversion bits */
54 PARROT_ARG_CONSTANT
= 0x010, /* 16 */
55 /* bits a user has to define */
56 PARROT_ARG_FLATTEN
= 0x020, /* .flatten_arg */
57 PARROT_ARG_SLURPY_ARRAY
= PARROT_ARG_FLATTEN
, /* i.e. foldup */
59 PARROT_ARG_OPTIONAL
= 0x080, /* 128 */
60 PARROT_ARG_OPT_FLAG
= 0x100, /* 256 prev optional was set */
61 PARROT_ARG_NAME
= 0x200, /* 512 this String is an arg name */
62 PARROT_ARG_LOOKAHEAD
= 0x400, /* 1024 this is a lookahead argument */
63 PARROT_ARG_INVOCANT
= 0x800 /* 2048 this PMC is an invocant */
64 /* more to come soon */
70 #define PARROT_ARG_INTVAL_ISSET(o) ((o) & PARROT_ARG_INTVAL)
71 #define PARROT_ARG_STRING_ISSET(o) ((o) & PARROT_ARG_STRING)
72 #define PARROT_ARG_PMC_ISSET(o) ((o) & PARROT_ARG_PMC)
73 #define PARROT_ARG_FLOATVAL_ISSET(o) ((o) & PARROT_ARG_FLOATVAL)
74 #define PARROT_ARG_TYPE_MASK_MASK(o) ((o) & PARROT_ARG_TYPE_MASK)
75 #define PARROT_ARG_TYPE(o) PARROT_ARG_TYPE_MASK_MASK(o)
76 #define PARROT_ARG_CONSTANT_ISSET(o) ((o) & PARROT_ARG_CONSTANT)
77 #define PARROT_ARG_FLATTEN_ISSET(o) ((o) & PARROT_ARG_FLATTEN)
78 #define PARROT_ARG_SLURPY_ARRAY_ISSET(o) ((o) & PARROT_ARG_SLURPY_ARRAY)
79 #define PARROT_ARG_OPTIONAL_ISSET(o) ((o) & PARROT_ARG_OPTIONAL)
80 #define PARROT_ARG_OPT_FLAG_ISSET(o) ((o) & PARROT_ARG_OPT_FLAG)
81 #define PARROT_ARG_NAME_ISSET(o) ((o) & PARROT_ARG_NAME)
82 #define PARROT_ARG_INVOCANT_ISSET(o) ((o) & PARROT_ARG_INVOCANT)
85 #endif /* PARROT_ENUMS_H_GUARD */
89 * c-file-style: "parrot"
91 * vim: expandtab shiftwidth=4: