source: git/Singular/tok.h @ d18870

fieker-DuValspielwiese
Last change on this file since d18870 was 84d6c3, checked in by Hans Schönemann <hannes@…>, 24 years ago
*hannes: V_DEG_STOP git-svn-id: file:///usr/local/Singular/svn/trunk@4307 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.41 2000-05-09 14:33:03 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  EXTGCD_CMD,
72  FAC_CMD,
73  FIND_CMD,
74  FACSTD_CMD,
75  FGLM_CMD,
76  FGLMQUOT_CMD,
77  FINDUNI_CMD,
78  GCD_CMD,
79  GETDUMP_CMD,
80  HIGHCORNER_CMD,
81  HRES_CMD,
82  INSERT_CMD,
83  INT_CMD,
84  INTDIV_CMD,
85  INTMOD_CMD,
86  INTVEC_CMD,
87  IS_RINGVAR,
88  KILLATTR_CMD,
89  LAGSOLVE_CMD,
90  LINK_CMD,
91  LIST_CMD,
92  LOAD_CMD,
93  LRES_CMD,
94  MEMORY_CMD,
95  MONITOR_CMD,
96  MPRES_CMD,
97  MSTD_CMD,
98  NAMEOF_CMD,
99  NAMES_CMD,
100  NEWTONPOLY_CMD,
101  NPARS_CMD,
102  NVARS_CMD,
103  OPEN_CMD,
104  OPTION_CMD,
105  ORDSTR_CMD,
106  PACKAGE_CMD,
107  PARSTR_CMD,
108  POINTER_CMD,
109  PRIME_CMD,
110  PRINT_CMD,
111  PRUNE_CMD,
112  QRING_CMD,
113  RANDOM_CMD,
114  READ_CMD,
115  RESERVEDNAME_CMD,
116  RESULTANT_CMD,
117  ROWS_CMD,
118  SIMPLEX_CMD,
119  SQR_FREE_DEC_CMD,
120  STATUS_CMD,
121  STRING_CMD,
122  SYSTEM_CMD,
123  TEST_CMD,
124  TRANSPOSE_CMD,
125  TRACE_CMD,
126  TYPEOF_CMD,
127  UNLOAD_CMD,
128  URSOLVE_CMD,
129  VANDER_CMD,
130  VARSTR_CMD,
131  WRITE_CMD,
132  /* start system var section: VECHO */
133  VECHO,
134  VPAGELENGTH,
135  VCOLMAX,
136  VTIMER,
137  VRTIMER,
138  TRACE,
139  VOICE,
140  VSHORTOUT,
141  VPRINTLEVEL,
142  /* end system var section: VPRINTLEVEL */
143
144  MAX_TOK /* must be the last, biggest token number */
145};
146
147#define NONE END_RING
148#define UNKNOWN 0
149
150/*
151**  Set operations (small sets only)
152*/
153
154#define Sy_bit(x)     (1<<(x))
155#define Sy_inset(x,s) ((Sy_bit(x)&(s))?TRUE:FALSE)
156#define BTEST1(a)     Sy_inset((a), test)
157#define BVERBOSE(a)   Sy_inset((a), verbose)
158
159/*
160** defines for BITSETs
161*/
162
163#define V_SHOW_MEM  2
164#define V_YACC      3
165#define V_REDEFINE  4
166#define V_READING   5
167#define V_LOAD_LIB  6
168#define V_DEBUG_LIB 7
169#define V_LOAD_PROC 8
170#define V_DEF_RES   9
171#define V_DEBUG_MEM 10
172#define V_SHOW_USE  11
173#define V_IMAP      12
174#define V_PROMPT    13
175#define V_NSB       14
176#define V_DEG_STOP  31
177
178
179#define OPT_PROT           0
180#define OPT_REDSB          1
181#define OPT_NOT_SUGAR      3
182#define OPT_INTERRUPT      4
183#define OPT_SUGARCRIT      5
184#define OPT_DEBUG          6
185#define OPT_CANCELUNIT     7
186#define OPT_MOREPAIRS      8
187#define OPT_RETURN_SB      9
188#define OPT_FASTHC        10
189#define OPT_REDBEST       20
190#define OPT_KEEPVARS      21
191#define OPT_STAIRCASEBOUND 22
192#define OPT_MULTBOUND     23
193#define OPT_DEGBOUND      24
194#define OPT_REDTAIL       25
195#define OPT_INTSTRATEGY   26
196#define OPT_INFREDTAIL    28
197#define OPT_SB_1          29
198#define OPT_NOTREGULARITY 30
199#define OPT_WEIGHTM       31
200
201#define TEST_OPT_PROT              BTEST1(OPT_PROT)
202#define TEST_OPT_REDSB             BTEST1(OPT_REDSB)
203#define TEST_OPT_NOT_SUGAR         BTEST1(OPT_NOT_SUGAR)
204#define TEST_OPT_SUGARCRIT         BTEST1(OPT_SUGARCRIT)
205#define TEST_OPT_DEBUG             BTEST1(OPT_DEBUG)
206#define TEST_OPT_MOREPAIRS         BTEST1(OPT_MOREPAIRS)
207#define TEST_OPT_FASTHC            BTEST1(OPT_FASTHC)
208#define TEST_OPT_REDBEST           BTEST1(OPT_REDBEST)
209#define TEST_OPT_INTSTRATEGY       BTEST1(OPT_INTSTRATEGY)
210#define TEST_OPT_CANCELUNIT        BTEST1(OPT_CANCELUNIT)
211#define TEST_OPT_RETURN_SB         BTEST1(OPT_RETURN_SB)
212#define TEST_OPT_KEEPVARS          BTEST1(OPT_KEEPVARS)
213#define TEST_OPT_DEGBOUND          BTEST1(OPT_DEGBOUND)
214#define TEST_OPT_MULTBOUND         BTEST1(OPT_MULTBOUND)
215#define TEST_OPT_STAIRCASEBOUND    BTEST1(OPT_STAIRCASEBOUND)
216#define TEST_OPT_REDTAIL           BTEST1(OPT_REDTAIL)
217#define TEST_OPT_INFREDTAIL        BTEST1(OPT_INFREDTAIL)
218#define TEST_OPT_SB_1              BTEST1(OPT_SB_1)
219#define TEST_OPT_NOTREGULARITY     BTEST1(OPT_NOTREGULARITY)
220#define TEST_OPT_WEIGHTM           BTEST1(OPT_WEIGHTM)
221
222#define TEST_VERB_NSB              BVERBOSE(V_NSB)
223#define TEST_V_DEG_STOP            BVERBOSE(V_DEG_STOP)
224
225#endif
Note: See TracBrowser for help on using the repository browser.