2118{
2119
2120int yychar;
2121
2122
2124
2125
2126 int yynerrs;
2127
2128 int yystate;
2129
2130 int yyerrstatus;
2131
2132
2133
2134
2135
2136
2137
2138
2139
2143
2144
2148
2150
2151 int yyn;
2152 int yyresult;
2153
2154 int yytoken;
2155
2156
2158
2159#if YYERROR_VERBOSE
2160
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
2169
2170 int yylen = 0;
2171
2172 yytoken = 0;
2173 yyss = yyssa;
2174 yyvs = yyvsa;
2176
2177 YYDPRINTF ((stderr,
"Starting parse\n"));
2178
2179 yystate = 0;
2180 yyerrstatus = 0;
2181 yynerrs = 0;
2183
2184
2185
2186
2187
2188 yyssp = yyss;
2189 yyvsp = yyvs;
2190
2191 goto yysetstate;
2192
2193
2194
2195
2196 yynewstate:
2197
2198
2199 yyssp++;
2200
2201 yysetstate:
2202 *yyssp = yystate;
2203
2204 if (yyss + yystacksize - 1 <= yyssp)
2205 {
2206
2207 YYSIZE_T yysize = yyssp - yyss + 1;
2208
2209#ifdef yyoverflow
2210 {
2211
2212
2213
2216
2217
2218
2219
2220
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
2230# ifndef YYSTACK_RELOCATE
2231 goto yyexhaustedlab;
2232# else
2233
2235 goto yyexhaustedlab;
2236 yystacksize *= 2;
2239
2240 {
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)
2251 }
2252# endif
2253#endif
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)
2263 }
2264
2265 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
2266
2269
2270 goto yybackup;
2271
2272
2273
2274
2275yybackup:
2276
2277
2278
2279
2280
2283 goto yydefault;
2284
2285
2286
2287
2289 {
2290 YYDPRINTF ((stderr,
"Reading a token: "));
2292 }
2293
2294 if (yychar <=
YYEOF)
2295 {
2296 yychar = yytoken =
YYEOF;
2297 YYDPRINTF ((stderr,
"Now at end of input.\n"));
2298 }
2299 else
2300 {
2303 }
2304
2305
2306
2307 yyn += yytoken;
2309 goto yydefault;
2311 if (yyn <= 0)
2312 {
2314 goto yyerrlab;
2315 yyn = -yyn;
2316 goto yyreduce;
2317 }
2318
2319
2320
2321 if (yyerrstatus)
2322 yyerrstatus--;
2323
2324
2326
2327
2329
2330 yystate = yyn;
2332
2333 goto yynewstate;
2334
2335
2336
2337
2338
2339yydefault:
2341 if (yyn == 0)
2342 goto yyerrlab;
2343 goto yyreduce;
2344
2345
2346
2347
2348
2349yyreduce:
2350
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361 yyval = yyvsp[1-yylen];
2362
2363
2365 switch (yyn)
2366 {
2367 case 3:
2368
2369
2370#line 321 "grammar.y"
2371 {
2373 {
2376 }
2378 {
2381 }
2383#ifdef HAVE_SDB
2385#endif
2387 {
2391 }
2393 {
2395 }
2400 ;}
2401 break;
2402
2403 case 5:
2404
2405
2406#line 356 "grammar.y"
2408 break;
2409
2410 case 6:
2411
2412
2413#line 358 "grammar.y"
2415 break;
2416
2417 case 7:
2418
2419
2420#line 360 "grammar.y"
2421 {
2423 ;}
2424 break;
2425
2426 case 8:
2427
2428
2429#line 364 "grammar.y"
2430 {
2433 ;}
2434 break;
2435
2436 case 9:
2437
2438
2439#line 369 "grammar.y"
2441 break;
2442
2443 case 10:
2444
2445
2446#line 371 "grammar.y"
2447 {
2448 #ifdef SIQ
2450 #endif
2454 {
2455
2456 if ((
inerror!=3) && ((yyvsp[(1) - (2)].
i)<
UMINUS) && ((yyvsp[(1) - (2)].
i)>
' '))
2457 {
2458
2459
2460
2463 }
2464
2465
2466 }
2470#ifdef HAVE_SDB
2472 {
2474 }
2475 else
2476#endif
2478 {
2480
2484 else
2486 }
2488 {
2490 }
2491#ifdef HAVE_SDB
2493#endif
2494 ;}
2495 break;
2496
2497 case 18:
2498
2499
2500#line 429 "grammar.y"
2502 break;
2503
2504 case 19:
2505
2506
2507#line 432 "grammar.y"
2509 break;
2510
2511 case 29:
2512
2513
2514#line 447 "grammar.y"
2515 {
2517 ;}
2518 break;
2519
2520 case 30:
2521
2522
2523#line 454 "grammar.y"
2524 {
2527 ;}
2528 break;
2529
2530 case 31:
2531
2532
2533#line 459 "grammar.y"
2534 {
2535 syMake(&(yyval.lv),(yyvsp[(1) - (1)].name));
2536 ;}
2537 break;
2538
2539 case 32:
2540
2541
2542#line 463 "grammar.y"
2543 {
2545 ;}
2546 break;
2547
2548 case 33:
2549
2550
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
2560#line 471 "grammar.y"
2561 {
2563 ;}
2564 break;
2565
2566 case 35:
2567
2568
2569#line 475 "grammar.y"
2570 {
2571 if ((yyvsp[(1) - (4)].lv).
next==
NULL)
2572 {
2574 memcpy((yyvsp[(1) - (4)].lv).
next,&(yyvsp[(3) - (4)].lv),
sizeof(
sleftv));
2576 }
2577 else if ((yyvsp[(1) - (4)].lv).rtyp==
UNKNOWN)
2578 {
2580 }
2582 ;}
2583 break;
2584
2585 case 36:
2586
2587
2588#line 489 "grammar.y"
2589 {
2592 memset(&(yyval.lv),0,
sizeof(
sleftv));
2594 leftv v = &(yyvsp[(2) - (3)].lv);
2596 {
2599 memset(&tmp,0,sizeof(tmp));
2602 {
2603 pDelete((poly *)&(yyval.lv).data);
2604 (yyvsp[(2) - (3)].lv).CleanUp();
2606 }
2609 (yyval.lv).data = (
void *)
pAdd((poly)(yyval.lv).data,
p);
2613 }
2614 (yyvsp[(2) - (3)].lv).CleanUp();
2615 ;}
2616 break;
2617
2618 case 37:
2619
2620
2621#line 517 "grammar.y"
2622 {
2623 memset(&(yyval.lv),0,sizeof((yyval.lv)));
2624 int i = atoi((yyvsp[(1) - (1)].
name));
2625
2626
2628 (yyval.lv).data = (
void *)(long)
i;
2629
2630
2631 int l = strlen((yyvsp[(1) - (1)].
name))+2;
2632 number n;
2634 {
2636 sprintf(tmp,
"%d",
i);
2637 if (strcmp(tmp,(yyvsp[(1) - (1)].
name))!=0)
2638 {
2641 (yyval.lv).data = n;
2642 }
2643 }
2644 ;}
2645 break;
2646
2647 case 38:
2648
2649
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
2661#line 547 "grammar.y"
2662 {
2663 memset(&(yyval.lv),0,sizeof((yyval.lv)));
2665 (yyval.lv).data = (yyvsp[(1) - (1)].
name);
2666 ;}
2667 break;
2668
2669 case 40:
2670
2671
2672#line 553 "grammar.y"
2673 {
2675 ;}
2676 break;
2677
2678 case 41:
2679
2680
2681#line 557 "grammar.y"
2682 {
2684 ;}
2685 break;
2686
2687 case 42:
2688
2689
2690#line 561 "grammar.y"
2691 {
2693 ;}
2694 break;
2695
2696 case 43:
2697
2698
2699#line 565 "grammar.y"
2700 {
2702 ;}
2703 break;
2704
2705 case 44:
2706
2707
2708#line 569 "grammar.y"
2709 {
2711 ;}
2712 break;
2713
2714 case 45:
2715
2716
2717#line 573 "grammar.y"
2718 {
2720 ;}
2721 break;
2722
2723 case 46:
2724
2725
2726#line 577 "grammar.y"
2727 {
2729 ;}
2730 break;
2731
2732 case 47:
2733
2734
2735#line 581 "grammar.y"
2736 {
2738 ;}
2739 break;
2740
2741 case 48:
2742
2743
2744#line 585 "grammar.y"
2745 {
2747 ;}
2748 break;
2749
2750 case 49:
2751
2752
2753#line 589 "grammar.y"
2754 {
2756 ;}
2757 break;
2758
2759 case 50:
2760
2761
2762#line 593 "grammar.y"
2763 {
2765 ;}
2766 break;
2767
2768 case 51:
2769
2770
2771#line 597 "grammar.y"
2772 {
2774 ;}
2775 break;
2776
2777 case 52:
2778
2779
2780#line 601 "grammar.y"
2781 {
2783 ;}
2784 break;
2785
2786 case 53:
2787
2788
2789#line 605 "grammar.y"
2790 {
2792 ;}
2793 break;
2794
2795 case 54:
2796
2797
2798#line 609 "grammar.y"
2799 {
2801 ;}
2802 break;
2803
2804 case 55:
2805
2806
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
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
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
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
2843#line 629 "grammar.y"
2844 {
2846 ;}
2847 break;
2848
2849 case 60:
2850
2851
2852#line 633 "grammar.y"
2853 {
2854 int b=
iiExprArithM(&(yyval.lv),&(yyvsp[(3) - (4)].lv),(yyvsp[(1) - (4)].i));
2857 ;}
2858 break;
2859
2860 case 61:
2861
2862
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
2872#line 643 "grammar.y"
2873 {
2875 ;}
2876 break;
2877
2878 case 63:
2879
2880
2881#line 647 "grammar.y"
2882 {
2884 ;}
2885 break;
2886
2887 case 64:
2888
2889
2890#line 651 "grammar.y"
2891 {
2893 ;}
2894 break;
2895
2896 case 65:
2897
2898
2899#line 655 "grammar.y"
2900 {
2901 if (
iiARROW(&(yyval.lv),(yyvsp[(1) - (3)].name),(yyvsp[(3) - (3)].name)))
YYERROR;
2903 ;}
2904 break;
2905
2906 case 66:
2907
2908
2909#line 659 "grammar.y"
2910 { (yyval.lv) = (yyvsp[(2) - (3)].lv); ;}
2911 break;
2912
2913 case 67:
2914
2915
2916#line 664 "grammar.y"
2917 {
2918 leftv v = &(yyvsp[(1) - (3)].lv);
2920 {
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
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
2941#line 684 "grammar.y"
2942 {
2944 ;}
2945 break;
2946
2947 case 73:
2948
2949
2950#line 688 "grammar.y"
2951 {
2953 ;}
2954 break;
2955
2956 case 74:
2957
2958
2959#line 692 "grammar.y"
2960 {
2962 ;}
2963 break;
2964
2965 case 75:
2966
2967
2968#line 696 "grammar.y"
2969 {
2971 ;}
2972 break;
2973
2974 case 76:
2975
2976
2977#line 700 "grammar.y"
2978 {
2980 ;}
2981 break;
2982
2983 case 77:
2984
2985
2986#line 704 "grammar.y"
2987 {
2989 ;}
2990 break;
2991
2992 case 78:
2993
2994
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
3004#line 712 "grammar.y"
3005 {
3006 (yyval.lv)=(yyvsp[(2) - (3)].lv);
3007 ;}
3008 break;
3009
3010 case 80:
3011
3012
3013#line 716 "grammar.y"
3014 {
3015 #ifdef SIQ
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;
3025 }
3026 #ifdef SIQ
3028 #endif
3029 ;}
3030 break;
3031
3032 case 81:
3033
3034
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
3046#line 739 "grammar.y"
3047 {
3048 #ifdef SIQ
3050 #endif
3051 ;}
3052 break;
3053
3054 case 83:
3055
3056
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
3065 #endif
3066 ;}
3067 break;
3068
3069 case 84:
3070
3071
3072#line 757 "grammar.y"
3073 {
3074 #ifdef SIQ
3076 #endif
3077 ;}
3078 break;
3079
3080 case 85:
3081
3082
3083#line 765 "grammar.y"
3084 {
3085 #ifdef SIQ
3087 #endif
3088 ;}
3089 break;
3090
3091 case 86:
3092
3093
3094#line 773 "grammar.y"
3095 {
3096 #ifdef SIQ
3098 #endif
3099 ;}
3100 break;
3101
3102 case 87:
3103
3104
3105#line 782 "grammar.y"
3106 {
3108 ;}
3109 break;
3110
3111 case 88:
3112
3113
3114#line 786 "grammar.y"
3115 {
3117 ;}
3118 break;
3119
3120 case 89:
3121
3122
3123#line 790 "grammar.y"
3124 {
3126 ;}
3127 break;
3128
3129 case 90:
3130
3131
3132#line 794 "grammar.y"
3133 {
3135 ;}
3136 break;
3137
3138 case 91:
3139
3140
3141#line 798 "grammar.y"
3142 {
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
3150#line 802 "grammar.y"
3151 {
3153 ;}
3154 break;
3155
3156 case 93:
3157
3158
3159#line 806 "grammar.y"
3160 {
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
3168#line 810 "grammar.y"
3169 {
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
3177#line 814 "grammar.y"
3178 {
3180 ;}
3181 break;
3182
3183 case 96:
3184
3185
3186#line 818 "grammar.y"
3187 {
3189 ;}
3190 break;
3191
3192 case 97:
3193
3194
3195#line 822 "grammar.y"
3196 {
3198 ;}
3199 break;
3200
3201 case 98:
3202
3203
3204#line 826 "grammar.y"
3205 {
3207 ;}
3208 break;
3209
3210 case 99:
3211
3212
3213#line 830 "grammar.y"
3214 {
3217 else
3218 {
3219 memset(&(yyval.lv),0,sizeof((yyval.lv)));
3222 (yyval.lv).data = (
void *)(long)(
i == 0 ? 1 : 0);
3223 }
3224 ;}
3225 break;
3226
3227 case 100:
3228
3229
3230#line 842 "grammar.y"
3231 {
3233 ;}
3234 break;
3235
3236 case 102:
3237
3238
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());
3245 }
3246 else if (((yyvsp[(1) - (2)].lv).rtyp==
MODUL_CMD)
3247
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
3259#line 870 "grammar.y"
3260 {
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
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)))
3277 ;}
3278 break;
3279
3280 case 106:
3281
3282
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)))
3287 ;}
3288 break;
3289
3290 case 107:
3291
3292
3293#line 892 "grammar.y"
3294 {
3296 ;}
3297 break;
3298
3299 case 108:
3300
3301
3302#line 896 "grammar.y"
3303 {
3305 ;}
3306 break;
3307
3308 case 109:
3309
3310
3311#line 900 "grammar.y"
3312 {
3318 {
3325 else
3328 }
3330 {
3331 if (
iiDeclCommand(&(yyval.lv),&(yyvsp[(2) - (8)].lv),
myynest,(yyvsp[(1) - (8)].i),&((yyvsp[(2) - (8)].lv).req_packhdl->idroot)))
3336 {
3339 }
3340 else
3341 {
3344 }
3346 }
3347 ;}
3348 break;
3349
3350 case 110:
3351
3352
3353#line 937 "grammar.y"
3354 {
3356 {
3358 }
3360 {
3361 if (
iiDeclCommand(&(yyval.lv),&(yyvsp[(2) - (2)].lv),
myynest,(yyvsp[(1) - (2)].i),&((yyvsp[(2) - (2)].lv).req_packhdl->idroot)))
3364 {
3367 do
3368 {
3374 }
3375 }
3376 ;}
3377 break;
3378
3379 case 111:
3380
3381
3382#line 961 "grammar.y"
3383 {
3384 int t=(yyvsp[(1) - (3)].lv).Typ();
3386 memset(&r,0,
sizeof(
sleftv));
3388 {
3391 }
3392 else
3393 {
3394 if (
iiDeclCommand(&r,&(yyvsp[(3) - (3)].lv),
myynest,t,&((yyvsp[(3) - (3)].lv).req_packhdl->idroot)))
3396 }
3397 leftv v=&(yyvsp[(1) - (3)].lv);
3401 (yyval.lv)=(yyvsp[(1) - (3)].lv);
3402 ;}
3403 break;
3404
3405 case 112:
3406
3407
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)))
3412 ;}
3413 break;
3414
3415 case 115:
3416
3417
3418#line 995 "grammar.y"
3419 {
3420 leftv v = &(yyvsp[(2) - (5)].lv);
3422 {
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
3434#line 1009 "grammar.y"
3435 {
3436
3438 ;}
3439 break;
3440
3441 case 117:
3442
3443
3444#line 1017 "grammar.y"
3445 {
3446 memset(&(yyval.lv),0,sizeof((yyval.lv)));
3448 (*iv)[0] = 1;
3449 (*iv)[1] = (yyvsp[(1) - (1)].i);
3451 (yyval.lv).data = (void *)iv;
3452 ;}
3453 break;
3454
3455 case 118:
3456
3457
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 {
3465 int l = 2 + slLength;
3467 (*iv)[0] = slLength;
3468 (*iv)[1] = (yyvsp[(1) - (4)].i);
3469
3471 while ((
i<
l) && (sl!=
NULL))
3472 {
3474 {
3475 (*iv)[
i++] = (int)((
long)(sl->
Data()));
3476 }
3479 {
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 }
3494 }
3496 (yyval.lv).data = (void *)iv;
3497 }
3498 (yyvsp[(3) - (4)].lv).CleanUp();
3499 ;}
3500 break;
3501
3502 case 120:
3503
3504
3505#line 1072 "grammar.y"
3506 {
3507 (yyval.lv) = (yyvsp[(1) - (3)].lv);
3509 memcpy((yyval.lv).next,&(yyvsp[(3) - (3)].lv),
sizeof(
sleftv));
3510 ;}
3511 break;
3512
3513 case 122:
3514
3515
3516#line 1082 "grammar.y"
3517 {
3518 (yyval.lv) = (yyvsp[(2) - (3)].lv);
3519 ;}
3520 break;
3521
3522 case 123:
3523
3524
3525#line 1088 "grammar.y"
3526 {
3528 ;}
3529 break;
3530
3531 case 128:
3532
3533
3534#line 1106 "grammar.y"
3536 break;
3537
3538 case 129:
3539
3540
3541#line 1111 "grammar.y"
3542 {
3545 ;}
3546 break;
3547
3548 case 130:
3549
3550
3551#line 1116 "grammar.y"
3552 {
3554 ;}
3555 break;
3556
3557 case 131:
3558
3559
3560#line 1123 "grammar.y"
3561 {
3564 ;}
3565 break;
3566
3567 case 132:
3568
3569
3570#line 1131 "grammar.y"
3571 {
3572 if (
basePack!=(yyvsp[(2) - (2)].lv).req_packhdl)
3573 {
3575 }
3576 else
3578 ;}
3579 break;
3580
3581 case 133:
3582
3583
3584#line 1143 "grammar.y"
3585 {
3586 leftv v=&(yyvsp[(2) - (2)].lv);
3588 {
3590 {
3593 }
3595 }
3596 else
3597 {
3599 }
3600 ;}
3601 break;
3602
3603 case 134:
3604
3605
3606#line 1160 "grammar.y"
3607 {
3608 leftv v=&(yyvsp[(3) - (3)].lv);
3610 {
3612 {
3615 }
3617 }
3618 else
3619 {
3621 }
3622 ;}
3623 break;
3624
3625 case 135:
3626
3627
3628#line 1180 "grammar.y"
3629 {
3631 ;}
3632 break;
3633
3634 case 136:
3635
3636
3637#line 1184 "grammar.y"
3638 {
3640 ;}
3641 break;
3642
3643 case 137:
3644
3645
3646#line 1188 "grammar.y"
3647 {
3650 ;}
3651 break;
3652
3653 case 138:
3654
3655
3656#line 1193 "grammar.y"
3657 {
3659 ;}
3660 break;
3661
3662 case 139:
3663
3664
3665#line 1197 "grammar.y"
3666 {
3668 ;}
3669 break;
3670
3671 case 140:
3672
3673
3674#line 1201 "grammar.y"
3675 {
3677 ;}
3678 break;
3679
3680 case 141:
3681
3682
3683#line 1205 "grammar.y"
3684 {
3686 ;}
3687 break;
3688
3689 case 142:
3690
3691
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
3702#line 1214 "grammar.y"
3703 {
3706 (yyvsp[(3) - (6)].lv).CleanUp();
3707 ;}
3708 break;
3709
3710 case 144:
3711
3712
3713#line 1220 "grammar.y"
3714 {
3717 (yyvsp[(3) - (6)].lv).CleanUp();
3718 ;}
3719 break;
3720
3721 case 145:
3722
3723
3724#line 1226 "grammar.y"
3725 {
3728 (yyvsp[(3) - (6)].lv).CleanUp();
3729 ;}
3730 break;
3731
3732 case 146:
3733
3734
3735#line 1232 "grammar.y"
3736 {
3739 (yyvsp[(3) - (6)].lv).CleanUp();
3740 ;}
3741 break;
3742
3743 case 147:
3744
3745
3746#line 1238 "grammar.y"
3747 {
3750 (yyvsp[(3) - (6)].lv).CleanUp();
3751 ;}
3752 break;
3753
3754 case 148:
3755
3756
3757#line 1244 "grammar.y"
3758 {
3761 (yyvsp[(3) - (6)].lv).CleanUp();
3762 ;}
3763 break;
3764
3765 case 149:
3766
3767
3768#line 1250 "grammar.y"
3769 {
3772 (yyvsp[(3) - (6)].lv).CleanUp();
3773 ;}
3774 break;
3775
3776 case 150:
3777
3778
3779#line 1262 "grammar.y"
3780 {
3782 ;}
3783 break;
3784
3785 case 151:
3786
3787
3788#line 1268 "grammar.y"
3790 break;
3791
3792 case 152:
3793
3794
3795#line 1277 "grammar.y"
3796 {
3797 const char *ring_name = (yyvsp[(2) - (8)].lv).
name;
3799 rInit(&(yyvsp[(4) - (8)].lv),
3800 &(yyvsp[(6) - (8)].lv),
3801 &(yyvsp[(8) - (8)].lv));
3803
3805 {
3807 &((yyvsp[(2) - (8)].lv).req_packhdl->idroot),
FALSE);
3808 (yyvsp[(2) - (8)].lv).CleanUp();
3809 if (newRingHdl!=
NULL)
3810 {
3812 }
3813 else
3814 {
3816 }
3817 }
3819 if (newRingHdl==
NULL)
3820 {
3822 }
3823 else
3824 {
3826 }
3827 ;}
3828 break;
3829
3830 case 153:
3831
3832
3833#line 1310 "grammar.y"
3834 {
3835 const char *ring_name = (yyvsp[(2) - (2)].lv).
name;
3838 (yyvsp[(2) - (2)].lv).CleanUp();
3839 ;}
3840 break;
3841
3842 case 154:
3843
3844
3845#line 1317 "grammar.y"
3846 {
3849 ;}
3850 break;
3851
3852 case 155:
3853
3854
3855#line 1322 "grammar.y"
3856 {
3860 memcpy((yyvsp[(4) - (7)].lv).
next,&(yyvsp[(6) - (7)].lv),
sizeof(
sleftv));
3861 memset(&(yyvsp[(6) - (7)].lv),0,
sizeof(
sleftv));
3864 ;}
3865 break;
3866
3867 case 156:
3868
3869
3870#line 1335 "grammar.y"
3871 {
3874 ;}
3875 break;
3876
3877 case 159:
3878
3879
3880#line 1345 "grammar.y"
3881 {
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 {
3889 if ((yyvsp[(2) - (2)].lv).e!=
NULL)
h=
rFindHdl((ring)(yyvsp[(2) - (2)].lv).Data(),
NULL);
3890
3892 {
3894 {
3896 {
3898#if 1
3903 {
3905 {
3908 {
3913 }
3915 }
3917 }
3918#endif
3919 }
3921 }
3922 else
3923 {
3924 Werror(
"%s is no identifier",n);
3925 (yyvsp[(2) - (2)].lv).CleanUp();
3927 }
3928 }
3930 else
3931 {
3932 Werror(
"cannot find the name of the basering %s",n);
3933 (yyvsp[(2) - (2)].lv).CleanUp();
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();
3943 }
3944 ;}
3945 break;
3946
3947 case 160:
3948
3949
3950#line 1413 "grammar.y"
3951 {
3952 type_cmd(&((yyvsp[(2) - (2)].lv)));
3953 ;}
3954 break;
3955
3956 case 161:
3957
3958
3959#line 1417 "grammar.y"
3960 {
3961
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);
3972 }
3974 }
3975 #ifdef SIQ
3976 }
3977 #endif
3979 (yyvsp[(1) - (1)].lv).CleanUp(
currRing);
3981 ;}
3982 break;
3983
3984 case 162:
3985
3986
3987#line 1446 "grammar.y"
3988 {
3991 {
3993 }
3994 else
3995 {
3998 }
3999 ;}
4000 break;
4001
4002 case 163:
4003
4004
4005#line 1459 "grammar.y"
4006 {
4008 {
4011 }
4012 else
4013 {
4015 {
4017 }
4019 }
4021 ;}
4022 break;
4023
4024 case 164:
4025
4026
4027#line 1476 "grammar.y"
4028 {
4031 {
4033 }
4035 ;}
4036 break;
4037
4038 case 165:
4039
4040
4041#line 1485 "grammar.y"
4042 {
4045 ;}
4046 break;
4047
4048 case 166:
4049
4050
4051#line 1490 "grammar.y"
4052 {
4055 ;}
4056 break;
4057
4058 case 167:
4059
4060
4061#line 1498 "grammar.y"
4062 {
4063
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));
4069 ;}
4070 break;
4071
4072 case 168:
4073
4074
4075#line 1510 "grammar.y"
4076 {
4077
4078
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));
4086 s = (
char *)
omAlloc( strlen((yyvsp[(2) - (5)].
name)) + 3);
4087 sprintf(
s,
"%s;\n",(yyvsp[(2) - (5)].
name));
4090 ;}
4091 break;
4092
4093 case 169:
4094
4095
4096#line 1529 "grammar.y"
4097 {
4102 sprintf(
IDPROC(
h)->data.s.body,
"parameter list #;\n%s;return();\n\n",(yyvsp[(3) - (3)].name));
4105 ;}
4106 break;
4107
4108 case 170:
4109
4110
4111#line 1539 "grammar.y"
4112 {
4115 {
4120 }
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));
4129 ;}
4130 break;
4131
4132 case 171:
4133
4134
4135#line 1558 "grammar.y"
4136 {
4140 {
4145 }
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));
4154 ;}
4155 break;
4156
4157 case 172:
4158
4159
4160#line 1581 "grammar.y"
4161 {
4162
4165 ;}
4166 break;
4167
4168 case 173:
4169
4170
4171#line 1587 "grammar.y"
4172 {
4173
4179 ;}
4180 break;
4181
4182 case 174:
4183
4184
4185#line 1599 "grammar.y"
4186 {
4188 (yyvsp[(3) - (4)].lv).CleanUp();
4190 ;}
4191 break;
4192
4193 case 175:
4194
4195
4196#line 1605 "grammar.y"
4197 {
4198 if ((yyvsp[(1) - (3)].
i)==
RETURN)
4199 {
4203 }
4204 ;}
4205 break;
4206
4207
4208
4209
4210#line 4211 "grammar.cc"
4211 default: break;
4212 }
4214
4216 yylen = 0;
4218
4219 *++yyvsp = yyval;
4220
4221
4222
4223
4224
4226
4228 if (0 <= yystate && yystate <=
YYLAST &&
yycheck[yystate] == *yyssp)
4230 else
4232
4233 goto yynewstate;
4234
4235
4236
4237
4238
4239yyerrlab:
4240
4241 if (!yyerrstatus)
4242 {
4243 ++yynerrs;
4244#if ! YYERROR_VERBOSE
4246#else
4247 {
4248 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
4250 {
4254 if (yymsg != yymsgbuf)
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);
4270 }
4271 else
4272 {
4274 if (yysize != 0)
4275 goto yyexhaustedlab;
4276 }
4277 }
4278#endif
4279 }
4280
4281
4282
4283 if (yyerrstatus == 3)
4284 {
4285
4286
4287
4288 if (yychar <=
YYEOF)
4289 {
4290
4291 if (yychar ==
YYEOF)
4293 }
4294 else
4295 {
4299 }
4300 }
4301
4302
4303
4304 goto yyerrlab1;
4305
4306
4307
4308
4309
4310yyerrorlab:
4311
4312
4313
4314
4315 if ( 0)
4316 goto yyerrorlab;
4317
4318
4319
4321 yylen = 0;
4323 yystate = *yyssp;
4324 goto yyerrlab1;
4325
4326
4327
4328
4329
4330yyerrlab1:
4331 yyerrstatus = 3;
4332
4333 for (;;)
4334 {
4337 {
4340 {
4342 if (0 < yyn)
4343 break;
4344 }
4345 }
4346
4347
4348 if (yyssp == yyss)
4350
4351
4355 yystate = *yyssp;
4357 }
4358
4360
4361
4362
4364
4365 yystate = yyn;
4366 goto yynewstate;
4367
4368
4369
4370
4371
4372yyacceptlab:
4373 yyresult = 0;
4374 goto yyreturn;
4375
4376
4377
4378
4379yyabortlab:
4380 yyresult = 1;
4381 goto yyreturn;
4382
4383#if !defined(yyoverflow) || YYERROR_VERBOSE
4384
4385
4386
4387yyexhaustedlab:
4389 yyresult = 2;
4390
4391#endif
4392
4393yyreturn:
4397
4398
4401 while (yyssp != yyss)
4402 {
4406 }
4407#ifndef yyoverflow
4408 if (yyss != yyssa)
4410#endif
4411#if YYERROR_VERBOSE
4412 if (yymsg != yymsgbuf)
4414#endif
4415
4416 return YYID (yyresult);
4417}
idhdl get(const char *s, int lev)
Class used for (list of) interpreter objects.
void CleanUp(ring r=currRing)
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....
const Variable & v
< [in] a sqrfree bivariate poly
if(!FE_OPT_NO_SHELL_FLAG)(void) system(sys)
EXTERN_VAR char prompt_char
BOOLEAN exitBuffer(feBufferTypes typ)
void newBuffer(char *s, feBufferTypes t, procinfo *pi, int lineno)
BOOLEAN contBuffer(feBufferTypes typ)
BOOLEAN newFile(char *fname)
int iiTestConvert(int inputType, int outputType)
const char * iiTwoOps(int t)
static const yytype_uint8 yyr1[]
VAR BOOLEAN yyInRingConstruction
static const yytype_int16 yydefgoto[]
#define YY_REDUCE_PRINT(Rule)
static const yytype_int16 yypact[]
static const yytype_int16 yypgoto[]
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
#define YY_STACK_PRINT(Bottom, Top)
#define YYSTACK_ALLOC_MAXIMUM
void yyerror(const char *fmt)
static const yytype_int16 yytable[]
static const yytype_uint8 yystos[]
static const yytype_int16 yycheck[]
static const yytype_uint8 yydefact[]
#define idDelete(H)
delete an ideal
BOOLEAN jjLOAD(const char *s, BOOLEAN autoexport)
load lib/module given in v
BOOLEAN iiExprArith2(leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
BOOLEAN iiExprArithM(leftv res, leftv a, int op)
BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c)
BOOLEAN iiAssign(leftv l, leftv r, BOOLEAN toplevel)
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
void killhdl2(idhdl h, idhdl *ih, ring r)
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
void killhdl(idhdl h, package proot)
EXTERN_VAR omBin sleftv_bin
char * iiProcArgs(char *e, BOOLEAN withParenth)
INST_VAR sleftv iiRETURNEXPR
procinfo * iiInitSingularProcinfo(procinfov pi, const char *libname, const char *procname, int, long pos, BOOLEAN pstatic)
BOOLEAN iiParameter(leftv p)
int iiDeclCommand(leftv sy, leftv name, int lev, int t, idhdl *root, BOOLEAN isring, BOOLEAN init_b)
BOOLEAN iiApply(leftv res, leftv a, int op, leftv proc)
void list_cmd(int typ, const char *what, const char *prefix, BOOLEAN iterate, BOOLEAN fullname)
ring rInit(leftv pn, leftv rv, leftv ord)
BOOLEAN iiARROW(leftv r, char *a, char *s)
int exprlist_length(leftv v)
BOOLEAN iiTestAssume(leftv a, leftv b)
void iiSetReturn(const leftv source)
BOOLEAN iiAssignCR(leftv r, leftv arg)
idhdl rFindHdl(ring r, idhdl n)
BOOLEAN iiExport(leftv v, int toLev)
void singular_example(char *str)
matrix mpNew(int r, int c)
create a r x c zero-matrix
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
rRingOrder_t rOrderName(char *ordername)
ring rDefault(const coeffs cf, int N, char **n, int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl, unsigned long bitmask)
ideal idInit(int idsize, int rank)
initialise an ideal / module
void syMake(leftv v, const char *id, package pa)
INST_VAR sleftv sLastPrinted
void syMakeMonom(leftv v, const char *id)
int name
New type name for int.
void writeRTime(const char *v)
void writeTime(const char *v)