source: git/Singular/tok.h @ 48aa42

spielwiese
Last change on this file since 48aa42 was 48aa42, checked in by Olaf Bachmann <obachman@…>, 23 years ago
opt(redThrough) etc added git-svn-id: file:///usr/local/Singular/svn/trunk@4905 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 5.0 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.47 2000-12-14 16:38:55 obachman 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  ROWS_CMD,
122  SIMPLEX_CMD,
123  SQR_FREE_DEC_CMD,
124  STATUS_CMD,
125  STRING_CMD,
126  SYSTEM_CMD,
127  TEST_CMD,
128  TRANSPOSE_CMD,
129  TRACE_CMD,
130  TYPEOF_CMD,
131  UNLOAD_CMD,
132  URSOLVE_CMD,
133  VANDER_CMD,
134  VARSTR_CMD,
135  WRITE_CMD,
136  /* start system var section: VECHO */
137  VECHO,
138  VPAGELENGTH,
139  VCOLMAX,
140  VTIMER,
141  VRTIMER,
142  TRACE,
143  VOICE,
144  VSHORTOUT,
145  VPRINTLEVEL,
146  /* end system var section: VPRINTLEVEL */
147
148  MAX_TOK /* must be the last, biggest token number */
149};
150
151#define NONE END_RING
152#define UNKNOWN 0
153
154/*
155**  Set operations (small sets only)
156*/
157
158#define Sy_bit(x)     (1<<(x))
159#define Sy_inset(x,s) ((Sy_bit(x)&(s))?TRUE:FALSE)
160#define BTEST1(a)     Sy_inset((a), test)
161#define BVERBOSE(a)   Sy_inset((a), verbose)
162
163/*
164** defines for BITSETs
165*/
166
167#define V_SHOW_MEM  2
168#define V_YACC      3
169#define V_REDEFINE  4
170#define V_READING   5
171#define V_LOAD_LIB  6
172#define V_DEBUG_LIB 7
173#define V_LOAD_PROC 8
174#define V_DEF_RES   9
175#define V_DEBUG_MEM 10
176#define V_SHOW_USE  11
177#define V_IMAP      12
178#define V_PROMPT    13
179#define V_NSB       14
180#define V_DEG_STOP  31
181
182
183#define OPT_PROT           0
184#define OPT_REDSB          1
185#define OPT_NOT_BUCKETS    2
186#define OPT_NOT_SUGAR      3
187#define OPT_INTERRUPT      4
188#define OPT_SUGARCRIT      5
189#define OPT_DEBUG          6
190#define OPT_REDTHROUGH     7
191#define OPT_RETURN_SB      9
192#define OPT_FASTHC        10
193#define OPT_KEEPVARS      21
194#define OPT_STAIRCASEBOUND 22
195#define OPT_MULTBOUND     23
196#define OPT_DEGBOUND      24
197#define OPT_REDTAIL       25
198#define OPT_INTSTRATEGY   26
199#define OPT_INFREDTAIL    28
200#define OPT_SB_1          29
201#define OPT_NOTREGULARITY 30
202#define OPT_WEIGHTM       31
203
204#define TEST_OPT_PROT              BTEST1(OPT_PROT)
205#define TEST_OPT_REDSB             BTEST1(OPT_REDSB)
206#define TEST_OPT_NOT_BUCKETS       BTEST1(OPT_NOT_BUCKETS)
207#define TEST_OPT_NOT_SUGAR         BTEST1(OPT_NOT_SUGAR)
208#define TEST_OPT_SUGARCRIT         BTEST1(OPT_SUGARCRIT)
209#define TEST_OPT_DEBUG             BTEST1(OPT_DEBUG)
210#define TEST_OPT_FASTHC            BTEST1(OPT_FASTHC)
211#define TEST_OPT_INTSTRATEGY       BTEST1(OPT_INTSTRATEGY)
212#define TEST_OPT_RETURN_SB         BTEST1(OPT_RETURN_SB)
213#define TEST_OPT_KEEPVARS          BTEST1(OPT_KEEPVARS)
214#define TEST_OPT_DEGBOUND          BTEST1(OPT_DEGBOUND)
215#define TEST_OPT_MULTBOUND         BTEST1(OPT_MULTBOUND)
216#define TEST_OPT_STAIRCASEBOUND    BTEST1(OPT_STAIRCASEBOUND)
217#define TEST_OPT_REDTAIL           BTEST1(OPT_REDTAIL)
218#define TEST_OPT_INFREDTAIL        BTEST1(OPT_INFREDTAIL)
219#define TEST_OPT_SB_1              BTEST1(OPT_SB_1)
220#define TEST_OPT_NOTREGULARITY     BTEST1(OPT_NOTREGULARITY)
221#define TEST_OPT_WEIGHTM           BTEST1(OPT_WEIGHTM)
222#define TEST_OPT_REDTHROUGH        BTEST1(OPT_REDTHROUGH)
223
224#define TEST_VERB_NSB              BVERBOSE(V_NSB)
225#define TEST_V_DEG_STOP            BVERBOSE(V_DEG_STOP)
226
227#endif
Note: See TracBrowser for help on using the repository browser.