source: git/Singular/tok.h @ 15da55

spielwiese
Last change on this file since 15da55 was 15da55, checked in by Hans Schönemann <hannes@…>, 24 years ago
*hannes: dependecies on HAVE_SHIFTED_EXPONENTS moved from mod2.h.in to tok.h git-svn-id: file:///usr/local/Singular/svn/trunk@4108 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 5.1 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.37 2000-02-01 15:29:27 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 following defines should really go into mod2.h,
40   but configure dislikes it */
41
42#ifdef HAVE_SHIFTED_EXPONENTS
43/* Define the type of the exponents to be used in monomials */
44#undef EXPONENT_T
45#define EXPONENT_T long
46/* Define the size of exponent */
47#define SIZEOF_EXPONENT SIZEOF_LONG
48#endif
49
50
51/* the follwing defines for infix operators should not be changed: *
52*  grammar.y does not use the symbolic names                       *
53*  scanner.l uses the identies for some optimzations              */
54#define LOGIC_OP         '&'
55#define MULDIV_OP        '/'
56#define COMP_OP          '<'
57
58#define COMMAND           UMINUS+2 /* in tok.h */
59#define ANY_TYPE          UMINUS+3
60#define IDHDL             UMINUS+4
61#define NSHDL             UMINUS+5
62
63enum {
64  ALIAS_CMD     = UMINUS + 15,
65  ATTRIB_CMD,
66  BAREISS_CMD,
67  BREAKPOINT_CMD,
68  CHARACTERISTIC_CMD,
69  CHARSTR_CMD,
70  CHAR_SERIES_CMD,
71  CLOSE_CMD,
72  COLS_CMD,
73  CONTENT_CMD,
74  COUNT_CMD,
75  DBPRINT_CMD,
76  DEF_CMD,
77  DEFINED_CMD,
78  DELETE_CMD,
79  DET_CMD,
80  DUMP_CMD,
81  END_GRAMMAR,
82  ERROR_CMD,
83  EXTGCD_CMD,
84  FAC_CMD,
85  FIND_CMD,
86  FACSTD_CMD,
87  FGLM_CMD,
88  FGLMQUOT_CMD,
89  FINDUNI_CMD,
90  GCD_CMD,
91  GETDUMP_CMD,
92  HIGHCORNER_CMD,
93  HRES_CMD,
94  INSERT_CMD,
95  INT_CMD,
96  INTDIV_CMD,
97  INTMOD_CMD,
98  INTVEC_CMD,
99  IS_RINGVAR,
100  KILLATTR_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  NEWTONPOLY_CMD,
113  NPARS_CMD,
114  NVARS_CMD,
115  OPEN_CMD,
116  OPTION_CMD,
117  ORDSTR_CMD,
118  PACKAGE_CMD,
119  PARSTR_CMD,
120  POINTER_CMD,
121  PRIME_CMD,
122  PRINT_CMD,
123  PRUNE_CMD,
124  QRING_CMD,
125  RANDOM_CMD,
126  READ_CMD,
127  RESERVEDNAME_CMD,
128  RESULTANT_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)     (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
189#define TEST_VERB_NSB              BVERBOSE(V_NSB)
190
191#define OPT_PROT           0
192#define OPT_REDSB          1
193#define OPT_NOT_SUGAR      3
194#define OPT_INTERRUPT      4
195#define OPT_SUGARCRIT      5
196#define OPT_DEBUG          6
197#define OPT_CANCELUNIT     7
198#define OPT_MOREPAIRS      8
199#define OPT_RETURN_SB      9
200#define OPT_FASTHC        10
201#define OPT_KEEPVARS      21
202#define OPT_STAIRCASEBOUND 22
203#define OPT_MULTBOUND     23
204#define OPT_DEGBOUND      24
205#define OPT_REDTAIL       25
206#define OPT_INTSTRATEGY   26
207#define OPT_SB_1          29
208#define OPT_NOTREGULARITY 30
209#define OPT_WEIGHTM       31
210
211#define TEST_OPT_PROT              BTEST1(OPT_PROT)
212#define TEST_OPT_REDSB             BTEST1(OPT_REDSB)
213#define TEST_OPT_NOT_SUGAR         BTEST1(OPT_NOT_SUGAR)
214#define TEST_OPT_SUGARCRIT         BTEST1(OPT_SUGARCRIT)
215#define TEST_OPT_DEBUG             BTEST1(OPT_DEBUG)
216#define TEST_OPT_MOREPAIRS         BTEST1(OPT_MOREPAIRS)
217#define TEST_OPT_FASTHC            BTEST1(OPT_FASTHC)
218#define TEST_OPT_INTSTRATEGY       BTEST1(OPT_INTSTRATEGY)
219#define TEST_OPT_CANCELUNIT        BTEST1(OPT_CANCELUNIT)
220#define TEST_OPT_RETURN_SB         BTEST1(OPT_RETURN_SB)
221#define TEST_OPT_KEEPVARS          BTEST1(OPT_KEEPVARS)
222#define TEST_OPT_DEGBOUND          BTEST1(OPT_DEGBOUND)
223#define TEST_OPT_MULTBOUND         BTEST1(OPT_MULTBOUND)
224#define TEST_OPT_STAIRCASEBOUND    BTEST1(OPT_STAIRCASEBOUND)
225#define TEST_OPT_REDTAIL           BTEST1(OPT_REDTAIL)
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
230#endif
Note: See TracBrowser for help on using the repository browser.