source: git/Singular/tok.h @ d9a2b63

spielwiese
Last change on this file since d9a2b63 was d9a2b63, checked in by Hans Schönemann <hannes@…>, 20 years ago
*hannes: ncalgebra git-svn-id: file:///usr/local/Singular/svn/trunk@6970 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 5.5 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.56 2003-12-16 14:55:37 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  NCALGEBRA_CMD,
110  NEWTONPOLY_CMD,
111  NPARS_CMD,
112  NVARS_CMD,
113  OPEN_CMD,
114  OPTION_CMD,
115  ORDSTR_CMD,
116  PACKAGE_CMD,
117  PARSTR_CMD,
118  POINTER_CMD,
119  PRIME_CMD,
120  PRINT_CMD,
121  PRUNE_CMD,
122  QRING_CMD,
123  RANDOM_CMD,
124  READ_CMD,
125  REPART_CMD,
126  RESERVEDNAME_CMD,
127  RESULTANT_CMD,
128  RINGLIST_CMD,
129  ROWS_CMD,
130  SIMPLEX_CMD,
131  SQR_FREE_DEC_CMD,
132  STATUS_CMD,
133  STRING_CMD,
134  SYSTEM_CMD,
135  TEST_CMD,
136  TRANSPOSE_CMD,
137  TRACE_CMD,
138  TYPEOF_CMD,
139  UNLOAD_CMD,
140  URSOLVE_CMD,
141  VANDER_CMD,
142  VARSTR_CMD,
143  WRITE_CMD,
144  /* start system var section: VECHO */
145  VECHO,
146  VPAGELENGTH,
147  VCOLMAX,
148  VTIMER,
149  VRTIMER,
150  TRACE,
151  VOICE,
152  VSHORTOUT,
153  VPRINTLEVEL,
154  /* end system var section: VPRINTLEVEL */
155
156  MAX_TOK /* must be the last, biggest token number */
157};
158
159#define NONE END_RING
160#define UNKNOWN 0
161
162/*
163**  Set operations (small sets only)
164*/
165
166#define Sy_bit(x)     ((unsigned)1<<(x))
167#define Sy_inset(x,s) ((Sy_bit(x)&(s))?TRUE:FALSE)
168#define BTEST1(a)     Sy_inset((a), test)
169#define BVERBOSE(a)   Sy_inset((a), verbose)
170
171/*
172** defines for BITSETs
173*/
174
175#define V_SHOW_MEM  2
176#define V_YACC      3
177#define V_REDEFINE  4
178#define V_READING   5
179#define V_LOAD_LIB  6
180#define V_DEBUG_LIB 7
181#define V_LOAD_PROC 8
182#define V_DEF_RES   9
183#define V_DEBUG_MEM 10
184#define V_SHOW_USE  11
185#define V_IMAP      12
186#define V_PROMPT    13
187#define V_NSB       14
188#define V_CONTENTSB 15
189#define V_CANCELUNIT 16
190#define V_DEG_STOP  31
191
192
193#define OPT_PROT           0
194#define OPT_REDSB          1
195#define OPT_NOT_BUCKETS    2
196#define OPT_NOT_SUGAR      3
197#define OPT_INTERRUPT      4
198#define OPT_SUGARCRIT      5
199#define OPT_DEBUG          6
200#define OPT_REDTHROUGH     7
201#define OPT_RETURN_SB      9
202#define OPT_FASTHC        10
203#define OPT_OLDSTD        20
204#define OPT_KEEPVARS      21
205#define OPT_STAIRCASEBOUND 22
206#define OPT_MULTBOUND     23
207#define OPT_DEGBOUND      24
208#define OPT_REDTAIL       25
209#define OPT_INTSTRATEGY   26
210#define OPT_INFREDTAIL    28
211#define OPT_SB_1          29
212#define OPT_NOTREGULARITY 30
213#define OPT_WEIGHTM       31
214
215/* define ring dependent options */ 
216#define TEST_RINGDEP_OPTS \
217 (Sy_bit(OPT_INTSTRATEGY) | Sy_bit(OPT_REDTHROUGH) | Sy_bit(OPT_REDTAIL))
218
219#define TEST_OPT_PROT              BTEST1(OPT_PROT)
220#define TEST_OPT_REDSB             BTEST1(OPT_REDSB)
221#define TEST_OPT_NOT_BUCKETS       BTEST1(OPT_NOT_BUCKETS)
222#define TEST_OPT_NOT_SUGAR         BTEST1(OPT_NOT_SUGAR)
223#define TEST_OPT_SUGARCRIT         BTEST1(OPT_SUGARCRIT)
224#define TEST_OPT_DEBUG             BTEST1(OPT_DEBUG)
225#define TEST_OPT_FASTHC            BTEST1(OPT_FASTHC)
226#define TEST_OPT_INTSTRATEGY       BTEST1(OPT_INTSTRATEGY)
227#define TEST_OPT_RETURN_SB         BTEST1(OPT_RETURN_SB)
228#define TEST_OPT_KEEPVARS          BTEST1(OPT_KEEPVARS)
229#define TEST_OPT_DEGBOUND          BTEST1(OPT_DEGBOUND)
230#define TEST_OPT_MULTBOUND         BTEST1(OPT_MULTBOUND)
231#define TEST_OPT_STAIRCASEBOUND    BTEST1(OPT_STAIRCASEBOUND)
232#define TEST_OPT_REDTAIL           BTEST1(OPT_REDTAIL)
233#define TEST_OPT_INFREDTAIL        BTEST1(OPT_INFREDTAIL)
234#define TEST_OPT_SB_1              BTEST1(OPT_SB_1)
235#define TEST_OPT_NOTREGULARITY     BTEST1(OPT_NOTREGULARITY)
236#define TEST_OPT_WEIGHTM           BTEST1(OPT_WEIGHTM)
237#define TEST_OPT_REDTHROUGH        BTEST1(OPT_REDTHROUGH)
238#define TEST_OPT_OLDSTD            BTEST1(OPT_OLDSTD)
239#define TEST_OPT_CONTENTSB         BVERBOSE(V_CONTENTSB)
240#define TEST_OPT_CANCELUNIT        BVERBOSE(V_CANCELUNIT)
241
242#define TEST_VERB_NSB              BVERBOSE(V_NSB)
243#define TEST_V_DEG_STOP            BVERBOSE(V_DEG_STOP)
244
245#endif
Note: See TracBrowser for help on using the repository browser.