source: git/Singular/tok.h @ 9b6b58

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