source: git/Singular/tok.h @ cfa930

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