source: git/Singular/tok.h @ 7d51c4

fieker-DuValspielwiese
Last change on this file since 7d51c4 was ec335c, checked in by Hans Schönemann <hannes@…>, 21 years ago
*hannes: force USE_IILOCALRING git-svn-id: file:///usr/local/Singular/svn/trunk@6375 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 5.4 KB
Line 
1#ifndef TOK_H
2#define TOK_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/*
7* ABSTRACT: tokens, types for interpreter; general macros
8*/
9/* $Id: tok.h,v 1.54 2002-12-13 16:19:15 Singular Exp $ */
10
11#ifndef MYYSTYPE
12#include "structs.h"
13#endif
14#ifndef UMINUS
15#include "grammar.h"
16#endif
17
18extern int      yylineno;
19extern char     my_yylinebuf[80];
20
21#if defined(__cplusplus)
22extern int  yyparse(void);
23#endif
24
25#define loop for(;;)
26
27#ifndef ABS
28#define ABS(x) ((x)<0?(-(x)):(x))
29#endif
30
31#if defined(__cplusplus)
32inline int max(const int a, const int b)  { return (a>b) ? a : b; }
33inline int min(const int a, const int b)  { return (a<b) ? a : b; }
34#else
35#define max(A,B) ((A) > (B) ? (A) : (B))
36#define min(A,B) ((A) < (B) ? (A) : (B))
37#endif
38
39/* Define to use old mechanismen for saving currRing with procedures
40 * Does work with HAVE_NAMESPACES enabled
41 */
42#define USE_IILOCALRING 1
43
44
45/* the follwing defines for infix operators should not be changed: *
46*  grammar.y does not use the symbolic names                       *
47*  scanner.l uses the identies for some optimzations              */
48#define LOGIC_OP         '&'
49#define MULDIV_OP        '/'
50#define COMP_OP          '<'
51
52#define COMMAND           UMINUS+2 /* in tok.h */
53#define ANY_TYPE          UMINUS+3
54#define IDHDL             UMINUS+4
55#define NSHDL             UMINUS+5
56
57enum {
58  ALIAS_CMD     = UMINUS + 15,
59  ATTRIB_CMD,
60  BAREISS_CMD,
61  BREAKPOINT_CMD,
62  CHARACTERISTIC_CMD,
63  CHARSTR_CMD,
64  CHAR_SERIES_CMD,
65  CLOSE_CMD,
66  COLS_CMD,
67  CONTENT_CMD,
68  COUNT_CMD,
69  DBPRINT_CMD,
70  DEF_CMD,
71  DEFINED_CMD,
72  DELETE_CMD,
73  DET_CMD,
74  DUMP_CMD,
75  END_GRAMMAR,
76  ERROR_CMD,
77  EXECUTE_CMD,
78  EXTGCD_CMD,
79  FAC_CMD,
80  FIND_CMD,
81  FACSTD_CMD,
82  FGLM_CMD,
83  FGLMQUOT_CMD,
84  FINDUNI_CMD,
85  GCD_CMD,
86  GETDUMP_CMD,
87  HIGHCORNER_CMD,
88  HRES_CMD,
89  IMPART_CMD,
90  INSERT_CMD,
91  INT_CMD,
92  INTDIV_CMD,
93  INTMOD_CMD,
94  INTVEC_CMD,
95  IS_RINGVAR,
96  KILLATTR_CMD,
97  KRES_CMD,
98  LAGSOLVE_CMD,
99  LINK_CMD,
100  LIST_CMD,
101  LOAD_CMD,
102  LRES_CMD,
103  MEMORY_CMD,
104  MONITOR_CMD,
105  MPRES_CMD,
106  MSTD_CMD,
107  NAMEOF_CMD,
108  NAMES_CMD,
109  NEWTONPOLY_CMD,
110  NPARS_CMD,
111  NVARS_CMD,
112  OPEN_CMD,
113  OPTION_CMD,
114  ORDSTR_CMD,
115  PACKAGE_CMD,
116  PARSTR_CMD,
117  POINTER_CMD,
118  PRIME_CMD,
119  PRINT_CMD,
120  PRUNE_CMD,
121  QRING_CMD,
122  RANDOM_CMD,
123  READ_CMD,
124  REPART_CMD,
125  RESERVEDNAME_CMD,
126  RESULTANT_CMD,
127  RINGLIST_CMD,
128  ROWS_CMD,
129  SIMPLEX_CMD,
130  SQR_FREE_DEC_CMD,
131  STATUS_CMD,
132  STRING_CMD,
133  SYSTEM_CMD,
134  TEST_CMD,
135  TRANSPOSE_CMD,
136  TRACE_CMD,
137  TYPEOF_CMD,
138  UNLOAD_CMD,
139  URSOLVE_CMD,
140  VANDER_CMD,
141  VARSTR_CMD,
142  WRITE_CMD,
143  /* start system var section: VECHO */
144  VECHO,
145  VPAGELENGTH,
146  VCOLMAX,
147  VTIMER,
148  VRTIMER,
149  TRACE,
150  VOICE,
151  VSHORTOUT,
152  VPRINTLEVEL,
153  /* end system var section: VPRINTLEVEL */
154
155  MAX_TOK /* must be the last, biggest token number */
156};
157
158#define NONE END_RING
159#define UNKNOWN 0
160
161/*
162**  Set operations (small sets only)
163*/
164
165#define Sy_bit(x)     ((unsigned)1<<(x))
166#define Sy_inset(x,s) ((Sy_bit(x)&(s))?TRUE:FALSE)
167#define BTEST1(a)     Sy_inset((a), test)
168#define BVERBOSE(a)   Sy_inset((a), verbose)
169
170/*
171** defines for BITSETs
172*/
173
174#define V_SHOW_MEM  2
175#define V_YACC      3
176#define V_REDEFINE  4
177#define V_READING   5
178#define V_LOAD_LIB  6
179#define V_DEBUG_LIB 7
180#define V_LOAD_PROC 8
181#define V_DEF_RES   9
182#define V_DEBUG_MEM 10
183#define V_SHOW_USE  11
184#define V_IMAP      12
185#define V_PROMPT    13
186#define V_NSB       14
187#define V_CONTENTSB 15
188#define V_DEG_STOP  31
189
190
191#define OPT_PROT           0
192#define OPT_REDSB          1
193#define OPT_NOT_BUCKETS    2
194#define OPT_NOT_SUGAR      3
195#define OPT_INTERRUPT      4
196#define OPT_SUGARCRIT      5
197#define OPT_DEBUG          6
198#define OPT_REDTHROUGH     7
199#define OPT_RETURN_SB      9
200#define OPT_FASTHC        10
201#define OPT_OLDSTD        20
202#define OPT_KEEPVARS      21
203#define OPT_STAIRCASEBOUND 22
204#define OPT_MULTBOUND     23
205#define OPT_DEGBOUND      24
206#define OPT_REDTAIL       25
207#define OPT_INTSTRATEGY   26
208#define OPT_INFREDTAIL    28
209#define OPT_SB_1          29
210#define OPT_NOTREGULARITY 30
211#define OPT_WEIGHTM       31
212
213/* define ring dependent options */ 
214#define TEST_RINGDEP_OPTS \
215 (Sy_bit(OPT_INTSTRATEGY) | Sy_bit(OPT_REDTHROUGH) | Sy_bit(OPT_REDTAIL))
216
217#define TEST_OPT_PROT              BTEST1(OPT_PROT)
218#define TEST_OPT_REDSB             BTEST1(OPT_REDSB)
219#define TEST_OPT_NOT_BUCKETS       BTEST1(OPT_NOT_BUCKETS)
220#define TEST_OPT_NOT_SUGAR         BTEST1(OPT_NOT_SUGAR)
221#define TEST_OPT_SUGARCRIT         BTEST1(OPT_SUGARCRIT)
222#define TEST_OPT_DEBUG             BTEST1(OPT_DEBUG)
223#define TEST_OPT_FASTHC            BTEST1(OPT_FASTHC)
224#define TEST_OPT_INTSTRATEGY       BTEST1(OPT_INTSTRATEGY)
225#define TEST_OPT_RETURN_SB         BTEST1(OPT_RETURN_SB)
226#define TEST_OPT_KEEPVARS          BTEST1(OPT_KEEPVARS)
227#define TEST_OPT_DEGBOUND          BTEST1(OPT_DEGBOUND)
228#define TEST_OPT_MULTBOUND         BTEST1(OPT_MULTBOUND)
229#define TEST_OPT_STAIRCASEBOUND    BTEST1(OPT_STAIRCASEBOUND)
230#define TEST_OPT_REDTAIL           BTEST1(OPT_REDTAIL)
231#define TEST_OPT_INFREDTAIL        BTEST1(OPT_INFREDTAIL)
232#define TEST_OPT_SB_1              BTEST1(OPT_SB_1)
233#define TEST_OPT_NOTREGULARITY     BTEST1(OPT_NOTREGULARITY)
234#define TEST_OPT_WEIGHTM           BTEST1(OPT_WEIGHTM)
235#define TEST_OPT_REDTHROUGH        BTEST1(OPT_REDTHROUGH)
236#define TEST_OPT_OLDSTD            BTEST1(OPT_OLDSTD)
237#define TEST_OPT_CONTENTSB         BVERBOSE(V_CONTENTSB)
238
239#define TEST_VERB_NSB              BVERBOSE(V_NSB)
240#define TEST_V_DEG_STOP            BVERBOSE(V_DEG_STOP)
241
242#endif
Note: See TracBrowser for help on using the repository browser.