My Project
Loading...
Searching...
No Matches
Macros | Enumerations | Functions | Variables
tok.h File Reference
#include "kernel/mod2.h"
#include "Singular/grammar.h"

Go to the source code of this file.

Macros

#define LOGIC_OP   '&'
 
#define MULDIV_OP   '/'
 
#define COMP_OP   '<'
 
#define COMMAND   UMINUS+2 /* in tok.h */
 
#define ANY_TYPE   UMINUS+3
 
#define IDHDL   UMINUS+4
 
#define NONE   END_RING
 
#define UNKNOWN   0
 

Enumerations

enum  {
  ALIAS_CMD = UMINUS + 15 , ALIGN_CMD , ATTRIB_CMD , BAREISS_CMD ,
  BIGINT_CMD , BRANCHTO_CMD , BRACKET_CMD , BREAKPOINT_CMD ,
  CHARACTERISTIC_CMD , CHARSTR_CMD , CHAR_SERIES_CMD , CHINREM_CMD ,
  CMATRIX_CMD , CNUMBER_CMD , CPOLY_CMD , CLOSE_CMD ,
  COEFFS_CMD , COEF_CMD , COLS_CMD , CONTENT_CMD ,
  CONTRACT_CMD , COUNT_CMD , CRING_CMD , DBPRINT_CMD ,
  DEF_CMD , DEFINED_CMD , DEG_CMD , DEGREE_CMD ,
  DELETE_CMD , DENOMINATOR_CMD , DET_CMD , DIFF_CMD ,
  DIM_CMD , DIVISION_CMD , DUMP_CMD , ELIMINATION_CMD ,
  END_GRAMMAR , ENVELOPE_CMD , ERROR_CMD , EXECUTE_CMD ,
  EXPORTTO_CMD , EXTGCD_CMD , FAC_CMD , FAREY_CMD ,
  FIND_CMD , FACSTD_CMD , FMD_CMD , FRES_CMD ,
  FWALK_CMD , FGLM_CMD , FGLMQUOT_CMD , FINDUNI_CMD ,
  GCD_CMD , GETDUMP_CMD , HIGHCORNER_CMD , HILBERT_CMD ,
  HOMOG_CMD , HRES_CMD , IMPART_CMD , IMPORTFROM_CMD ,
  INDEPSET_CMD , INSERT_CMD , INT_CMD , INTDIV_CMD ,
  INTERPOLATE_CMD , INTERRED_CMD , INTERSECT_CMD , INTVEC_CMD ,
  IS_RINGVAR , JACOB_CMD , JANET_CMD , JET_CMD ,
  KBASE_CMD , KERNEL_CMD , KILLATTR_CMD , KRES_CMD ,
  LAGSOLVE_CMD , LEAD_CMD , LEADCOEF_CMD , LEADEXP_CMD ,
  LEADMONOM_CMD , LIFTSTD_CMD , LIFT_CMD , LINK_CMD ,
  LIST_CMD , LOAD_CMD , LRES_CMD , LU_CMD ,
  LUI_CMD , LUS_CMD , MEMORY_CMD , MINBASE_CMD ,
  MINOR_CMD , MINRES_CMD , MODULO_CMD , MONITOR_CMD ,
  MPRES_CMD , MRES_CMD , MSTD_CMD , MULTIPLICITY_CMD ,
  NAMEOF_CMD , NAMES_CMD , NEWSTRUCT_CMD , NCALGEBRA_CMD ,
  NC_ALGEBRA_CMD , NEWTONPOLY_CMD , NPARS_CMD , NUMERATOR_CMD ,
  NVARS_CMD , ORD_CMD , OPEN_CMD , OPPOSE_CMD ,
  OPPOSITE_CMD , OPTION_CMD , ORDSTR_CMD , PACKAGE_CMD ,
  PARDEG_CMD , PARENT_CMD , PARSTR_CMD , PFAC_CMD ,
  PRIME_CMD , PRINT_CMD , PRUNE_CMD , QHWEIGHT_CMD ,
  QRING_CMD , QRDS_CMD , QUOTIENT_CMD , RANDOM_CMD ,
  RANK_CMD , READ_CMD , REDUCE_CMD , REGULARITY_CMD ,
  REPART_CMD , RES_CMD , RESERVEDNAME_CMD , RESERVEDNAMELIST_CMD ,
  RESTART_CMD , RESULTANT_CMD , RIGHTSTD_CMD , RINGLIST_CMD ,
  RING_LIST_CMD , ROWS_CMD , SBA_CMD , SIMPLEX_CMD ,
  SIMPLIFY_CMD , SLIM_GB_CMD , SORTVEC_CMD , SQR_FREE_CMD ,
  SRES_CMD , STATUS_CMD , STD_CMD , STRING_CMD ,
  SUBST_CMD , SYSTEM_CMD , SYZYGY_CMD , TENSOR_CMD ,
  TEST_CMD , TRANSPOSE_CMD , TRACE_CMD , TWOSTD_CMD ,
  TYPEOF_CMD , UNIVARIATE_CMD , UNLOAD_CMD , URSOLVE_CMD ,
  VANDER_CMD , VARIABLES_CMD , VARSTR_CMD , VDIM_CMD ,
  WAIT1ST_CMD , WAITALL_CMD , WEDGE_CMD , WEIGHT_CMD ,
  WRITE_CMD , VECHO , VCOLMAX , VTIMER ,
  VRTIMER , TRACE , VOICE , VSHORTOUT ,
  VPRINTLEVEL , MAX_TOK
}
 

Functions

int yyparse (void)
 

Variables

EXTERN_VAR int yylineno
 
EXTERN_VAR char my_yylinebuf [80]
 

Macro Definition Documentation

◆ ANY_TYPE

#define ANY_TYPE   UMINUS+3

Definition at line 30 of file tok.h.

◆ COMMAND

#define COMMAND   UMINUS+2 /* in tok.h */

Definition at line 29 of file tok.h.

◆ COMP_OP

#define COMP_OP   '<'

Definition at line 27 of file tok.h.

◆ IDHDL

#define IDHDL   UMINUS+4

Definition at line 31 of file tok.h.

◆ LOGIC_OP

#define LOGIC_OP   '&'

Definition at line 25 of file tok.h.

◆ MULDIV_OP

#define MULDIV_OP   '/'

Definition at line 26 of file tok.h.

◆ NONE

#define NONE   END_RING

Definition at line 221 of file tok.h.

◆ UNKNOWN

#define UNKNOWN   0

Definition at line 222 of file tok.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ALIAS_CMD 
ALIGN_CMD 
ATTRIB_CMD 
BAREISS_CMD 
BIGINT_CMD 
BRANCHTO_CMD 
BRACKET_CMD 
BREAKPOINT_CMD 
CHARACTERISTIC_CMD 
CHARSTR_CMD 
CHAR_SERIES_CMD 
CHINREM_CMD 
CMATRIX_CMD 
CNUMBER_CMD 
CPOLY_CMD 
CLOSE_CMD 
COEFFS_CMD 
COEF_CMD 
COLS_CMD 
CONTENT_CMD 
CONTRACT_CMD 
COUNT_CMD 
CRING_CMD 
DBPRINT_CMD 
DEF_CMD 
DEFINED_CMD 
DEG_CMD 
DEGREE_CMD 
DELETE_CMD 
DENOMINATOR_CMD 
DET_CMD 
DIFF_CMD 
DIM_CMD 
DIVISION_CMD 
DUMP_CMD 
ELIMINATION_CMD 
END_GRAMMAR 
ENVELOPE_CMD 
ERROR_CMD 
EXECUTE_CMD 
EXPORTTO_CMD 
EXTGCD_CMD 
FAC_CMD 
FAREY_CMD 
FIND_CMD 
FACSTD_CMD 
FMD_CMD 
FRES_CMD 
FWALK_CMD 
FGLM_CMD 
FGLMQUOT_CMD 
FINDUNI_CMD 
GCD_CMD 
GETDUMP_CMD 
HIGHCORNER_CMD 
HILBERT_CMD 
HOMOG_CMD 
HRES_CMD 
IMPART_CMD 
IMPORTFROM_CMD 
INDEPSET_CMD 
INSERT_CMD 
INT_CMD 
INTDIV_CMD 
INTERPOLATE_CMD 
INTERRED_CMD 
INTERSECT_CMD 
INTVEC_CMD 
IS_RINGVAR 
JACOB_CMD 
JANET_CMD 
JET_CMD 
KBASE_CMD 
KERNEL_CMD 
KILLATTR_CMD 
KRES_CMD 
LAGSOLVE_CMD 
LEAD_CMD 
LEADCOEF_CMD 
LEADEXP_CMD 
LEADMONOM_CMD 
LIFTSTD_CMD 
LIFT_CMD 
LINK_CMD 
LIST_CMD 
LOAD_CMD 
LRES_CMD 
LU_CMD 
LUI_CMD 
LUS_CMD 
MEMORY_CMD 
MINBASE_CMD 
MINOR_CMD 
MINRES_CMD 
MODULO_CMD 
MONITOR_CMD 
MPRES_CMD 
MRES_CMD 
MSTD_CMD 
MULTIPLICITY_CMD 
NAMEOF_CMD 
NAMES_CMD 
NEWSTRUCT_CMD 
NCALGEBRA_CMD 
NC_ALGEBRA_CMD 
NEWTONPOLY_CMD 
NPARS_CMD 
NUMERATOR_CMD 
NVARS_CMD 
ORD_CMD 
OPEN_CMD 
OPPOSE_CMD 
OPPOSITE_CMD 
OPTION_CMD 
ORDSTR_CMD 
PACKAGE_CMD 
PARDEG_CMD 
PARENT_CMD 
PARSTR_CMD 
PFAC_CMD 
PRIME_CMD 
PRINT_CMD 
PRUNE_CMD 
QHWEIGHT_CMD 
QRING_CMD 
QRDS_CMD 
QUOTIENT_CMD 
RANDOM_CMD 
RANK_CMD 
READ_CMD 
REDUCE_CMD 
REGULARITY_CMD 
REPART_CMD 
RES_CMD 
RESERVEDNAME_CMD 
RESERVEDNAMELIST_CMD 
RESTART_CMD 
RESULTANT_CMD 
RIGHTSTD_CMD 
RINGLIST_CMD 
RING_LIST_CMD 
ROWS_CMD 
SBA_CMD 
SIMPLEX_CMD 
SIMPLIFY_CMD 
SLIM_GB_CMD 
SORTVEC_CMD 
SQR_FREE_CMD 
SRES_CMD 
STATUS_CMD 
STD_CMD 
STRING_CMD 
SUBST_CMD 
SYSTEM_CMD 
SYZYGY_CMD 
TENSOR_CMD 
TEST_CMD 
TRANSPOSE_CMD 
TRACE_CMD 
TWOSTD_CMD 
TYPEOF_CMD 
UNIVARIATE_CMD 
UNLOAD_CMD 
URSOLVE_CMD 
VANDER_CMD 
VARIABLES_CMD 
VARSTR_CMD 
VDIM_CMD 
WAIT1ST_CMD 
WAITALL_CMD 
WEDGE_CMD 
WEIGHT_CMD 
WRITE_CMD 
VECHO 
VCOLMAX 
VTIMER 
VRTIMER 
TRACE 
VOICE 
VSHORTOUT 
VPRINTLEVEL 
MAX_TOK 

Definition at line 33 of file tok.h.

33 {
34 ALIAS_CMD = UMINUS + 15,
58 DEF_CMD,
60 DEG_CMD,
64 DET_CMD,
66 DIM_CMD,
76 FAC_CMD,
80 FMD_CMD,
86 GCD_CMD,
96 INT_CMD,
103 JACOB_CMD,
104 JANET_CMD,
105 JET_CMD,
106 KBASE_CMD,
109 KRES_CMD,
111 LEAD_CMD,
116 LIFT_CMD,
117 LINK_CMD,
118 LIST_CMD,
119 LOAD_CMD,
120 LRES_CMD,
121 LU_CMD,
122 LUI_CMD,
123 LUS_CMD,
126 MINOR_CMD,
130 MPRES_CMD,
131 MRES_CMD,
132 MSTD_CMD,
135 NAMES_CMD,
140 NPARS_CMD,
142 NVARS_CMD,
143 ORD_CMD,
144 OPEN_CMD,
153 PFAC_CMD,
154 PRIME_CMD,
155 PRINT_CMD,
156 PRUNE_CMD,
158 QRING_CMD,
159 QRDS_CMD,
162 RANK_CMD,
163 READ_CMD,
167 RES_CMD,
175 ROWS_CMD,
176 SBA_CMD,
182 SRES_CMD,
184 STD_CMD,
186 SUBST_CMD,
190 TEST_CMD,
192 TRACE_CMD,
196 UNLOAD_CMD, /* unused*/
201 VDIM_CMD,
204 WEDGE_CMD,
206 WRITE_CMD,
207 /* start system var section: VECHO */
208 VECHO,
209 VCOLMAX,
210 VTIMER,
211 VRTIMER,
212 TRACE,
213 VOICE,
214 VSHORTOUT,
216 /* end system var section: VPRINTLEVEL */
217
218 MAX_TOK /* must be the last, biggest token number */
219};
@ UMINUS
Definition: grammar.cc:351
@ ERROR_CMD
Definition: tok.h:72
@ PFAC_CMD
Definition: tok.h:153
@ PARSTR_CMD
Definition: tok.h:152
@ HIGHCORNER_CMD
Definition: tok.h:88
@ ELIMINATION_CMD
Definition: tok.h:69
@ NCALGEBRA_CMD
Definition: tok.h:137
@ REPART_CMD
Definition: tok.h:166
@ VCOLMAX
Definition: tok.h:209
@ ALIAS_CMD
Definition: tok.h:34
@ SIMPLEX_CMD
Definition: tok.h:177
@ VARIABLES_CMD
Definition: tok.h:199
@ JACOB_CMD
Definition: tok.h:103
@ MSTD_CMD
Definition: tok.h:132
@ INDEPSET_CMD
Definition: tok.h:94
@ BIGINT_CMD
Definition: tok.h:38
@ SIMPLIFY_CMD
Definition: tok.h:178
@ CRING_CMD
Definition: tok.h:56
@ LIST_CMD
Definition: tok.h:118
@ FGLMQUOT_CMD
Definition: tok.h:84
@ RESTART_CMD
Definition: tok.h:170
@ VSHORTOUT
Definition: tok.h:214
@ BAREISS_CMD
Definition: tok.h:37
@ DEG_CMD
Definition: tok.h:60
@ VPRINTLEVEL
Definition: tok.h:215
@ LUS_CMD
Definition: tok.h:123
@ READ_CMD
Definition: tok.h:163
@ CLOSE_CMD
Definition: tok.h:49
@ SLIM_GB_CMD
Definition: tok.h:179
@ INTVEC_CMD
Definition: tok.h:101
@ RANDOM_CMD
Definition: tok.h:161
@ COUNT_CMD
Definition: tok.h:55
@ FWALK_CMD
Definition: tok.h:82
@ MULTIPLICITY_CMD
Definition: tok.h:133
@ NAMES_CMD
Definition: tok.h:135
@ PACKAGE_CMD
Definition: tok.h:149
@ BRANCHTO_CMD
Definition: tok.h:39
@ END_GRAMMAR
Definition: tok.h:70
@ MODULO_CMD
Definition: tok.h:128
@ JET_CMD
Definition: tok.h:105
@ CMATRIX_CMD
Definition: tok.h:46
@ HILBERT_CMD
Definition: tok.h:89
@ DIFF_CMD
Definition: tok.h:65
@ RIGHTSTD_CMD
Definition: tok.h:172
@ VANDER_CMD
Definition: tok.h:198
@ HOMOG_CMD
Definition: tok.h:90
@ NVARS_CMD
Definition: tok.h:142
@ MEMORY_CMD
Definition: tok.h:124
@ NEWTONPOLY_CMD
Definition: tok.h:139
@ DEF_CMD
Definition: tok.h:58
@ KBASE_CMD
Definition: tok.h:106
@ VECHO
Definition: tok.h:208
@ ATTRIB_CMD
Definition: tok.h:36
@ LRES_CMD
Definition: tok.h:120
@ IMPORTFROM_CMD
Definition: tok.h:93
@ SUBST_CMD
Definition: tok.h:186
@ CHARSTR_CMD
Definition: tok.h:43
@ HRES_CMD
Definition: tok.h:91
@ JANET_CMD
Definition: tok.h:104
@ REDUCE_CMD
Definition: tok.h:164
@ LIFTSTD_CMD
Definition: tok.h:115
@ KRES_CMD
Definition: tok.h:109
@ BREAKPOINT_CMD
Definition: tok.h:41
@ OPTION_CMD
Definition: tok.h:147
@ OPEN_CMD
Definition: tok.h:144
@ COEFFS_CMD
Definition: tok.h:50
@ LEADEXP_CMD
Definition: tok.h:113
@ QRDS_CMD
Definition: tok.h:159
@ CONTRACT_CMD
Definition: tok.h:54
@ CNUMBER_CMD
Definition: tok.h:47
@ LIFT_CMD
Definition: tok.h:116
@ TRANSPOSE_CMD
Definition: tok.h:191
@ LINK_CMD
Definition: tok.h:117
@ BRACKET_CMD
Definition: tok.h:40
@ STD_CMD
Definition: tok.h:184
@ SBA_CMD
Definition: tok.h:176
@ WAITALL_CMD
Definition: tok.h:203
@ EXECUTE_CMD
Definition: tok.h:73
@ TRACE
Definition: tok.h:212
@ DET_CMD
Definition: tok.h:64
@ DBPRINT_CMD
Definition: tok.h:57
@ CHINREM_CMD
Definition: tok.h:45
@ RING_LIST_CMD
Definition: tok.h:174
@ NUMERATOR_CMD
Definition: tok.h:141
@ NC_ALGEBRA_CMD
Definition: tok.h:138
@ URSOLVE_CMD
Definition: tok.h:197
@ ORD_CMD
Definition: tok.h:143
@ QRING_CMD
Definition: tok.h:158
@ PRINT_CMD
Definition: tok.h:155
@ FMD_CMD
Definition: tok.h:80
@ UNIVARIATE_CMD
Definition: tok.h:195
@ PARDEG_CMD
Definition: tok.h:150
@ MPRES_CMD
Definition: tok.h:130
@ NPARS_CMD
Definition: tok.h:140
@ PARENT_CMD
Definition: tok.h:151
@ MRES_CMD
Definition: tok.h:131
@ DIVISION_CMD
Definition: tok.h:67
@ PRIME_CMD
Definition: tok.h:154
@ LEADCOEF_CMD
Definition: tok.h:112
@ EXPORTTO_CMD
Definition: tok.h:74
@ IMPART_CMD
Definition: tok.h:92
@ NAMEOF_CMD
Definition: tok.h:134
@ TYPEOF_CMD
Definition: tok.h:194
@ KILLATTR_CMD
Definition: tok.h:108
@ REGULARITY_CMD
Definition: tok.h:165
@ WAIT1ST_CMD
Definition: tok.h:202
@ CONTENT_CMD
Definition: tok.h:53
@ STRING_CMD
Definition: tok.h:185
@ WRITE_CMD
Definition: tok.h:206
@ DEGREE_CMD
Definition: tok.h:61
@ OPPOSITE_CMD
Definition: tok.h:146
@ GETDUMP_CMD
Definition: tok.h:87
@ SRES_CMD
Definition: tok.h:182
@ WEIGHT_CMD
Definition: tok.h:205
@ ALIGN_CMD
Definition: tok.h:35
@ MONITOR_CMD
Definition: tok.h:129
@ VARSTR_CMD
Definition: tok.h:200
@ PRUNE_CMD
Definition: tok.h:156
@ STATUS_CMD
Definition: tok.h:183
@ DUMP_CMD
Definition: tok.h:68
@ RESERVEDNAMELIST_CMD
Definition: tok.h:169
@ FIND_CMD
Definition: tok.h:78
@ ENVELOPE_CMD
Definition: tok.h:71
@ COEF_CMD
Definition: tok.h:51
@ INTERRED_CMD
Definition: tok.h:99
@ WEDGE_CMD
Definition: tok.h:204
@ SQR_FREE_CMD
Definition: tok.h:181
@ DELETE_CMD
Definition: tok.h:62
@ SORTVEC_CMD
Definition: tok.h:180
@ FACSTD_CMD
Definition: tok.h:79
@ MINOR_CMD
Definition: tok.h:126
@ VTIMER
Definition: tok.h:210
@ QHWEIGHT_CMD
Definition: tok.h:157
@ VRTIMER
Definition: tok.h:211
@ RINGLIST_CMD
Definition: tok.h:173
@ LEAD_CMD
Definition: tok.h:111
@ ORDSTR_CMD
Definition: tok.h:148
@ LOAD_CMD
Definition: tok.h:119
@ DENOMINATOR_CMD
Definition: tok.h:63
@ TWOSTD_CMD
Definition: tok.h:193
@ FINDUNI_CMD
Definition: tok.h:85
@ VOICE
Definition: tok.h:213
@ CPOLY_CMD
Definition: tok.h:48
@ INTDIV_CMD
Definition: tok.h:97
@ TRACE_CMD
Definition: tok.h:192
@ INT_CMD
Definition: tok.h:96
@ QUOTIENT_CMD
Definition: tok.h:160
@ INTERSECT_CMD
Definition: tok.h:100
@ KERNEL_CMD
Definition: tok.h:107
@ INSERT_CMD
Definition: tok.h:95
@ LUI_CMD
Definition: tok.h:122
@ EXTGCD_CMD
Definition: tok.h:75
@ VDIM_CMD
Definition: tok.h:201
@ TEST_CMD
Definition: tok.h:190
@ GCD_CMD
Definition: tok.h:86
@ SYSTEM_CMD
Definition: tok.h:187
@ MINBASE_CMD
Definition: tok.h:125
@ SYZYGY_CMD
Definition: tok.h:188
@ FAREY_CMD
Definition: tok.h:77
@ INTERPOLATE_CMD
Definition: tok.h:98
@ LEADMONOM_CMD
Definition: tok.h:114
@ DIM_CMD
Definition: tok.h:66
@ NEWSTRUCT_CMD
Definition: tok.h:136
@ ROWS_CMD
Definition: tok.h:175
@ RESERVEDNAME_CMD
Definition: tok.h:168
@ RESULTANT_CMD
Definition: tok.h:171
@ OPPOSE_CMD
Definition: tok.h:145
@ TENSOR_CMD
Definition: tok.h:189
@ DEFINED_CMD
Definition: tok.h:59
@ MAX_TOK
Definition: tok.h:218
@ FRES_CMD
Definition: tok.h:81
@ IS_RINGVAR
Definition: tok.h:102
@ CHARACTERISTIC_CMD
Definition: tok.h:42
@ LU_CMD
Definition: tok.h:121
@ COLS_CMD
Definition: tok.h:52
@ FAC_CMD
Definition: tok.h:76
@ MINRES_CMD
Definition: tok.h:127
@ LAGSOLVE_CMD
Definition: tok.h:110
@ CHAR_SERIES_CMD
Definition: tok.h:44
@ FGLM_CMD
Definition: tok.h:83
@ UNLOAD_CMD
Definition: tok.h:196
@ RES_CMD
Definition: tok.h:167
@ RANK_CMD
Definition: tok.h:162

Function Documentation

◆ yyparse()

int yyparse ( void  )

Definition at line 2111 of file grammar.cc.

2118{
2119/* The lookahead symbol. */
2120int yychar;
2121
2122/* The semantic value of the lookahead symbol. */
2124
2125 /* Number of syntax errors so far. */
2126 int yynerrs;
2127
2128 int yystate;
2129 /* Number of tokens to shift before error messages enabled. */
2130 int yyerrstatus;
2131
2132 /* The stacks and their tools:
2133 `yyss': related to states.
2134 `yyvs': related to semantic values.
2135
2136 Refer to the stacks thru separate pointers, to allow yyoverflow
2137 to reallocate them elsewhere. */
2138
2139 /* The state stack. */
2141 yytype_int16 *yyss;
2142 yytype_int16 *yyssp;
2143
2144 /* The semantic value stack. */
2145 YYSTYPE yyvsa[YYINITDEPTH];
2146 YYSTYPE *yyvs;
2147 YYSTYPE *yyvsp;
2148
2149 YYSIZE_T yystacksize;
2150
2151 int yyn;
2152 int yyresult;
2153 /* Lookahead token as an internal (translated) token number. */
2154 int yytoken;
2155 /* The variables used to return semantic value and location from the
2156 action routines. */
2157 YYSTYPE yyval;
2158
2159#if YYERROR_VERBOSE
2160 /* Buffer for error messages, and its allocated size. */
2161 char yymsgbuf[128];
2162 char *yymsg = yymsgbuf;
2163 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
2164#endif
2165
2166#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
2167
2168 /* The number of symbols on the RHS of the reduced rule.
2169 Keep to zero when no symbol should be popped. */
2170 int yylen = 0;
2171
2172 yytoken = 0;
2173 yyss = yyssa;
2174 yyvs = yyvsa;
2175 yystacksize = YYINITDEPTH;
2176
2177 YYDPRINTF ((stderr, "Starting parse\n"));
2178
2179 yystate = 0;
2180 yyerrstatus = 0;
2181 yynerrs = 0;
2182 yychar = YYEMPTY; /* Cause a token to be read. */
2183
2184 /* Initialize stack pointers.
2185 Waste one element of value and location stack
2186 so that they stay on the same level as the state stack.
2187 The wasted elements are never initialized. */
2188 yyssp = yyss;
2189 yyvsp = yyvs;
2190
2191 goto yysetstate;
2192
2193/*------------------------------------------------------------.
2194| yynewstate -- Push a new state, which is found in yystate. |
2195`------------------------------------------------------------*/
2196 yynewstate:
2197 /* In all cases, when you get here, the value and location stacks
2198 have just been pushed. So pushing a state here evens the stacks. */
2199 yyssp++;
2200
2201 yysetstate:
2202 *yyssp = yystate;
2203
2204 if (yyss + yystacksize - 1 <= yyssp)
2205 {
2206 /* Get the current used size of the three stacks, in elements. */
2207 YYSIZE_T yysize = yyssp - yyss + 1;
2208
2209#ifdef yyoverflow
2210 {
2211 /* Give user a chance to reallocate the stack. Use copies of
2212 these so that the &'s don't force the real ones into
2213 memory. */
2214 YYSTYPE *yyvs1 = yyvs;
2215 yytype_int16 *yyss1 = yyss;
2216
2217 /* Each stack pointer address is followed by the size of the
2218 data in use in that stack, in bytes. This used to be a
2219 conditional around just the two extra args, but that might
2220 be undefined if yyoverflow is a macro. */
2221 yyoverflow (YY_("memory exhausted"),
2222 &yyss1, yysize * sizeof (*yyssp),
2223 &yyvs1, yysize * sizeof (*yyvsp),
2224 &yystacksize);
2225
2226 yyss = yyss1;
2227 yyvs = yyvs1;
2228 }
2229#else /* no yyoverflow */
2230# ifndef YYSTACK_RELOCATE
2231 goto yyexhaustedlab;
2232# else
2233 /* Extend the stack our own way. */
2234 if (YYMAXDEPTH <= yystacksize)
2235 goto yyexhaustedlab;
2236 yystacksize *= 2;
2237 if (YYMAXDEPTH < yystacksize)
2238 yystacksize = YYMAXDEPTH;
2239
2240 {
2241 yytype_int16 *yyss1 = yyss;
2242 union yyalloc *yyptr =
2243 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2244 if (! yyptr)
2245 goto yyexhaustedlab;
2246 YYSTACK_RELOCATE (yyss_alloc, yyss);
2247 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
2248# undef YYSTACK_RELOCATE
2249 if (yyss1 != yyssa)
2250 YYSTACK_FREE (yyss1);
2251 }
2252# endif
2253#endif /* no yyoverflow */
2254
2255 yyssp = yyss + yysize - 1;
2256 yyvsp = yyvs + yysize - 1;
2257
2258 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2259 (unsigned long int) yystacksize));
2260
2261 if (yyss + yystacksize - 1 <= yyssp)
2262 YYABORT;
2263 }
2264
2265 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2266
2267 if (yystate == YYFINAL)
2268 YYACCEPT;
2269
2270 goto yybackup;
2271
2272/*-----------.
2273| yybackup. |
2274`-----------*/
2275yybackup:
2276
2277 /* Do appropriate processing given the current state. Read a
2278 lookahead token if we need one and don't already have one. */
2279
2280 /* First try to decide what to do without reference to lookahead token. */
2281 yyn = yypact[yystate];
2282 if (yyn == YYPACT_NINF)
2283 goto yydefault;
2284
2285 /* Not known => get a lookahead token if don't already have one. */
2286
2287 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2288 if (yychar == YYEMPTY)
2289 {
2290 YYDPRINTF ((stderr, "Reading a token: "));
2291 yychar = YYLEX;
2292 }
2293
2294 if (yychar <= YYEOF)
2295 {
2296 yychar = yytoken = YYEOF;
2297 YYDPRINTF ((stderr, "Now at end of input.\n"));
2298 }
2299 else
2300 {
2301 yytoken = YYTRANSLATE (yychar);
2302 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2303 }
2304
2305 /* If the proper action on seeing token YYTOKEN is to reduce or to
2306 detect an error, take that action. */
2307 yyn += yytoken;
2308 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2309 goto yydefault;
2310 yyn = yytable[yyn];
2311 if (yyn <= 0)
2312 {
2313 if (yyn == 0 || yyn == YYTABLE_NINF)
2314 goto yyerrlab;
2315 yyn = -yyn;
2316 goto yyreduce;
2317 }
2318
2319 /* Count tokens shifted since error; after three, turn off error
2320 status. */
2321 if (yyerrstatus)
2322 yyerrstatus--;
2323
2324 /* Shift the lookahead token. */
2325 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2326
2327 /* Discard the shifted token. */
2328 yychar = YYEMPTY;
2329
2330 yystate = yyn;
2331 *++yyvsp = yylval;
2332
2333 goto yynewstate;
2334
2335
2336/*-----------------------------------------------------------.
2337| yydefault -- do the default action for the current state. |
2338`-----------------------------------------------------------*/
2339yydefault:
2340 yyn = yydefact[yystate];
2341 if (yyn == 0)
2342 goto yyerrlab;
2343 goto yyreduce;
2344
2345
2346/*-----------------------------.
2347| yyreduce -- Do a reduction. |
2348`-----------------------------*/
2349yyreduce:
2350 /* yyn is the number of a rule to reduce with. */
2351 yylen = yyr2[yyn];
2352
2353 /* If YYLEN is nonzero, implement the default value of the action:
2354 `$$ = $1'.
2355
2356 Otherwise, the following line sets YYVAL to garbage.
2357 This behavior is undocumented and Bison
2358 users should not rely upon it. Assigning to YYVAL
2359 unconditionally makes the parser a bit smaller, and it avoids a
2360 GCC warning that YYVAL may be used uninitialized. */
2361 yyval = yyvsp[1-yylen];
2362
2363
2364 YY_REDUCE_PRINT (yyn);
2365 switch (yyn)
2366 {
2367 case 3:
2368
2369/* Line 1464 of yacc.c */
2370#line 321 "grammar.y"
2371 {
2372 if (timerv)
2373 {
2374 writeTime("used time:");
2375 startTimer();
2376 }
2377 if (rtimerv)
2378 {
2379 writeRTime("used real time:");
2380 startRTimer();
2381 }
2382 prompt_char = '>';
2383#ifdef HAVE_SDB
2384 if (sdb_flags & 2) { sdb_flags=1; YYERROR; }
2385#endif
2386 if(siCntrlc)
2387 {
2388 WerrorS("abort...");
2389 while((currentVoice!=NULL) && (currentVoice->prev!=NULL)) exitVoice();
2391 }
2392 if (errorreported) /* also catches abort... */
2393 {
2394 yyerror("");
2395 }
2396 if (inerror==2) PrintLn();
2400 ;}
2401 break;
2402
2403 case 5:
2404
2405/* Line 1464 of yacc.c */
2406#line 356 "grammar.y"
2407 {currentVoice->ifsw=0;;}
2408 break;
2409
2410 case 6:
2411
2412/* Line 1464 of yacc.c */
2413#line 358 "grammar.y"
2414 { (yyvsp[(1) - (2)].lv).CleanUp(); currentVoice->ifsw=0;;}
2415 break;
2416
2417 case 7:
2418
2419/* Line 1464 of yacc.c */
2420#line 360 "grammar.y"
2421 {
2422 YYACCEPT;
2423 ;}
2424 break;
2425
2426 case 8:
2427
2428/* Line 1464 of yacc.c */
2429#line 364 "grammar.y"
2430 {
2431 currentVoice->ifsw=0;
2432 iiDebug();
2433 ;}
2434 break;
2435
2436 case 9:
2437
2438/* Line 1464 of yacc.c */
2439#line 369 "grammar.y"
2440 {currentVoice->ifsw=0;;}
2441 break;
2442
2443 case 10:
2444
2445/* Line 1464 of yacc.c */
2446#line 371 "grammar.y"
2447 {
2448 #ifdef SIQ
2449 siq=0;
2450 #endif
2452 currentVoice->ifsw=0;
2453 if (inerror)
2454 {
2455/* bison failed here*/
2456 if ((inerror!=3) && ((yyvsp[(1) - (2)].i)<UMINUS) && ((yyvsp[(1) - (2)].i)>' '))
2457 {
2458 // 1: yyerror called
2459 // 2: scanner put actual string
2460 // 3: error rule put token+\n
2461 inerror=3;
2462 Print(" error at token `%s`\n",iiTwoOps((yyvsp[(1) - (2)].i)));
2463 }
2464/**/
2465
2466 }
2467 if (!errorreported) WerrorS("...parse error");
2468 yyerror("");
2469 yyerrok;
2470#ifdef HAVE_SDB
2471 if ((sdb_flags & 1) && currentVoice->pi!=NULL)
2472 {
2474 }
2475 else
2476#endif
2477 if (myynest>0)
2478 {
2480 //PrintS("leaving yyparse\n");
2482 if (t==BT_example)
2483 YYACCEPT;
2484 else
2485 YYABORT;
2486 }
2487 else if (currentVoice->prev!=NULL)
2488 {
2489 exitVoice();
2490 }
2491#ifdef HAVE_SDB
2492 if (sdb_flags &2) sdb_flags=1;
2493#endif
2494 ;}
2495 break;
2496
2497 case 18:
2498
2499/* Line 1464 of yacc.c */
2500#line 429 "grammar.y"
2501 {if (currentVoice!=NULL) currentVoice->ifsw=0;;}
2502 break;
2503
2504 case 19:
2505
2506/* Line 1464 of yacc.c */
2507#line 432 "grammar.y"
2508 { omFree((ADDRESS)(yyvsp[(2) - (2)].name)); ;}
2509 break;
2510
2511 case 29:
2512
2513/* Line 1464 of yacc.c */
2514#line 447 "grammar.y"
2515 {
2516 if(iiAssign(&(yyvsp[(1) - (2)].lv),&(yyvsp[(2) - (2)].lv))) YYERROR;
2517 ;}
2518 break;
2519
2520 case 30:
2521
2522/* Line 1464 of yacc.c */
2523#line 454 "grammar.y"
2524 {
2525 if (currRing==NULL) MYYERROR("no ring active (7)");
2526 syMakeMonom(&(yyval.lv),(yyvsp[(1) - (1)].name));
2527 ;}
2528 break;
2529
2530 case 31:
2531
2532/* Line 1464 of yacc.c */
2533#line 459 "grammar.y"
2534 {
2535 syMake(&(yyval.lv),(yyvsp[(1) - (1)].name));
2536 ;}
2537 break;
2538
2539 case 32:
2540
2541/* Line 1464 of yacc.c */
2542#line 463 "grammar.y"
2543 {
2544 if(iiExprArith2(&(yyval.lv), &(yyvsp[(1) - (3)].lv), COLONCOLON, &(yyvsp[(3) - (3)].lv))) YYERROR;
2545 ;}
2546 break;
2547
2548 case 33:
2549
2550/* Line 1464 of yacc.c */
2551#line 467 "grammar.y"
2552 {
2553 if(iiExprArith2(&(yyval.lv), &(yyvsp[(1) - (3)].lv), '.', &(yyvsp[(3) - (3)].lv))) YYERROR;
2554 ;}
2555 break;
2556
2557 case 34:
2558
2559/* Line 1464 of yacc.c */
2560#line 471 "grammar.y"
2561 {
2562 if(iiExprArith1(&(yyval.lv),&(yyvsp[(1) - (3)].lv),'(')) YYERROR;
2563 ;}
2564 break;
2565
2566 case 35:
2567
2568/* Line 1464 of yacc.c */
2569#line 475 "grammar.y"
2570 {
2571 if ((yyvsp[(1) - (4)].lv).next==NULL)
2572 {
2573 (yyvsp[(1) - (4)].lv).next=(leftv)omAllocBin(sleftv_bin);
2574 memcpy((yyvsp[(1) - (4)].lv).next,&(yyvsp[(3) - (4)].lv),sizeof(sleftv));
2575 if(iiExprArithM(&(yyval.lv),&(yyvsp[(1) - (4)].lv),'(')) YYERROR;
2576 }
2577 else if ((yyvsp[(1) - (4)].lv).rtyp==UNKNOWN)
2578 { // for x(i)(j)
2579 if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (4)].lv),'(',&(yyvsp[(3) - (4)].lv))) YYERROR;
2580 }
2581 else YYERROR;
2582 ;}
2583 break;
2584
2585 case 36:
2586
2587/* Line 1464 of yacc.c */
2588#line 489 "grammar.y"
2589 {
2590 if (currRing==NULL) MYYERROR("no ring active (8)");
2591 int j = 0;
2592 memset(&(yyval.lv),0,sizeof(sleftv));
2593 (yyval.lv).rtyp=VECTOR_CMD;
2594 leftv v = &(yyvsp[(2) - (3)].lv);
2595 while (v!=NULL)
2596 {
2597 int i,t;
2598 sleftv tmp;
2599 memset(&tmp,0,sizeof(tmp));
2600 i=iiTestConvert((t=v->Typ()),POLY_CMD);
2601 if((i==0) || (iiConvert(t /*v->Typ()*/,POLY_CMD,i,v,&tmp)))
2602 {
2603 pDelete((poly *)&(yyval.lv).data);
2604 (yyvsp[(2) - (3)].lv).CleanUp();
2605 MYYERROR("expected '[poly,...'");
2606 }
2607 poly p = (poly)tmp.CopyD(POLY_CMD);
2608 pSetCompP(p,++j);
2609 (yyval.lv).data = (void *)pAdd((poly)(yyval.lv).data,p);
2610 v->next=tmp.next;tmp.next=NULL;
2611 tmp.CleanUp();
2612 v=v->next;
2613 }
2614 (yyvsp[(2) - (3)].lv).CleanUp();
2615 ;}
2616 break;
2617
2618 case 37:
2619
2620/* Line 1464 of yacc.c */
2621#line 517 "grammar.y"
2622 {
2623 memset(&(yyval.lv),0,sizeof((yyval.lv)));
2624 int i = atoi((yyvsp[(1) - (1)].name));
2625 /*remember not to omFree($1)
2626 *because it is a part of the scanner buffer*/
2627 (yyval.lv).rtyp = INT_CMD;
2628 (yyval.lv).data = (void *)(long)i;
2629
2630 /* check: out of range input */
2631 int l = strlen((yyvsp[(1) - (1)].name))+2;
2632 number n;
2633 if (l >= MAX_INT_LEN)
2634 {
2635 char tmp[MAX_INT_LEN+5];
2636 sprintf(tmp,"%d",i);
2637 if (strcmp(tmp,(yyvsp[(1) - (1)].name))!=0)
2638 {
2639 n_Read((yyvsp[(1) - (1)].name),&n,coeffs_BIGINT);
2640 (yyval.lv).rtyp=BIGINT_CMD;
2641 (yyval.lv).data = n;
2642 }
2643 }
2644 ;}
2645 break;
2646
2647 case 38:
2648
2649/* Line 1464 of yacc.c */
2650#line 541 "grammar.y"
2651 {
2652 memset(&(yyval.lv),0,sizeof((yyval.lv)));
2653 (yyval.lv).rtyp = (yyvsp[(1) - (1)].i);
2654 (yyval.lv).data = (yyval.lv).Data();
2655 ;}
2656 break;
2657
2658 case 39:
2659
2660/* Line 1464 of yacc.c */
2661#line 547 "grammar.y"
2662 {
2663 memset(&(yyval.lv),0,sizeof((yyval.lv)));
2664 (yyval.lv).rtyp = STRING_CMD;
2665 (yyval.lv).data = (yyvsp[(1) - (1)].name);
2666 ;}
2667 break;
2668
2669 case 40:
2670
2671/* Line 1464 of yacc.c */
2672#line 553 "grammar.y"
2673 {
2674 if(iiExprArith1(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
2675 ;}
2676 break;
2677
2678 case 41:
2679
2680/* Line 1464 of yacc.c */
2681#line 557 "grammar.y"
2682 {
2683 if(iiExprArith1(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
2684 ;}
2685 break;
2686
2687 case 42:
2688
2689/* Line 1464 of yacc.c */
2690#line 561 "grammar.y"
2691 {
2692 if(iiExprArithM(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
2693 ;}
2694 break;
2695
2696 case 43:
2697
2698/* Line 1464 of yacc.c */
2699#line 565 "grammar.y"
2700 {
2701 if(iiExprArithM(&(yyval.lv),NULL,(yyvsp[(1) - (3)].i))) YYERROR;
2702 ;}
2703 break;
2704
2705 case 44:
2706
2707/* Line 1464 of yacc.c */
2708#line 569 "grammar.y"
2709 {
2710 if(iiExprArith1(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
2711 ;}
2712 break;
2713
2714 case 45:
2715
2716/* Line 1464 of yacc.c */
2717#line 573 "grammar.y"
2718 {
2719 if(iiExprArithM(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
2720 ;}
2721 break;
2722
2723 case 46:
2724
2725/* Line 1464 of yacc.c */
2726#line 577 "grammar.y"
2727 {
2728 if(iiExprArithM(&(yyval.lv),NULL,(yyvsp[(1) - (3)].i))) YYERROR;
2729 ;}
2730 break;
2731
2732 case 47:
2733
2734/* Line 1464 of yacc.c */
2735#line 581 "grammar.y"
2736 {
2737 if(iiExprArith1(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
2738 ;}
2739 break;
2740
2741 case 48:
2742
2743/* Line 1464 of yacc.c */
2744#line 585 "grammar.y"
2745 {
2746 if(iiExprArith1(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
2747 ;}
2748 break;
2749
2750 case 49:
2751
2752/* Line 1464 of yacc.c */
2753#line 589 "grammar.y"
2754 {
2755 if(iiExprArith1(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
2756 ;}
2757 break;
2758
2759 case 50:
2760
2761/* Line 1464 of yacc.c */
2762#line 593 "grammar.y"
2763 {
2764 if(iiExprArith1(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
2765 ;}
2766 break;
2767
2768 case 51:
2769
2770/* Line 1464 of yacc.c */
2771#line 597 "grammar.y"
2772 {
2773 if(iiExprArith2(&(yyval.lv),&(yyvsp[(3) - (6)].lv),(yyvsp[(1) - (6)].i),&(yyvsp[(5) - (6)].lv),TRUE)) YYERROR;
2774 ;}
2775 break;
2776
2777 case 52:
2778
2779/* Line 1464 of yacc.c */
2780#line 601 "grammar.y"
2781 {
2782 if(iiExprArith2(&(yyval.lv),&(yyvsp[(3) - (6)].lv),(yyvsp[(1) - (6)].i),&(yyvsp[(5) - (6)].lv),TRUE)) YYERROR;
2783 ;}
2784 break;
2785
2786 case 53:
2787
2788/* Line 1464 of yacc.c */
2789#line 605 "grammar.y"
2790 {
2791 if(iiExprArith2(&(yyval.lv),&(yyvsp[(3) - (6)].lv),(yyvsp[(1) - (6)].i),&(yyvsp[(5) - (6)].lv),TRUE)) YYERROR;
2792 ;}
2793 break;
2794
2795 case 54:
2796
2797/* Line 1464 of yacc.c */
2798#line 609 "grammar.y"
2799 {
2800 if(iiExprArith2(&(yyval.lv),&(yyvsp[(3) - (6)].lv),(yyvsp[(1) - (6)].i),&(yyvsp[(5) - (6)].lv),TRUE)) YYERROR;
2801 ;}
2802 break;
2803
2804 case 55:
2805
2806/* Line 1464 of yacc.c */
2807#line 613 "grammar.y"
2808 {
2809 if(iiExprArith3(&(yyval.lv),(yyvsp[(1) - (8)].i),&(yyvsp[(3) - (8)].lv),&(yyvsp[(5) - (8)].lv),&(yyvsp[(7) - (8)].lv))) YYERROR;
2810 ;}
2811 break;
2812
2813 case 56:
2814
2815/* Line 1464 of yacc.c */
2816#line 617 "grammar.y"
2817 {
2818 if(iiExprArith3(&(yyval.lv),(yyvsp[(1) - (8)].i),&(yyvsp[(3) - (8)].lv),&(yyvsp[(5) - (8)].lv),&(yyvsp[(7) - (8)].lv))) YYERROR;
2819 ;}
2820 break;
2821
2822 case 57:
2823
2824/* Line 1464 of yacc.c */
2825#line 621 "grammar.y"
2826 {
2827 if(iiExprArith3(&(yyval.lv),(yyvsp[(1) - (8)].i),&(yyvsp[(3) - (8)].lv),&(yyvsp[(5) - (8)].lv),&(yyvsp[(7) - (8)].lv))) YYERROR;
2828 ;}
2829 break;
2830
2831 case 58:
2832
2833/* Line 1464 of yacc.c */
2834#line 625 "grammar.y"
2835 {
2836 if(iiExprArith3(&(yyval.lv),(yyvsp[(1) - (8)].i),&(yyvsp[(3) - (8)].lv),&(yyvsp[(5) - (8)].lv),&(yyvsp[(7) - (8)].lv))) YYERROR;
2837 ;}
2838 break;
2839
2840 case 59:
2841
2842/* Line 1464 of yacc.c */
2843#line 629 "grammar.y"
2844 {
2845 if(iiExprArithM(&(yyval.lv),NULL,(yyvsp[(1) - (3)].i))) YYERROR;
2846 ;}
2847 break;
2848
2849 case 60:
2850
2851/* Line 1464 of yacc.c */
2852#line 633 "grammar.y"
2853 {
2854 int b=iiExprArithM(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i)); // handle branchTo
2855 if (b==TRUE) YYERROR;
2856 if (b==2) YYACCEPT;
2857 ;}
2858 break;
2859
2860 case 61:
2861
2862/* Line 1464 of yacc.c */
2863#line 639 "grammar.y"
2864 {
2865 if(iiExprArith3(&(yyval.lv),(yyvsp[(1) - (8)].i),&(yyvsp[(3) - (8)].lv),&(yyvsp[(5) - (8)].lv),&(yyvsp[(7) - (8)].lv))) YYERROR;
2866 ;}
2867 break;
2868
2869 case 62:
2870
2871/* Line 1464 of yacc.c */
2872#line 643 "grammar.y"
2873 {
2874 if(iiExprArith1(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i))) YYERROR;
2875 ;}
2876 break;
2877
2878 case 63:
2879
2880/* Line 1464 of yacc.c */
2881#line 647 "grammar.y"
2882 {
2883 if(iiExprArith3(&(yyval.lv),RING_CMD,&(yyvsp[(3) - (8)].lv),&(yyvsp[(5) - (8)].lv),&(yyvsp[(7) - (8)].lv))) YYERROR;
2884 ;}
2885 break;
2886
2887 case 64:
2888
2889/* Line 1464 of yacc.c */
2890#line 651 "grammar.y"
2891 {
2892 if(iiExprArith1(&(yyval.lv),&(yyvsp[(3) - (4)].lv),RING_CMD)) YYERROR;
2893 ;}
2894 break;
2895
2896 case 65:
2897
2898/* Line 1464 of yacc.c */
2899#line 655 "grammar.y"
2900 {
2901 if (iiARROW(&(yyval.lv),(yyvsp[(1) - (3)].name),(yyvsp[(3) - (3)].name))) YYERROR;
2902 omFree((ADDRESS)(yyvsp[(3) - (3)].name));
2903 ;}
2904 break;
2905
2906 case 66:
2907
2908/* Line 1464 of yacc.c */
2909#line 659 "grammar.y"
2910 { (yyval.lv) = (yyvsp[(2) - (3)].lv); ;}
2911 break;
2912
2913 case 67:
2914
2915/* Line 1464 of yacc.c */
2916#line 664 "grammar.y"
2917 {
2918 leftv v = &(yyvsp[(1) - (3)].lv);
2919 while (v->next!=NULL)
2920 {
2921 v=v->next;
2922 }
2924 memcpy(v->next,&((yyvsp[(3) - (3)].lv)),sizeof(sleftv));
2925 (yyval.lv) = (yyvsp[(1) - (3)].lv);
2926 ;}
2927 break;
2928
2929 case 71:
2930
2931/* Line 1464 of yacc.c */
2932#line 680 "grammar.y"
2933 {
2934 if(iiExprArith3(&(yyval.lv),'[',&(yyvsp[(1) - (6)].lv),&(yyvsp[(3) - (6)].lv),&(yyvsp[(5) - (6)].lv))) YYERROR;
2935 ;}
2936 break;
2937
2938 case 72:
2939
2940/* Line 1464 of yacc.c */
2941#line 684 "grammar.y"
2942 {
2943 if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (4)].lv),'[',&(yyvsp[(3) - (4)].lv))) YYERROR;
2944 ;}
2945 break;
2946
2947 case 73:
2948
2949/* Line 1464 of yacc.c */
2950#line 688 "grammar.y"
2951 {
2952 if (iiApply(&(yyval.lv), &(yyvsp[(3) - (6)].lv), (yyvsp[(5) - (6)].i), NULL)) YYERROR;
2953 ;}
2954 break;
2955
2956 case 74:
2957
2958/* Line 1464 of yacc.c */
2959#line 692 "grammar.y"
2960 {
2961 if (iiApply(&(yyval.lv), &(yyvsp[(3) - (6)].lv), (yyvsp[(5) - (6)].i), NULL)) YYERROR;
2962 ;}
2963 break;
2964
2965 case 75:
2966
2967/* Line 1464 of yacc.c */
2968#line 696 "grammar.y"
2969 {
2970 if (iiApply(&(yyval.lv), &(yyvsp[(3) - (6)].lv), (yyvsp[(5) - (6)].i), NULL)) YYERROR;
2971 ;}
2972 break;
2973
2974 case 76:
2975
2976/* Line 1464 of yacc.c */
2977#line 700 "grammar.y"
2978 {
2979 if (iiApply(&(yyval.lv), &(yyvsp[(3) - (6)].lv), (yyvsp[(5) - (6)].i), NULL)) YYERROR;
2980 ;}
2981 break;
2982
2983 case 77:
2984
2985/* Line 1464 of yacc.c */
2986#line 704 "grammar.y"
2987 {
2988 if (iiApply(&(yyval.lv), &(yyvsp[(3) - (6)].lv), (yyvsp[(5) - (6)].i), NULL)) YYERROR;
2989 ;}
2990 break;
2991
2992 case 78:
2993
2994/* Line 1464 of yacc.c */
2995#line 708 "grammar.y"
2996 {
2997 if (iiApply(&(yyval.lv), &(yyvsp[(3) - (6)].lv), 0, &(yyvsp[(5) - (6)].lv))) YYERROR;
2998 ;}
2999 break;
3000
3001 case 79:
3002
3003/* Line 1464 of yacc.c */
3004#line 712 "grammar.y"
3005 {
3006 (yyval.lv)=(yyvsp[(2) - (3)].lv);
3007 ;}
3008 break;
3009
3010 case 80:
3011
3012/* Line 1464 of yacc.c */
3013#line 716 "grammar.y"
3014 {
3015 #ifdef SIQ
3016 siq++;
3017 if (siq>0)
3018 { if (iiExprArith2(&(yyval.lv),&(yyvsp[(2) - (5)].lv),'=',&(yyvsp[(4) - (5)].lv))) YYERROR; }
3019 else
3020 #endif
3021 {
3022 memset(&(yyval.lv),0,sizeof((yyval.lv)));
3023 (yyval.lv).rtyp=NONE;
3024 if (iiAssign(&(yyvsp[(2) - (5)].lv),&(yyvsp[(4) - (5)].lv))) YYERROR;
3025 }
3026 #ifdef SIQ
3027 siq--;
3028 #endif
3029 ;}
3030 break;
3031
3032 case 81:
3033
3034/* Line 1464 of yacc.c */
3035#line 733 "grammar.y"
3036 {
3037 iiTestAssume(&(yyvsp[(2) - (5)].lv),&(yyvsp[(4) - (5)].lv));
3038 memset(&(yyval.lv),0,sizeof((yyval.lv)));
3039 (yyval.lv).rtyp=NONE;
3040 ;}
3041 break;
3042
3043 case 82:
3044
3045/* Line 1464 of yacc.c */
3046#line 739 "grammar.y"
3047 {
3048 #ifdef SIQ
3049 siq--;
3050 #endif
3051 ;}
3052 break;
3053
3054 case 83:
3055
3056/* Line 1464 of yacc.c */
3057#line 745 "grammar.y"
3058 {
3059 #ifdef SIQ
3060 if (siq<=0) (yyvsp[(4) - (5)].lv).Eval();
3061 #endif
3062 (yyval.lv)=(yyvsp[(4) - (5)].lv);
3063 #ifdef SIQ
3064 siq++;
3065 #endif
3066 ;}
3067 break;
3068
3069 case 84:
3070
3071/* Line 1464 of yacc.c */
3072#line 757 "grammar.y"
3073 {
3074 #ifdef SIQ
3075 siq++;
3076 #endif
3077 ;}
3078 break;
3079
3080 case 85:
3081
3082/* Line 1464 of yacc.c */
3083#line 765 "grammar.y"
3084 {
3085 #ifdef SIQ
3086 siq++;
3087 #endif
3088 ;}
3089 break;
3090
3091 case 86:
3092
3093/* Line 1464 of yacc.c */
3094#line 773 "grammar.y"
3095 {
3096 #ifdef SIQ
3097 siq--;
3098 #endif
3099 ;}
3100 break;
3101
3102 case 87:
3103
3104/* Line 1464 of yacc.c */
3105#line 782 "grammar.y"
3106 {
3107 if(iiExprArith1(&(yyval.lv),&(yyvsp[(1) - (2)].lv),PLUSPLUS)) YYERROR;
3108 ;}
3109 break;
3110
3111 case 88:
3112
3113/* Line 1464 of yacc.c */
3114#line 786 "grammar.y"
3115 {
3116 if(iiExprArith1(&(yyval.lv),&(yyvsp[(1) - (2)].lv),MINUSMINUS)) YYERROR;
3117 ;}
3118 break;
3119
3120 case 89:
3121
3122/* Line 1464 of yacc.c */
3123#line 790 "grammar.y"
3124 {
3125 if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (3)].lv),'+',&(yyvsp[(3) - (3)].lv))) YYERROR;
3126 ;}
3127 break;
3128
3129 case 90:
3130
3131/* Line 1464 of yacc.c */
3132#line 794 "grammar.y"
3133 {
3134 if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (3)].lv),'-',&(yyvsp[(3) - (3)].lv))) YYERROR;
3135 ;}
3136 break;
3137
3138 case 91:
3139
3140/* Line 1464 of yacc.c */
3141#line 798 "grammar.y"
3142 { /* also for *,% */
3143 if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (3)].lv),(yyvsp[(2) - (3)].i),&(yyvsp[(3) - (3)].lv))) YYERROR;
3144 ;}
3145 break;
3146
3147 case 92:
3148
3149/* Line 1464 of yacc.c */
3150#line 802 "grammar.y"
3151 {
3152 if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (3)].lv),'^',&(yyvsp[(3) - (3)].lv))) YYERROR;
3153 ;}
3154 break;
3155
3156 case 93:
3157
3158/* Line 1464 of yacc.c */
3159#line 806 "grammar.y"
3160 { /* also for > */
3161 if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (3)].lv),(yyvsp[(2) - (3)].i),&(yyvsp[(3) - (3)].lv))) YYERROR;
3162 ;}
3163 break;
3164
3165 case 94:
3166
3167/* Line 1464 of yacc.c */
3168#line 810 "grammar.y"
3169 { /* also for |*/
3170 if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (3)].lv),(yyvsp[(2) - (3)].i),&(yyvsp[(3) - (3)].lv))) YYERROR;
3171 ;}
3172 break;
3173
3174 case 95:
3175
3176/* Line 1464 of yacc.c */
3177#line 814 "grammar.y"
3178 {
3179 if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (3)].lv),NOTEQUAL,&(yyvsp[(3) - (3)].lv))) YYERROR;
3180 ;}
3181 break;
3182
3183 case 96:
3184
3185/* Line 1464 of yacc.c */
3186#line 818 "grammar.y"
3187 {
3188 if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (3)].lv),EQUAL_EQUAL,&(yyvsp[(3) - (3)].lv))) YYERROR;
3189 ;}
3190 break;
3191
3192 case 97:
3193
3194/* Line 1464 of yacc.c */
3195#line 822 "grammar.y"
3196 {
3197 if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (3)].lv),DOTDOT,&(yyvsp[(3) - (3)].lv))) YYERROR;
3198 ;}
3199 break;
3200
3201 case 98:
3202
3203/* Line 1464 of yacc.c */
3204#line 826 "grammar.y"
3205 {
3206 if(iiExprArith2(&(yyval.lv),&(yyvsp[(1) - (3)].lv),':',&(yyvsp[(3) - (3)].lv))) YYERROR;
3207 ;}
3208 break;
3209
3210 case 99:
3211
3212/* Line 1464 of yacc.c */
3213#line 830 "grammar.y"
3214 {
3215 if (siq>0)
3216 { if (iiExprArith1(&(yyval.lv),&(yyvsp[(2) - (2)].lv),NOT)) YYERROR; }
3217 else
3218 {
3219 memset(&(yyval.lv),0,sizeof((yyval.lv)));
3220 int i; TESTSETINT((yyvsp[(2) - (2)].lv),i);
3221 (yyval.lv).rtyp = INT_CMD;
3222 (yyval.lv).data = (void *)(long)(i == 0 ? 1 : 0);
3223 }
3224 ;}
3225 break;
3226
3227 case 100:
3228
3229/* Line 1464 of yacc.c */
3230#line 842 "grammar.y"
3231 {
3232 if(iiExprArith1(&(yyval.lv),&(yyvsp[(2) - (2)].lv),'-')) YYERROR;
3233 ;}
3234 break;
3235
3236 case 102:
3237
3238/* Line 1464 of yacc.c */
3239#line 850 "grammar.y"
3240 {
3241 if ((yyvsp[(1) - (2)].lv).rtyp==0)
3242 {
3243 Werror("`%s` is undefined",(yyvsp[(1) - (2)].lv).Fullname());
3244 YYERROR;
3245 }
3246 else if (((yyvsp[(1) - (2)].lv).rtyp==MODUL_CMD)
3247 // matrix m; m[2]=...
3248 && ((yyvsp[(1) - (2)].lv).e!=NULL) && ((yyvsp[(1) - (2)].lv).e->next==NULL))
3249 {
3250 MYYERROR("matrix must have 2 indices");
3251 }
3252 (yyval.lv) = (yyvsp[(1) - (2)].lv);
3253 ;}
3254 break;
3255
3256 case 104:
3257
3258/* Line 1464 of yacc.c */
3259#line 870 "grammar.y"
3260 {
3261 if ((yyvsp[(2) - (3)].lv).Typ()!=STRING_CMD)
3262 {
3263 MYYERROR("string expression expected");
3264 }
3265 (yyval.name) = (char *)(yyvsp[(2) - (3)].lv).CopyD(STRING_CMD);
3266 (yyvsp[(2) - (3)].lv).CleanUp();
3267 ;}
3268 break;
3269
3270 case 105:
3271
3272/* Line 1464 of yacc.c */
3273#line 882 "grammar.y"
3274 {
3275 if (iiDeclCommand(&(yyval.lv),&(yyvsp[(2) - (2)].lv),myynest,(yyvsp[(1) - (2)].i),&((yyvsp[(2) - (2)].lv).req_packhdl->idroot)))
3276 YYERROR;
3277 ;}
3278 break;
3279
3280 case 106:
3281
3282/* Line 1464 of yacc.c */
3283#line 887 "grammar.y"
3284 {
3285 if (iiDeclCommand(&(yyval.lv),&(yyvsp[(2) - (2)].lv),myynest,(yyvsp[(1) - (2)].i),&((yyvsp[(2) - (2)].lv).req_packhdl->idroot)))
3286 YYERROR;
3287 ;}
3288 break;
3289
3290 case 107:
3291
3292/* Line 1464 of yacc.c */
3293#line 892 "grammar.y"
3294 {
3295 if (iiDeclCommand(&(yyval.lv),&(yyvsp[(2) - (2)].lv),myynest,(yyvsp[(1) - (2)].i),&(currRing->idroot), TRUE)) YYERROR;
3296 ;}
3297 break;
3298
3299 case 108:
3300
3301/* Line 1464 of yacc.c */
3302#line 896 "grammar.y"
3303 {
3304 if (iiDeclCommand(&(yyval.lv),&(yyvsp[(2) - (2)].lv),myynest,(yyvsp[(1) - (2)].i),&(currRing->idroot), TRUE)) YYERROR;
3305 ;}
3306 break;
3307
3308 case 109:
3309
3310/* Line 1464 of yacc.c */
3311#line 900 "grammar.y"
3312 {
3313 int r; TESTSETINT((yyvsp[(4) - (8)].lv),r);
3314 int c; TESTSETINT((yyvsp[(7) - (8)].lv),c);
3315 leftv v;
3316 idhdl h;
3317 if (((yyvsp[(1) - (8)].i) == MATRIX_CMD) || ((yyvsp[(1) - (8)].i) == SMATRIX_CMD ))
3318 {
3319 if (iiDeclCommand(&(yyval.lv),&(yyvsp[(2) - (8)].lv),myynest,(yyvsp[(1) - (8)].i),&(currRing->idroot), TRUE)) YYERROR;
3320 v=&(yyval.lv);
3321 h=(idhdl)v->data;
3322 idDelete(&IDIDEAL(h));
3323 if ((yyvsp[(1) - (8)].i) == MATRIX_CMD)
3324 IDMATRIX(h) = mpNew(r,c);
3325 else
3326 IDIDEAL(h) = idInit(c,r);
3327 if (IDMATRIX(h)==NULL) YYERROR;
3328 }
3329 else if (((yyvsp[(1) - (8)].i) == INTMAT_CMD)||((yyvsp[(1) - (8)].i) == BIGINTMAT_CMD))
3330 {
3331 if (iiDeclCommand(&(yyval.lv),&(yyvsp[(2) - (8)].lv),myynest,(yyvsp[(1) - (8)].i),&((yyvsp[(2) - (8)].lv).req_packhdl->idroot)))
3332 YYERROR;
3333 v=&(yyval.lv);
3334 h=(idhdl)v->data;
3335 if ((yyvsp[(1) - (8)].i)==INTMAT_CMD)
3336 {
3337 delete IDINTVEC(h);
3338 IDINTVEC(h) = new intvec(r,c,0);
3339 }
3340 else
3341 {
3342 delete IDBIMAT(h);
3343 IDBIMAT(h) = new bigintmat(r, c, coeffs_BIGINT);
3344 }
3345 if (IDINTVEC(h)==NULL) YYERROR;
3346 }
3347 ;}
3348 break;
3349
3350 case 110:
3351
3352/* Line 1464 of yacc.c */
3353#line 937 "grammar.y"
3354 {
3355 if (((yyvsp[(1) - (2)].i) == MATRIX_CMD)||((yyvsp[(1) - (2)].i) == SMATRIX_CMD))
3356 {
3357 if (iiDeclCommand(&(yyval.lv),&(yyvsp[(2) - (2)].lv),myynest,(yyvsp[(1) - (2)].i),&(currRing->idroot), TRUE)) YYERROR;
3358 }
3359 else if (((yyvsp[(1) - (2)].i) == INTMAT_CMD)||((yyvsp[(1) - (2)].i) == BIGINTMAT_CMD))
3360 {
3361 if (iiDeclCommand(&(yyval.lv),&(yyvsp[(2) - (2)].lv),myynest,(yyvsp[(1) - (2)].i),&((yyvsp[(2) - (2)].lv).req_packhdl->idroot)))
3362 YYERROR;
3363 if ((yyvsp[(1) - (2)].i) == INTMAT_CMD)
3364 {
3365 leftv v=&(yyval.lv);
3366 idhdl h;
3367 do
3368 {
3369 h=(idhdl)v->data;
3370 delete IDINTVEC(h);
3371 IDINTVEC(h) = new intvec(1,1,0);
3372 v=v->next;
3373 } while (v!=NULL);
3374 }
3375 }
3376 ;}
3377 break;
3378
3379 case 111:
3380
3381/* Line 1464 of yacc.c */
3382#line 961 "grammar.y"
3383 {
3384 int t=(yyvsp[(1) - (3)].lv).Typ();
3385 sleftv r;
3386 memset(&r,0,sizeof(sleftv));
3387 if ((BEGIN_RING<t) && (t<END_RING))
3388 {
3389 if (iiDeclCommand(&r,&(yyvsp[(3) - (3)].lv),myynest,t,&(currRing->idroot), TRUE))
3390 YYERROR;
3391 }
3392 else
3393 {
3394 if (iiDeclCommand(&r,&(yyvsp[(3) - (3)].lv),myynest,t,&((yyvsp[(3) - (3)].lv).req_packhdl->idroot)))
3395 YYERROR;
3396 }
3397 leftv v=&(yyvsp[(1) - (3)].lv);
3398 while (v->next!=NULL) v=v->next;
3400 memcpy(v->next,&r,sizeof(sleftv));
3401 (yyval.lv)=(yyvsp[(1) - (3)].lv);
3402 ;}
3403 break;
3404
3405 case 112:
3406
3407/* Line 1464 of yacc.c */
3408#line 982 "grammar.y"
3409 {
3410 if (iiDeclCommand(&(yyval.lv),&(yyvsp[(2) - (2)].lv),myynest,(yyvsp[(1) - (2)].i),&((yyvsp[(2) - (2)].lv).req_packhdl->idroot)))
3411 YYERROR;
3412 ;}
3413 break;
3414
3415 case 115:
3416
3417/* Line 1464 of yacc.c */
3418#line 995 "grammar.y"
3419 {
3420 leftv v = &(yyvsp[(2) - (5)].lv);
3421 while (v->next!=NULL)
3422 {
3423 v=v->next;
3424 }
3426 memcpy(v->next,&((yyvsp[(4) - (5)].lv)),sizeof(sleftv));
3427 (yyval.lv) = (yyvsp[(2) - (5)].lv);
3428 ;}
3429 break;
3430
3431 case 116:
3432
3433/* Line 1464 of yacc.c */
3434#line 1009 "grammar.y"
3435 {
3436 // let rInit take care of any errors
3437 (yyval.i)=rOrderName((yyvsp[(1) - (1)].name));
3438 ;}
3439 break;
3440
3441 case 117:
3442
3443/* Line 1464 of yacc.c */
3444#line 1017 "grammar.y"
3445 {
3446 memset(&(yyval.lv),0,sizeof((yyval.lv)));
3447 intvec *iv = new intvec(2);
3448 (*iv)[0] = 1;
3449 (*iv)[1] = (yyvsp[(1) - (1)].i);
3450 (yyval.lv).rtyp = INTVEC_CMD;
3451 (yyval.lv).data = (void *)iv;
3452 ;}
3453 break;
3454
3455 case 118:
3456
3457/* Line 1464 of yacc.c */
3458#line 1026 "grammar.y"
3459 {
3460 memset(&(yyval.lv),0,sizeof((yyval.lv)));
3461 leftv sl = &(yyvsp[(3) - (4)].lv);
3462 int slLength;
3463 {
3464 slLength = exprlist_length(sl);
3465 int l = 2 + slLength;
3466 intvec *iv = new intvec(l);
3467 (*iv)[0] = slLength;
3468 (*iv)[1] = (yyvsp[(1) - (4)].i);
3469
3470 int i = 2;
3471 while ((i<l) && (sl!=NULL))
3472 {
3473 if (sl->Typ() == INT_CMD)
3474 {
3475 (*iv)[i++] = (int)((long)(sl->Data()));
3476 }
3477 else if ((sl->Typ() == INTVEC_CMD)
3478 ||(sl->Typ() == INTMAT_CMD))
3479 {
3480 intvec *ivv = (intvec *)(sl->Data());
3481 int ll = 0,l = ivv->length();
3482 for (; l>0; l--)
3483 {
3484 (*iv)[i++] = (*ivv)[ll++];
3485 }
3486 }
3487 else
3488 {
3489 delete iv;
3490 (yyvsp[(3) - (4)].lv).CleanUp();
3491 MYYERROR("wrong type in ordering");
3492 }
3493 sl = sl->next;
3494 }
3495 (yyval.lv).rtyp = INTVEC_CMD;
3496 (yyval.lv).data = (void *)iv;
3497 }
3498 (yyvsp[(3) - (4)].lv).CleanUp();
3499 ;}
3500 break;
3501
3502 case 120:
3503
3504/* Line 1464 of yacc.c */
3505#line 1072 "grammar.y"
3506 {
3507 (yyval.lv) = (yyvsp[(1) - (3)].lv);
3508 (yyval.lv).next = (sleftv *)omAllocBin(sleftv_bin);
3509 memcpy((yyval.lv).next,&(yyvsp[(3) - (3)].lv),sizeof(sleftv));
3510 ;}
3511 break;
3512
3513 case 122:
3514
3515/* Line 1464 of yacc.c */
3516#line 1082 "grammar.y"
3517 {
3518 (yyval.lv) = (yyvsp[(2) - (3)].lv);
3519 ;}
3520 break;
3521
3522 case 123:
3523
3524/* Line 1464 of yacc.c */
3525#line 1088 "grammar.y"
3526 {
3528 ;}
3529 break;
3530
3531 case 128:
3532
3533/* Line 1464 of yacc.c */
3534#line 1106 "grammar.y"
3535 { newFile((yyvsp[(2) - (2)].name)); omFree((yyvsp[(2) - (2)].name)); ;}
3536 break;
3537
3538 case 129:
3539
3540/* Line 1464 of yacc.c */
3541#line 1111 "grammar.y"
3542 {
3543 feHelp((yyvsp[(2) - (3)].name));
3544 omFree((ADDRESS)(yyvsp[(2) - (3)].name));
3545 ;}
3546 break;
3547
3548 case 130:
3549
3550/* Line 1464 of yacc.c */
3551#line 1116 "grammar.y"
3552 {
3553 feHelp(NULL);
3554 ;}
3555 break;
3556
3557 case 131:
3558
3559/* Line 1464 of yacc.c */
3560#line 1123 "grammar.y"
3561 {
3562 singular_example((yyvsp[(2) - (3)].name));
3563 omFree((ADDRESS)(yyvsp[(2) - (3)].name));
3564 ;}
3565 break;
3566
3567 case 132:
3568
3569/* Line 1464 of yacc.c */
3570#line 1131 "grammar.y"
3571 {
3572 if (basePack!=(yyvsp[(2) - (2)].lv).req_packhdl)
3573 {
3574 if(iiExport(&(yyvsp[(2) - (2)].lv),0,currPack)) YYERROR;
3575 }
3576 else
3577 if (iiExport(&(yyvsp[(2) - (2)].lv),0)) YYERROR;
3578 ;}
3579 break;
3580
3581 case 133:
3582
3583/* Line 1464 of yacc.c */
3584#line 1143 "grammar.y"
3585 {
3586 leftv v=&(yyvsp[(2) - (2)].lv);
3587 if (v->rtyp!=IDHDL)
3588 {
3589 if (v->name!=NULL)
3590 {
3591 Werror("`%s` is undefined in kill",v->name);
3592 omFree((ADDRESS)v->name); v->name=NULL;
3593 }
3594 else WerrorS("kill what ?");
3595 }
3596 else
3597 {
3598 killhdl((idhdl)v->data,v->req_packhdl);
3599 }
3600 ;}
3601 break;
3602
3603 case 134:
3604
3605/* Line 1464 of yacc.c */
3606#line 1160 "grammar.y"
3607 {
3608 leftv v=&(yyvsp[(3) - (3)].lv);
3609 if (v->rtyp!=IDHDL)
3610 {
3611 if (v->name!=NULL)
3612 {
3613 Werror("`%s` is undefined in kill",v->name);
3614 omFree((ADDRESS)v->name); v->name=NULL;
3615 }
3616 else WerrorS("kill what ?");
3617 }
3618 else
3619 {
3620 killhdl((idhdl)v->data,v->req_packhdl);
3621 }
3622 ;}
3623 break;
3624
3625 case 135:
3626
3627/* Line 1464 of yacc.c */
3628#line 1180 "grammar.y"
3629 {
3630 list_cmd((yyvsp[(3) - (4)].i),NULL,"// ",TRUE);
3631 ;}
3632 break;
3633
3634 case 136:
3635
3636/* Line 1464 of yacc.c */
3637#line 1184 "grammar.y"
3638 {
3639 list_cmd((yyvsp[(3) - (4)].i),NULL,"// ",TRUE);
3640 ;}
3641 break;
3642
3643 case 137:
3644
3645/* Line 1464 of yacc.c */
3646#line 1188 "grammar.y"
3647 {
3648 if ((yyvsp[(3) - (4)].i)==QRING_CMD) (yyvsp[(3) - (4)].i)=RING_CMD;
3649 list_cmd((yyvsp[(3) - (4)].i),NULL,"// ",TRUE);
3650 ;}
3651 break;
3652
3653 case 138:
3654
3655/* Line 1464 of yacc.c */
3656#line 1193 "grammar.y"
3657 {
3658 list_cmd((yyvsp[(3) - (4)].i),NULL,"// ",TRUE);
3659 ;}
3660 break;
3661
3662 case 139:
3663
3664/* Line 1464 of yacc.c */
3665#line 1197 "grammar.y"
3666 {
3667 list_cmd(RING_CMD,NULL,"// ",TRUE);
3668 ;}
3669 break;
3670
3671 case 140:
3672
3673/* Line 1464 of yacc.c */
3674#line 1201 "grammar.y"
3675 {
3676 list_cmd((yyvsp[(3) - (4)].i),NULL,"// ",TRUE);
3677 ;}
3678 break;
3679
3680 case 141:
3681
3682/* Line 1464 of yacc.c */
3683#line 1205 "grammar.y"
3684 {
3685 list_cmd(PROC_CMD,NULL,"// ",TRUE);
3686 ;}
3687 break;
3688
3689 case 142:
3690
3691/* Line 1464 of yacc.c */
3692#line 1209 "grammar.y"
3693 {
3694 list_cmd(0,(yyvsp[(3) - (4)].lv).Fullname(),"// ",TRUE);
3695 (yyvsp[(3) - (4)].lv).CleanUp();
3696 ;}
3697 break;
3698
3699 case 143:
3700
3701/* Line 1464 of yacc.c */
3702#line 1214 "grammar.y"
3703 {
3704 if((yyvsp[(3) - (6)].lv).Typ() == PACKAGE_CMD)
3705 list_cmd((yyvsp[(5) - (6)].i),NULL,"// ",TRUE);
3706 (yyvsp[(3) - (6)].lv).CleanUp();
3707 ;}
3708 break;
3709
3710 case 144:
3711
3712/* Line 1464 of yacc.c */
3713#line 1220 "grammar.y"
3714 {
3715 if((yyvsp[(3) - (6)].lv).Typ() == PACKAGE_CMD)
3716 list_cmd((yyvsp[(5) - (6)].i),NULL,"// ",TRUE);
3717 (yyvsp[(3) - (6)].lv).CleanUp();
3718 ;}
3719 break;
3720
3721 case 145:
3722
3723/* Line 1464 of yacc.c */
3724#line 1226 "grammar.y"
3725 {
3726 if((yyvsp[(3) - (6)].lv).Typ() == PACKAGE_CMD)
3727 list_cmd((yyvsp[(5) - (6)].i),NULL,"// ",TRUE);
3728 (yyvsp[(3) - (6)].lv).CleanUp();
3729 ;}
3730 break;
3731
3732 case 146:
3733
3734/* Line 1464 of yacc.c */
3735#line 1232 "grammar.y"
3736 {
3737 if((yyvsp[(3) - (6)].lv).Typ() == PACKAGE_CMD)
3738 list_cmd((yyvsp[(5) - (6)].i),NULL,"// ",TRUE);
3739 (yyvsp[(3) - (6)].lv).CleanUp();
3740 ;}
3741 break;
3742
3743 case 147:
3744
3745/* Line 1464 of yacc.c */
3746#line 1238 "grammar.y"
3747 {
3748 if((yyvsp[(3) - (6)].lv).Typ() == PACKAGE_CMD)
3749 list_cmd((yyvsp[(5) - (6)].i),NULL,"// ",TRUE);
3750 (yyvsp[(3) - (6)].lv).CleanUp();
3751 ;}
3752 break;
3753
3754 case 148:
3755
3756/* Line 1464 of yacc.c */
3757#line 1244 "grammar.y"
3758 {
3759 if((yyvsp[(3) - (6)].lv).Typ() == PACKAGE_CMD)
3760 list_cmd((yyvsp[(5) - (6)].i),NULL,"// ",TRUE);
3761 (yyvsp[(3) - (6)].lv).CleanUp();
3762 ;}
3763 break;
3764
3765 case 149:
3766
3767/* Line 1464 of yacc.c */
3768#line 1250 "grammar.y"
3769 {
3770 if((yyvsp[(3) - (6)].lv).Typ() == PACKAGE_CMD)
3771 list_cmd((yyvsp[(5) - (6)].i),NULL,"// ",TRUE);
3772 (yyvsp[(3) - (6)].lv).CleanUp();
3773 ;}
3774 break;
3775
3776 case 150:
3777
3778/* Line 1464 of yacc.c */
3779#line 1262 "grammar.y"
3780 {
3781 list_cmd(-1,NULL,"// ",TRUE);
3782 ;}
3783 break;
3784
3785 case 151:
3786
3787/* Line 1464 of yacc.c */
3788#line 1268 "grammar.y"
3790 break;
3791
3792 case 152:
3793
3794/* Line 1464 of yacc.c */
3795#line 1277 "grammar.y"
3796 {
3797 const char *ring_name = (yyvsp[(2) - (8)].lv).name;
3798 ring b=
3799 rInit(&(yyvsp[(4) - (8)].lv), /* characteristik and list of parameters*/
3800 &(yyvsp[(6) - (8)].lv), /* names of ringvariables */
3801 &(yyvsp[(8) - (8)].lv)); /* ordering */
3802 idhdl newRingHdl=NULL;
3803
3804 if (b!=NULL)
3805 {
3806 newRingHdl=enterid(ring_name, myynest, RING_CMD,
3807 &((yyvsp[(2) - (8)].lv).req_packhdl->idroot),FALSE);
3808 (yyvsp[(2) - (8)].lv).CleanUp();
3809 if (newRingHdl!=NULL)
3810 {
3811 IDRING(newRingHdl)=b;
3812 }
3813 else
3814 {
3815 rKill(b);
3816 }
3817 }
3819 if (newRingHdl==NULL)
3820 {
3821 MYYERROR("cannot make ring");
3822 }
3823 else
3824 {
3825 rSetHdl(newRingHdl);
3826 }
3827 ;}
3828 break;
3829
3830 case 153:
3831
3832/* Line 1464 of yacc.c */
3833#line 1310 "grammar.y"
3834 {
3835 const char *ring_name = (yyvsp[(2) - (2)].lv).name;
3836 if (!inerror) rDefault(ring_name);
3838 (yyvsp[(2) - (2)].lv).CleanUp();
3839 ;}
3840 break;
3841
3842 case 154:
3843
3844/* Line 1464 of yacc.c */
3845#line 1317 "grammar.y"
3846 {
3848 if (iiAssignCR(&(yyvsp[(2) - (4)].lv),&(yyvsp[(4) - (4)].lv))) YYERROR;
3849 ;}
3850 break;
3851
3852 case 155:
3853
3854/* Line 1464 of yacc.c */
3855#line 1322 "grammar.y"
3856 {
3858 sleftv tmp;
3859 (yyvsp[(4) - (7)].lv).next=(leftv)omAlloc(sizeof(sleftv));
3860 memcpy((yyvsp[(4) - (7)].lv).next,&(yyvsp[(6) - (7)].lv),sizeof(sleftv));
3861 memset(&(yyvsp[(6) - (7)].lv),0,sizeof(sleftv));
3862 if (iiExprArithM(&tmp,&(yyvsp[(4) - (7)].lv),'[')) YYERROR;
3863 if (iiAssignCR(&(yyvsp[(2) - (7)].lv),&tmp)) YYERROR;
3864 ;}
3865 break;
3866
3867 case 156:
3868
3869/* Line 1464 of yacc.c */
3870#line 1335 "grammar.y"
3871 {
3872 if (((yyvsp[(1) - (2)].i)!=LIB_CMD)||(jjLOAD((yyvsp[(2) - (2)].name),TRUE))) YYERROR;
3873 omFree((yyvsp[(2) - (2)].name));
3874 ;}
3875 break;
3876
3877 case 159:
3878
3879/* Line 1464 of yacc.c */
3880#line 1345 "grammar.y"
3881 {
3882 if (((yyvsp[(1) - (2)].i)==KEEPRING_CMD) && (myynest==0))
3883 MYYERROR("only inside a proc allowed");
3884 const char * n=(yyvsp[(2) - (2)].lv).Name();
3885 if (((yyvsp[(2) - (2)].lv).Typ()==RING_CMD)
3886 && ((yyvsp[(2) - (2)].lv).rtyp==IDHDL))
3887 {
3888 idhdl h=(idhdl)(yyvsp[(2) - (2)].lv).data;
3889 if ((yyvsp[(2) - (2)].lv).e!=NULL) h=rFindHdl((ring)(yyvsp[(2) - (2)].lv).Data(),NULL);
3890 //Print("setring %s lev %d (ptr:%x)\n",IDID(h),IDLEV(h),IDRING(h));
3891 if ((yyvsp[(1) - (2)].i)==KEEPRING_CMD)
3892 {
3893 if (h!=NULL)
3894 {
3895 if (IDLEV(h)!=0)
3896 {
3897 if (iiExport(&(yyvsp[(2) - (2)].lv),myynest-1)) YYERROR;
3898#if 1
3899 idhdl p=IDRING(h)->idroot;
3900 idhdl root=p;
3901 int prevlev=myynest-1;
3902 while (p!=NULL)
3903 {
3904 if (IDLEV(p)==myynest)
3905 {
3906 idhdl old=root->get(IDID(p),prevlev);
3907 if (old!=NULL)
3908 {
3909 if (BVERBOSE(V_REDEFINE))
3910 Warn("redefining %s",IDID(p));
3911 killhdl2(old,&root,IDRING(h));
3912 IDRING(h)->idroot=root;
3913 }
3914 IDLEV(p)=prevlev;
3915 }
3916 p=IDNEXT(p);
3917 }
3918#endif
3919 }
3921 }
3922 else
3923 {
3924 Werror("%s is no identifier",n);
3925 (yyvsp[(2) - (2)].lv).CleanUp();
3926 YYERROR;
3927 }
3928 }
3929 if (h!=NULL) rSetHdl(h);
3930 else
3931 {
3932 Werror("cannot find the name of the basering %s",n);
3933 (yyvsp[(2) - (2)].lv).CleanUp();
3934 YYERROR;
3935 }
3936 (yyvsp[(2) - (2)].lv).CleanUp();
3937 }
3938 else
3939 {
3940 Werror("%s is no name of a ring/qring",n);
3941 (yyvsp[(2) - (2)].lv).CleanUp();
3942 YYERROR;
3943 }
3944 ;}
3945 break;
3946
3947 case 160:
3948
3949/* Line 1464 of yacc.c */
3950#line 1413 "grammar.y"
3951 {
3952 type_cmd(&((yyvsp[(2) - (2)].lv)));
3953 ;}
3954 break;
3955
3956 case 161:
3957
3958/* Line 1464 of yacc.c */
3959#line 1417 "grammar.y"
3960 {
3961 //Print("typ is %d, rtyp:%d\n",$1.Typ(),$1.rtyp);
3962 #ifdef SIQ
3963 if ((yyvsp[(1) - (1)].lv).rtyp!=COMMAND)
3964 {
3965 #endif
3966 if ((yyvsp[(1) - (1)].lv).Typ()==UNKNOWN)
3967 {
3968 if ((yyvsp[(1) - (1)].lv).name!=NULL)
3969 {
3970 Werror("`%s` is undefined",(yyvsp[(1) - (1)].lv).name);
3971 omFree((ADDRESS)(yyvsp[(1) - (1)].lv).name);
3972 }
3973 YYERROR;
3974 }
3975 #ifdef SIQ
3976 }
3977 #endif
3978 (yyvsp[(1) - (1)].lv).Print(&sLastPrinted);
3979 (yyvsp[(1) - (1)].lv).CleanUp(currRing);
3981 ;}
3982 break;
3983
3984 case 162:
3985
3986/* Line 1464 of yacc.c */
3987#line 1446 "grammar.y"
3988 {
3989 int i; TESTSETINT((yyvsp[(3) - (5)].lv),i);
3990 if (i!=0)
3991 {
3992 newBuffer( (yyvsp[(5) - (5)].name), BT_if);
3993 }
3994 else
3995 {
3996 omFree((ADDRESS)(yyvsp[(5) - (5)].name));
3997 currentVoice->ifsw=1;
3998 }
3999 ;}
4000 break;
4001
4002 case 163:
4003
4004/* Line 1464 of yacc.c */
4005#line 1459 "grammar.y"
4006 {
4007 if (currentVoice->ifsw==1)
4008 {
4009 currentVoice->ifsw=0;
4010 newBuffer( (yyvsp[(2) - (2)].name), BT_else);
4011 }
4012 else
4013 {
4014 if (currentVoice->ifsw!=2)
4015 {
4016 Warn("`else` without `if` in level %d",myynest);
4017 }
4018 omFree((ADDRESS)(yyvsp[(2) - (2)].name));
4019 }
4020 currentVoice->ifsw=0;
4021 ;}
4022 break;
4023
4024 case 164:
4025
4026/* Line 1464 of yacc.c */
4027#line 1476 "grammar.y"
4028 {
4029 int i; TESTSETINT((yyvsp[(3) - (5)].lv),i);
4030 if (i)
4031 {
4033 }
4034 currentVoice->ifsw=0;
4035 ;}
4036 break;
4037
4038 case 165:
4039
4040/* Line 1464 of yacc.c */
4041#line 1485 "grammar.y"
4042 {
4044 currentVoice->ifsw=0;
4045 ;}
4046 break;
4047
4048 case 166:
4049
4050/* Line 1464 of yacc.c */
4051#line 1490 "grammar.y"
4052 {
4054 currentVoice->ifsw=0;
4055 ;}
4056 break;
4057
4058 case 167:
4059
4060/* Line 1464 of yacc.c */
4061#line 1498 "grammar.y"
4062 {
4063 /* -> if(!$2) break; $3; continue;*/
4064 char * s = (char *)omAlloc( strlen((yyvsp[(2) - (3)].name)) + strlen((yyvsp[(3) - (3)].name)) + 36);
4065 sprintf(s,"whileif (!(%s)) break;\n%scontinue;\n " ,(yyvsp[(2) - (3)].name),(yyvsp[(3) - (3)].name));
4067 omFree((ADDRESS)(yyvsp[(2) - (3)].name));
4068 omFree((ADDRESS)(yyvsp[(3) - (3)].name));
4069 ;}
4070 break;
4071
4072 case 168:
4073
4074/* Line 1464 of yacc.c */
4075#line 1510 "grammar.y"
4076 {
4077 /* $2 */
4078 /* if (!$3) break; $5; $4; continue; */
4079 char * s = (char *)omAlloc( strlen((yyvsp[(3) - (5)].name))+strlen((yyvsp[(4) - (5)].name))+strlen((yyvsp[(5) - (5)].name))+36);
4080 sprintf(s,"forif (!(%s)) break;\n%s%s;\ncontinue;\n "
4081 ,(yyvsp[(3) - (5)].name),(yyvsp[(5) - (5)].name),(yyvsp[(4) - (5)].name));
4082 omFree((ADDRESS)(yyvsp[(3) - (5)].name));
4083 omFree((ADDRESS)(yyvsp[(4) - (5)].name));
4084 omFree((ADDRESS)(yyvsp[(5) - (5)].name));
4086 s = (char *)omAlloc( strlen((yyvsp[(2) - (5)].name)) + 3);
4087 sprintf(s,"%s;\n",(yyvsp[(2) - (5)].name));
4088 omFree((ADDRESS)(yyvsp[(2) - (5)].name));
4089 newBuffer(s,BT_if);
4090 ;}
4091 break;
4092
4093 case 169:
4094
4095/* Line 1464 of yacc.c */
4096#line 1529 "grammar.y"
4097 {
4098 idhdl h = enterid((yyvsp[(2) - (3)].name),myynest,PROC_CMD,&IDROOT,TRUE);
4099 if (h==NULL) {omFree((ADDRESS)(yyvsp[(2) - (3)].name));omFree((ADDRESS)(yyvsp[(3) - (3)].name)); YYERROR;}
4100 iiInitSingularProcinfo(IDPROC(h),"", (yyvsp[(2) - (3)].name), 0, 0);
4101 IDPROC(h)->data.s.body = (char *)omAlloc(strlen((yyvsp[(3) - (3)].name))+31);;
4102 sprintf(IDPROC(h)->data.s.body,"parameter list #;\n%s;return();\n\n",(yyvsp[(3) - (3)].name));
4103 omFree((ADDRESS)(yyvsp[(3) - (3)].name));
4104 omFree((ADDRESS)(yyvsp[(2) - (3)].name));
4105 ;}
4106 break;
4107
4108 case 170:
4109
4110/* Line 1464 of yacc.c */
4111#line 1539 "grammar.y"
4112 {
4113 idhdl h = enterid((yyvsp[(1) - (3)].name),myynest,PROC_CMD,&IDROOT,TRUE);
4114 if (h==NULL)
4115 {
4116 omFree((ADDRESS)(yyvsp[(1) - (3)].name));
4117 omFree((ADDRESS)(yyvsp[(2) - (3)].name));
4118 omFree((ADDRESS)(yyvsp[(3) - (3)].name));
4119 YYERROR;
4120 }
4121 char *args=iiProcArgs((yyvsp[(2) - (3)].name),FALSE);
4122 omFree((ADDRESS)(yyvsp[(2) - (3)].name));
4123 iiInitSingularProcinfo(IDPROC(h),"", (yyvsp[(1) - (3)].name), 0, 0);
4124 IDPROC(h)->data.s.body = (char *)omAlloc(strlen((yyvsp[(3) - (3)].name))+strlen(args)+14);;
4125 sprintf(IDPROC(h)->data.s.body,"%s\n%s;return();\n\n",args,(yyvsp[(3) - (3)].name));
4126 omFree((ADDRESS)args);
4127 omFree((ADDRESS)(yyvsp[(3) - (3)].name));
4128 omFree((ADDRESS)(yyvsp[(1) - (3)].name));
4129 ;}
4130 break;
4131
4132 case 171:
4133
4134/* Line 1464 of yacc.c */
4135#line 1558 "grammar.y"
4136 {
4137 omFree((ADDRESS)(yyvsp[(3) - (4)].name));
4138 idhdl h = enterid((yyvsp[(1) - (4)].name),myynest,PROC_CMD,&IDROOT,TRUE);
4139 if (h==NULL)
4140 {
4141 omFree((ADDRESS)(yyvsp[(1) - (4)].name));
4142 omFree((ADDRESS)(yyvsp[(2) - (4)].name));
4143 omFree((ADDRESS)(yyvsp[(4) - (4)].name));
4144 YYERROR;
4145 }
4146 char *args=iiProcArgs((yyvsp[(2) - (4)].name),FALSE);
4147 omFree((ADDRESS)(yyvsp[(2) - (4)].name));
4148 iiInitSingularProcinfo(IDPROC(h),"", (yyvsp[(1) - (4)].name), 0, 0);
4149 omFree((ADDRESS)(yyvsp[(1) - (4)].name));
4150 IDPROC(h)->data.s.body = (char *)omAlloc(strlen((yyvsp[(4) - (4)].name))+strlen(args)+14);;
4151 sprintf(IDPROC(h)->data.s.body,"%s\n%s;return();\n\n",args,(yyvsp[(4) - (4)].name));
4152 omFree((ADDRESS)args);
4153 omFree((ADDRESS)(yyvsp[(4) - (4)].name));
4154 ;}
4155 break;
4156
4157 case 172:
4158
4159/* Line 1464 of yacc.c */
4160#line 1581 "grammar.y"
4161 {
4162 // decl. of type proc p(int i)
4163 if ((yyvsp[(1) - (2)].i)==PARAMETER) { if (iiParameter(&(yyvsp[(2) - (2)].lv))) YYERROR; }
4164 else { if (iiAlias(&(yyvsp[(2) - (2)].lv))) YYERROR; }
4165 ;}
4166 break;
4167
4168 case 173:
4169
4170/* Line 1464 of yacc.c */
4171#line 1587 "grammar.y"
4172 {
4173 // decl. of type proc p(i)
4174 sleftv tmp_expr;
4175 if ((yyvsp[(1) - (2)].i)==ALIAS_CMD) MYYERROR("alias requires a type");
4176 if ((iiDeclCommand(&tmp_expr,&(yyvsp[(2) - (2)].lv),myynest,DEF_CMD,&IDROOT))
4177 || (iiParameter(&tmp_expr)))
4178 YYERROR;
4179 ;}
4180 break;
4181
4182 case 174:
4183
4184/* Line 1464 of yacc.c */
4185#line 1599 "grammar.y"
4186 {
4187 iiSetReturn(&(yyvsp[(3) - (4)].lv));
4188 (yyvsp[(3) - (4)].lv).CleanUp();
4190 ;}
4191 break;
4192
4193 case 175:
4194
4195/* Line 1464 of yacc.c */
4196#line 1605 "grammar.y"
4197 {
4198 if ((yyvsp[(1) - (3)].i)==RETURN)
4199 {
4203 }
4204 ;}
4205 break;
4206
4207
4208
4209/* Line 1464 of yacc.c */
4210#line 4211 "grammar.cc"
4211 default: break;
4212 }
4213 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4214
4215 YYPOPSTACK (yylen);
4216 yylen = 0;
4217 YY_STACK_PRINT (yyss, yyssp);
4218
4219 *++yyvsp = yyval;
4220
4221 /* Now `shift' the result of the reduction. Determine what state
4222 that goes to, based on the state we popped back to and the rule
4223 number reduced by. */
4224
4225 yyn = yyr1[yyn];
4226
4227 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4228 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4229 yystate = yytable[yystate];
4230 else
4231 yystate = yydefgoto[yyn - YYNTOKENS];
4232
4233 goto yynewstate;
4234
4235
4236/*------------------------------------.
4237| yyerrlab -- here on detecting error |
4238`------------------------------------*/
4239yyerrlab:
4240 /* If not already recovering from an error, report this error. */
4241 if (!yyerrstatus)
4242 {
4243 ++yynerrs;
4244#if ! YYERROR_VERBOSE
4245 yyerror (YY_("syntax error"));
4246#else
4247 {
4248 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
4249 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
4250 {
4251 YYSIZE_T yyalloc = 2 * yysize;
4252 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
4253 yyalloc = YYSTACK_ALLOC_MAXIMUM;
4254 if (yymsg != yymsgbuf)
4255 YYSTACK_FREE (yymsg);
4256 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
4257 if (yymsg)
4258 yymsg_alloc = yyalloc;
4259 else
4260 {
4261 yymsg = yymsgbuf;
4262 yymsg_alloc = sizeof yymsgbuf;
4263 }
4264 }
4265
4266 if (0 < yysize && yysize <= yymsg_alloc)
4267 {
4268 (void) yysyntax_error (yymsg, yystate, yychar);
4269 yyerror (yymsg);
4270 }
4271 else
4272 {
4273 yyerror (YY_("syntax error"));
4274 if (yysize != 0)
4275 goto yyexhaustedlab;
4276 }
4277 }
4278#endif
4279 }
4280
4281
4282
4283 if (yyerrstatus == 3)
4284 {
4285 /* If just tried and failed to reuse lookahead token after an
4286 error, discard it. */
4287
4288 if (yychar <= YYEOF)
4289 {
4290 /* Return failure if at end of input. */
4291 if (yychar == YYEOF)
4292 YYABORT;
4293 }
4294 else
4295 {
4296 yydestruct ("Error: discarding",
4297 yytoken, &yylval);
4298 yychar = YYEMPTY;
4299 }
4300 }
4301
4302 /* Else will try to reuse lookahead token after shifting the error
4303 token. */
4304 goto yyerrlab1;
4305
4306
4307/*---------------------------------------------------.
4308| yyerrorlab -- error raised explicitly by YYERROR. |
4309`---------------------------------------------------*/
4310yyerrorlab:
4311
4312 /* Pacify compilers like GCC when the user code never invokes
4313 YYERROR and the label yyerrorlab therefore never appears in user
4314 code. */
4315 if (/*CONSTCOND*/ 0)
4316 goto yyerrorlab;
4317
4318 /* Do not reclaim the symbols of the rule which action triggered
4319 this YYERROR. */
4320 YYPOPSTACK (yylen);
4321 yylen = 0;
4322 YY_STACK_PRINT (yyss, yyssp);
4323 yystate = *yyssp;
4324 goto yyerrlab1;
4325
4326
4327/*-------------------------------------------------------------.
4328| yyerrlab1 -- common code for both syntax error and YYERROR. |
4329`-------------------------------------------------------------*/
4330yyerrlab1:
4331 yyerrstatus = 3; /* Each real token shifted decrements this. */
4332
4333 for (;;)
4334 {
4335 yyn = yypact[yystate];
4336 if (yyn != YYPACT_NINF)
4337 {
4338 yyn += YYTERROR;
4339 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4340 {
4341 yyn = yytable[yyn];
4342 if (0 < yyn)
4343 break;
4344 }
4345 }
4346
4347 /* Pop the current state because it cannot handle the error token. */
4348 if (yyssp == yyss)
4349 YYABORT;
4350
4351
4352 yydestruct ("Error: popping",
4353 yystos[yystate], yyvsp);
4354 YYPOPSTACK (1);
4355 yystate = *yyssp;
4356 YY_STACK_PRINT (yyss, yyssp);
4357 }
4358
4359 *++yyvsp = yylval;
4360
4361
4362 /* Shift the error token. */
4363 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4364
4365 yystate = yyn;
4366 goto yynewstate;
4367
4368
4369/*-------------------------------------.
4370| yyacceptlab -- YYACCEPT comes here. |
4371`-------------------------------------*/
4372yyacceptlab:
4373 yyresult = 0;
4374 goto yyreturn;
4375
4376/*-----------------------------------.
4377| yyabortlab -- YYABORT comes here. |
4378`-----------------------------------*/
4379yyabortlab:
4380 yyresult = 1;
4381 goto yyreturn;
4382
4383#if !defined(yyoverflow) || YYERROR_VERBOSE
4384/*-------------------------------------------------.
4385| yyexhaustedlab -- memory exhaustion comes here. |
4386`-------------------------------------------------*/
4387yyexhaustedlab:
4388 yyerror (YY_("memory exhausted"));
4389 yyresult = 2;
4390 /* Fall through. */
4391#endif
4392
4393yyreturn:
4394 if (yychar != YYEMPTY)
4395 yydestruct ("Cleanup: discarding lookahead",
4396 yytoken, &yylval);
4397 /* Do not reclaim the symbols of the rule which action triggered
4398 this YYABORT or YYACCEPT. */
4399 YYPOPSTACK (yylen);
4400 YY_STACK_PRINT (yyss, yyssp);
4401 while (yyssp != yyss)
4402 {
4403 yydestruct ("Cleanup: popping",
4404 yystos[*yyssp], yyvsp);
4405 YYPOPSTACK (1);
4406 }
4407#ifndef yyoverflow
4408 if (yyss != yyssa)
4409 YYSTACK_FREE (yyss);
4410#endif
4411#if YYERROR_VERBOSE
4412 if (yymsg != yymsgbuf)
4413 YYSTACK_FREE (yymsg);
4414#endif
4415 /* Make sure YYID is used. */
4416 return YYID (yyresult);
4417}
#define TRUE
Definition: auxiliary.h:100
#define FALSE
Definition: auxiliary.h:96
void * ADDRESS
Definition: auxiliary.h:119
int l
Definition: cfEzgcd.cc:100
int i
Definition: cfEzgcd.cc:132
int p
Definition: cfModGcd.cc:4078
CanonicalForm b
Definition: cfModGcd.cc:4103
char name() const
Definition: variable.cc:122
Variable next() const
Definition: variable.h:52
feBufferTypes Typ()
Definition: fevoices.cc:111
char ifsw
Definition: fevoices.h:80
procinfo * pi
Definition: fevoices.h:64
Voice * prev
Definition: fevoices.h:62
Matrices of numbers.
Definition: bigintmat.h:51
Definition: idrec.h:35
idhdl get(const char *s, int lev)
Definition: ipid.cc:72
Definition: intvec.h:23
int length() const
Definition: intvec.h:94
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
void * CopyD(int t)
Definition: subexpr.cc:710
int Typ()
Definition: subexpr.cc:1019
int rtyp
Definition: subexpr.h:91
void * Data()
Definition: subexpr.cc:1162
void Init()
Definition: subexpr.h:107
leftv next
Definition: subexpr.h:86
void CleanUp(ring r=currRing)
Definition: subexpr.cc:348
static FORCE_INLINE const char * n_Read(const char *s, number *a, const coeffs r)
!!! Recommendation: This method is too cryptic to be part of the user- !!! interface....
Definition: coeffs.h:595
#define Print
Definition: emacs.cc:80
#define Warn
Definition: emacs.cc:77
const CanonicalForm int s
Definition: facAbsFact.cc:51
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:39
int j
Definition: facHensel.cc:110
VAR short errorreported
Definition: feFopen.cc:23
void WerrorS(const char *s)
Definition: feFopen.cc:24
VAR int myynest
Definition: febase.cc:41
void feHelp(char *str)
Definition: fehelp.cc:90
if(!FE_OPT_NO_SHELL_FLAG)(void) system(sys)
EXTERN_VAR char prompt_char
Definition: feread.h:10
BOOLEAN exitBuffer(feBufferTypes typ)
Definition: fevoices.cc:236
void newBuffer(char *s, feBufferTypes t, procinfo *pi, int lineno)
Definition: fevoices.cc:166
BOOLEAN contBuffer(feBufferTypes typ)
Definition: fevoices.cc:304
VAR Voice * currentVoice
Definition: fevoices.cc:49
BOOLEAN newFile(char *fname)
Definition: fevoices.cc:129
BOOLEAN exitVoice()
Definition: fevoices.cc:341
feBufferTypes
Definition: fevoices.h:17
@ BT_else
Definition: fevoices.h:25
@ BT_if
Definition: fevoices.h:24
@ BT_break
Definition: fevoices.h:19
@ BT_example
Definition: fevoices.h:21
@ BT_proc
Definition: fevoices.h:20
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:301
const char * iiTwoOps(int t)
Definition: gentable.cc:261
#define YYID(n)
Definition: grammar.cc:438
static const yytype_uint8 yyr1[]
Definition: grammar.cc:819
#define YYLEX
Definition: grammar.cc:1647
#define YYMAXDEPTH
Definition: grammar.cc:166
@ PLUSPLUS
Definition: grammar.cc:274
@ NOT
Definition: grammar.cc:272
@ END_RING
Definition: grammar.cc:310
@ MINUSMINUS
Definition: grammar.cc:271
@ PARAMETER
Definition: grammar.cc:349
@ MATRIX_CMD
Definition: grammar.cc:286
@ KEEPRING_CMD
Definition: grammar.cc:297
@ BIGINTMAT_CMD
Definition: grammar.cc:278
@ RETURN
Definition: grammar.cc:348
@ EQUAL_EQUAL
Definition: grammar.cc:268
@ PROC_CMD
Definition: grammar.cc:280
@ BEGIN_RING
Definition: grammar.cc:282
@ INTMAT_CMD
Definition: grammar.cc:279
@ LIB_CMD
Definition: grammar.cc:327
@ MODUL_CMD
Definition: grammar.cc:287
@ SMATRIX_CMD
Definition: grammar.cc:291
@ VECTOR_CMD
Definition: grammar.cc:292
@ NOTEQUAL
Definition: grammar.cc:273
@ DOTDOT
Definition: grammar.cc:267
@ COLONCOLON
Definition: grammar.cc:275
@ POLY_CMD
Definition: grammar.cc:289
@ RING_CMD
Definition: grammar.cc:281
#define YYSTACK_FREE
Definition: grammar.cc:494
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Definition: grammar.cc:1664
#define yyerrok
Definition: grammar.cc:1551
VAR BOOLEAN yyInRingConstruction
Definition: grammar.cc:172
const char * currid
Definition: grammar.cc:171
#define TESTSETINT(a, i)
Definition: grammar.cc:177
#define YYEOF
Definition: grammar.cc:1554
#define YYABORT
Definition: grammar.cc:1557
static const yytype_int16 yydefgoto[]
Definition: grammar.cc:912
#define YY_REDUCE_PRINT(Rule)
Definition: grammar.cc:1797
#define YYTABLE_NINF
Definition: grammar.cc:982
static const yytype_int16 yypact[]
Definition: grammar.cc:924
#define MYYERROR(a)
Definition: grammar.cc:185
#define YYPACT_NINF
Definition: grammar.cc:923
#define YYFINAL
Definition: grammar.cc:581
static const yytype_int16 yypgoto[]
Definition: grammar.cc:969
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Definition: grammar.cc:2051
VAR BOOLEAN expected_parms
Definition: grammar.cc:173
#define YYNTOKENS
Definition: grammar.cc:586
#define YY_STACK_PRINT(Bottom, Top)
Definition: grammar.cc:1759
#define YYSIZE_T
Definition: grammar.cc:409
#define YYSTACK_ALLOC_MAXIMUM
Definition: grammar.cc:496
#define YY_(msgid)
Definition: grammar.cc:425
void yyerror(const char *fmt)
Definition: grammar.cc:187
static const yytype_int16 yytable[]
Definition: grammar.cc:983
static const yytype_uint8 yyr2[]
Definition: grammar.cc:842
#define YYACCEPT
Definition: grammar.cc:1556
#define YYTRANSLATE(YYX)
Definition: grammar.cc:598
static const yytype_uint8 yystos[]
Definition: grammar.cc:1507
VAR int inerror
Definition: grammar.cc:175
#define YYTERROR
Definition: grammar.cc:1596
#define YYPOPSTACK(N)
short int yytype_int16
Definition: grammar.cc:398
#define YYEMPTY
Definition: grammar.cc:1553
#define YYLAST
Definition: grammar.cc:583
#define YYINITDEPTH
Definition: grammar.cc:1816
#define YYERROR
Definition: grammar.cc:1558
static const yytype_int16 yycheck[]
Definition: grammar.cc:1244
#define YYSTACK_ALLOC
Definition: grammar.cc:493
#define YYDPRINTF(Args)
Definition: grammar.cc:1658
static const yytype_uint8 yydefact[]
Definition: grammar.cc:867
VAR int cmdtok
Definition: grammar.cc:174
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
BOOLEAN jjLOAD(const char *s, BOOLEAN autoexport)
load lib/module given in v
Definition: iparith.cc:5512
BOOLEAN iiExprArith2(leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
Definition: iparith.cc:8924
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Definition: iparith.cc:9113
BOOLEAN iiExprArithM(leftv res, leftv a, int op)
Definition: iparith.cc:9414
BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c)
Definition: iparith.cc:9323
BOOLEAN iiAssign(leftv l, leftv r, BOOLEAN toplevel)
Definition: ipassign.cc:1963
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:435
void killhdl2(idhdl h, idhdl *ih, ring r)
Definition: ipid.cc:445
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition: ipid.cc:279
VAR package basePack
Definition: ipid.cc:58
VAR package currPack
Definition: ipid.cc:57
BOOLEAN iiAlias(leftv p)
Definition: ipid.cc:844
void killhdl(idhdl h, package proot)
Definition: ipid.cc:414
VAR coeffs coeffs_BIGINT
Definition: ipid.cc:50
#define IDMATRIX(a)
Definition: ipid.h:134
#define IDNEXT(a)
Definition: ipid.h:118
EXTERN_VAR omBin sleftv_bin
Definition: ipid.h:145
#define IDPROC(a)
Definition: ipid.h:140
#define IDINTVEC(a)
Definition: ipid.h:128
#define IDBIMAT(a)
Definition: ipid.h:129
#define IDIDEAL(a)
Definition: ipid.h:133
#define IDID(a)
Definition: ipid.h:122
#define IDROOT
Definition: ipid.h:19
#define IDLEV(a)
Definition: ipid.h:121
#define IDRING(a)
Definition: ipid.h:127
char * iiProcArgs(char *e, BOOLEAN withParenth)
Definition: iplib.cc:114
INST_VAR sleftv iiRETURNEXPR
Definition: iplib.cc:474
VAR ring * iiLocalRing
Definition: iplib.cc:473
procinfo * iiInitSingularProcinfo(procinfov pi, const char *libname, const char *procname, int, long pos, BOOLEAN pstatic)
Definition: iplib.cc:1049
BOOLEAN iiParameter(leftv p)
Definition: ipshell.cc:1376
int iiDeclCommand(leftv sy, leftv name, int lev, int t, idhdl *root, BOOLEAN isring, BOOLEAN init_b)
Definition: ipshell.cc:1198
void rKill(ring r)
Definition: ipshell.cc:6180
BOOLEAN iiApply(leftv res, leftv a, int op, leftv proc)
Definition: ipshell.cc:6431
void list_cmd(int typ, const char *what, const char *prefix, BOOLEAN iterate, BOOLEAN fullname)
Definition: ipshell.cc:425
ring rInit(leftv pn, leftv rv, leftv ord)
Definition: ipshell.cc:5625
BOOLEAN iiARROW(leftv r, char *a, char *s)
Definition: ipshell.cc:6480
int exprlist_length(leftv v)
Definition: ipshell.cc:552
BOOLEAN iiTestAssume(leftv a, leftv b)
Definition: ipshell.cc:6453
void iiSetReturn(const leftv source)
Definition: ipshell.cc:6601
BOOLEAN iiAssignCR(leftv r, leftv arg)
Definition: ipshell.cc:6514
idhdl rFindHdl(ring r, idhdl n)
Definition: ipshell.cc:1701
void iiDebug()
Definition: ipshell.cc:1065
const char * lastreserved
Definition: ipshell.cc:82
void type_cmd(leftv v)
Definition: ipshell.cc:254
void rSetHdl(idhdl h)
Definition: ipshell.cc:5126
BOOLEAN iiExport(leftv v, int toLev)
Definition: ipshell.cc:1511
void singular_example(char *str)
Definition: misc_ip.cc:430
STATIC_VAR Poly * h
Definition: janet.cc:971
ListNode * next
Definition: janet.h:31
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:37
const int MAX_INT_LEN
Definition: mylimits.h:13
#define omAlloc(size)
Definition: omAllocDecl.h:210
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
#define omFree(addr)
Definition: omAllocDecl.h:261
#define NULL
Definition: omList.c:12
VAR BOOLEAN siCntrlc
Definition: options.c:14
#define BVERBOSE(a)
Definition: options.h:35
#define V_REDEFINE
Definition: options.h:45
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
#define pAdd(p, q)
Definition: polys.h:203
#define pDelete(p_ptr)
Definition: polys.h:186
#define pSetCompP(a, i)
Definition: polys.h:303
void PrintLn()
Definition: reporter.cc:310
void Werror(const char *fmt,...)
Definition: reporter.cc:189
rRingOrder_t rOrderName(char *ordername)
Definition: ring.cc:507
ring rDefault(const coeffs cf, int N, char **n, int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl, unsigned long bitmask)
Definition: ring.cc:102
idrec * idhdl
Definition: ring.h:21
VAR int sdb_flags
Definition: sdb.cc:31
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:35
sleftv * leftv
Definition: structs.h:57
#define YYSTYPE
Definition: stype.h:19
EXTERN_VAR YYSTYPE yylval
Definition: stype.h:20
void syMake(leftv v, const char *id, package pa)
Definition: subexpr.cc:1570
INST_VAR sleftv sLastPrinted
Definition: subexpr.cc:46
VAR BOOLEAN siq
Definition: subexpr.cc:48
void syMakeMonom(leftv v, const char *id)
Definition: subexpr.cc:1862
char trace_flag
Definition: subexpr.h:62
int name
New type name for int.
Definition: templateForC.h:21
void writeRTime(const char *v)
Definition: timer.cc:193
VAR int rtimerv
Definition: timer.cc:146
void writeTime(const char *v)
Definition: timer.cc:119
VAR int timerv
Definition: timer.cc:17
void startTimer()
Definition: timer.cc:80
void startRTimer()
Definition: timer.cc:151
#define IDHDL
Definition: tok.h:31
#define NONE
Definition: tok.h:221
#define COMMAND
Definition: tok.h:29
#define UNKNOWN
Definition: tok.h:222

Variable Documentation

◆ my_yylinebuf

EXTERN_VAR char my_yylinebuf[80]

Definition at line 16 of file tok.h.

◆ yylineno

EXTERN_VAR int yylineno

Definition at line 15 of file tok.h.