00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #define SL_BISON 1
00047
00048
00049 #define SL_BISON_VERSION "2.4.1"
00050
00051
00052 #define SL_SKELETON_NAME "yacc.c"
00053
00054
00055 #define SL_PURE 0
00056
00057
00058 #define SL_PUSH 0
00059
00060
00061 #define SL_PULL 1
00062
00063
00064 #define SL_LSP_NEEDED 0
00065
00066
00067
00068
00069
00070
00071 #line 7 "sl_gram.y"
00072
00073
00074 #include <stdio.h>
00075 #include <stdlib.h>
00076 #include <string.h>
00077
00078 #include "boolean.h"
00079 #include "arithmetique.h"
00080 #include "vecteur.h"
00081 #include "contrainte.h"
00082 #include "sc.h"
00083 #include "malloc.h"
00084 #include "union.h"
00085
00086
00087 extern char slx_text[];
00088 Psysteme ps_yacc;
00089 boolean syntax_error;
00090 Value valcst;
00091 Value fac;
00092
00093 int sens;
00094
00095
00096 short int cote;
00097 Value b1, b2;
00098
00099 Pcontrainte eq;
00100 Pvecteur cp ;
00101 short int operat;
00102
00103 extern Pcontrainte p_eg_fin;
00104 extern Pcontrainte p_ineg_fin;
00105 extern Pvecteur p_pred;
00106 extern Pvecteur p_membre_courant;
00107 extern Pvecteur cp;
00108 Psyslist sl_yacc; Pbase ba_yacc; Variable va_yacc;
00109
00110
00111 #define OPINF 1
00112 #define OPINFEGAL 2
00113 #define OPEGAL 3
00114 #define OPSUPEGAL 4
00115 #define OPSUP 5
00116 #define DROIT 1
00117 #define GAUCHE 2
00118
00119
00120
00121
00122
00123 #line 124 "y.tab.c"
00124
00125
00126 #ifndef SL_DEBUG
00127 # define SL_DEBUG 0
00128 #endif
00129
00130
00131 #ifdef SL_ERROR_VERBOSE
00132 # undef SL_ERROR_VERBOSE
00133 # define SL_ERROR_VERBOSE 1
00134 #else
00135 # define SL_ERROR_VERBOSE 0
00136 #endif
00137
00138
00139 #ifndef SL_TOKEN_TABLE
00140 # define SL_TOKEN_TABLE 0
00141 #endif
00142
00143
00144
00145 #ifndef SL_TOKENTYPE
00146 # define SL_TOKENTYPE
00147
00148
00149 enum slx_tokentype {
00150 ACCFERM = 1,
00151 ACCOUVR = 2,
00152 CONSTANTE = 3,
00153 EGAL = 4,
00154 IDENT = 5,
00155 INF = 6,
00156 INFEGAL = 7,
00157 MOINS = 8,
00158 PLUS = 9,
00159 SUP = 10,
00160 SUPEGAL = 11,
00161 VAR = 12,
00162 VIRG = 13
00163 };
00164 #endif
00165
00166 #define ACCFERM 1
00167 #define ACCOUVR 2
00168 #define CONSTANTE 3
00169 #define EGAL 4
00170 #define IDENT 5
00171 #define INF 6
00172 #define INFEGAL 7
00173 #define MOINS 8
00174 #define PLUS 9
00175 #define SUP 10
00176 #define SUPEGAL 11
00177 #define VAR 12
00178 #define VIRG 13
00179
00180
00181
00182
00183 #if ! defined SL_STYPE && ! defined SL_STYPE_IS_DECLARED
00184 typedef union SL_STYPE
00185 {
00186
00187
00188 #line 74 "sl_gram.y"
00189
00190 Value Value;
00191 Variable Variable;
00192
00193
00194
00195
00196 #line 197 "y.tab.c"
00197 } SL_STYPE;
00198 # define SL_STYPE_IS_TRIVIAL 1
00199 # define slx_stype SL_STYPE
00200 # define SL_STYPE_IS_DECLARED 1
00201 #endif
00202
00203
00204
00205
00206
00207
00208 #line 209 "y.tab.c"
00209
00210 #ifdef short
00211 # undef short
00212 #endif
00213
00214 #ifdef SL_TYPE_UINT8
00215 typedef SL_TYPE_UINT8 slx_type_uint8;
00216 #else
00217 typedef unsigned char slx_type_uint8;
00218 #endif
00219
00220 #ifdef SL_TYPE_INT8
00221 typedef SL_TYPE_INT8 slx_type_int8;
00222 #elif (defined __STDC__ || defined __C99__FUNC__ \
00223 || defined __cplusplus || defined _MSC_VER)
00224 typedef signed char slx_type_int8;
00225 #else
00226 typedef short int slx_type_int8;
00227 #endif
00228
00229 #ifdef SL_TYPE_UINT16
00230 typedef SL_TYPE_UINT16 slx_type_uint16;
00231 #else
00232 typedef unsigned short int slx_type_uint16;
00233 #endif
00234
00235 #ifdef SL_TYPE_INT16
00236 typedef SL_TYPE_INT16 slx_type_int16;
00237 #else
00238 typedef short int slx_type_int16;
00239 #endif
00240
00241 #ifndef SL_SIZE_T
00242 # ifdef __SIZE_TYPE__
00243 # define SL_SIZE_T __SIZE_TYPE__
00244 # elif defined size_t
00245 # define SL_SIZE_T size_t
00246 # elif ! defined SL_SIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
00247 || defined __cplusplus || defined _MSC_VER)
00248 # include <stddef.h>
00249 # define SL_SIZE_T size_t
00250 # else
00251 # define SL_SIZE_T unsigned int
00252 # endif
00253 #endif
00254
00255 #define SL_SIZE_MAXIMUM ((SL_SIZE_T) -1)
00256
00257 #ifndef SL__
00258 # if SL_ENABLE_NLS
00259 # if ENABLE_NLS
00260 # include <libintl.h>
00261 # define SL__(msgid) dgettext ("bison-runtime", msgid)
00262 # endif
00263 # endif
00264 # ifndef SL__
00265 # define SL__(msgid) msgid
00266 # endif
00267 #endif
00268
00269
00270 #if ! defined lint || defined __GNUC__
00271 # define SL_USE(e) ((void) (e))
00272 #else
00273 # define SL_USE(e)
00274 #endif
00275
00276
00277 #ifndef lint
00278 # define SL_ID(n) (n)
00279 #else
00280 #if (defined __STDC__ || defined __C99__FUNC__ \
00281 || defined __cplusplus || defined _MSC_VER)
00282 static int
00283 SL_ID (int slx_i)
00284 #else
00285 static int
00286 SL_ID (slx_i)
00287 int slx_i;
00288 #endif
00289 {
00290 return slx_i;
00291 }
00292 #endif
00293
00294 #if ! defined slx_overflow || SL_ERROR_VERBOSE
00295
00296
00297
00298 # ifdef SL_STACK_USE_ALLOCA
00299 # if SL_STACK_USE_ALLOCA
00300 # ifdef __GNUC__
00301 # define SL_STACK_ALLOC __builtin_alloca
00302 # elif defined __BUILTIN_VA_ARG_INCR
00303 # include <alloca.h>
00304 # elif defined _AIX
00305 # define SL_STACK_ALLOC __alloca
00306 # elif defined _MSC_VER
00307 # include <malloc.h>
00308 # define alloca _alloca
00309 # else
00310 # define SL_STACK_ALLOC alloca
00311 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00312 || defined __cplusplus || defined _MSC_VER)
00313 # include <stdlib.h>
00314 # ifndef _STDLIB_H
00315 # define _STDLIB_H 1
00316 # endif
00317 # endif
00318 # endif
00319 # endif
00320 # endif
00321
00322 # ifdef SL_STACK_ALLOC
00323
00324 # define SL_STACK_FREE(Ptr) do { ; } while (SL_ID (0))
00325 # ifndef SL_STACK_ALLOC_MAXIMUM
00326
00327
00328
00329
00330 # define SL_STACK_ALLOC_MAXIMUM 4032
00331 # endif
00332 # else
00333 # define SL_STACK_ALLOC SL_MALLOC
00334 # define SL_STACK_FREE SL_FREE
00335 # ifndef SL_STACK_ALLOC_MAXIMUM
00336 # define SL_STACK_ALLOC_MAXIMUM SL_SIZE_MAXIMUM
00337 # endif
00338 # if (defined __cplusplus && ! defined _STDLIB_H \
00339 && ! ((defined SL_MALLOC || defined malloc) \
00340 && (defined SL_FREE || defined free)))
00341 # include <stdlib.h>
00342 # ifndef _STDLIB_H
00343 # define _STDLIB_H 1
00344 # endif
00345 # endif
00346 # ifndef SL_MALLOC
00347 # define SL_MALLOC malloc
00348 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00349 || defined __cplusplus || defined _MSC_VER)
00350 void *malloc (SL_SIZE_T);
00351 # endif
00352 # endif
00353 # ifndef SL_FREE
00354 # define SL_FREE free
00355 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00356 || defined __cplusplus || defined _MSC_VER)
00357 void free (void *);
00358 # endif
00359 # endif
00360 # endif
00361 #endif
00362
00363
00364 #if (! defined slx_overflow \
00365 && (! defined __cplusplus \
00366 || (defined SL_STYPE_IS_TRIVIAL && SL_STYPE_IS_TRIVIAL)))
00367
00368
00369 union slx_alloc
00370 {
00371 slx_type_int16 slx_ss_alloc;
00372 SL_STYPE slx_vs_alloc;
00373 };
00374
00375
00376 # define SL_STACK_GAP_MAXIMUM (sizeof (union slx_alloc) - 1)
00377
00378
00379
00380 # define SL_STACK_BYTES(N) \
00381 ((N) * (sizeof (slx_type_int16) + sizeof (SL_STYPE)) \
00382 + SL_STACK_GAP_MAXIMUM)
00383
00384
00385
00386 # ifndef SL_COPY
00387 # if defined __GNUC__ && 1 < __GNUC__
00388 # define SL_COPY(To, From, Count) \
00389 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
00390 # else
00391 # define SL_COPY(To, From, Count) \
00392 do \
00393 { \
00394 SL_SIZE_T slx_i; \
00395 for (slx_i = 0; slx_i < (Count); slx_i++) \
00396 (To)[slx_i] = (From)[slx_i]; \
00397 } \
00398 while (SL_ID (0))
00399 # endif
00400 # endif
00401
00402
00403
00404
00405
00406
00407 # define SL_STACK_RELOCATE(Stack_alloc, Stack) \
00408 do \
00409 { \
00410 SL_SIZE_T slx_newbytes; \
00411 SL_COPY (&slx_ptr->Stack_alloc, Stack, slx_size); \
00412 Stack = &slx_ptr->Stack_alloc; \
00413 slx_newbytes = slx_stacksize * sizeof (*Stack) + SL_STACK_GAP_MAXIMUM; \
00414 slx_ptr += slx_newbytes / sizeof (*slx_ptr); \
00415 } \
00416 while (SL_ID (0))
00417
00418 #endif
00419
00420
00421 #define SL_FINAL 3
00422
00423 #define SL_LAST 31
00424
00425
00426 #define SL_NTOKENS 16
00427
00428 #define SL_NNTS 25
00429
00430 #define SL_NRULES 40
00431
00432 #define SL_NSTATES 49
00433
00434
00435 #define SL_UNDEFTOK 2
00436 #define SL_MAXUTOK 257
00437
00438 #define SL_TRANSLATE(SL_X) \
00439 ((unsigned int) (SL_X) <= SL_MAXUTOK ? slx_translate[SL_X] : SL_UNDEFTOK)
00440
00441
00442 static const slx_type_uint8 slx_translate[] =
00443 {
00444 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
00445 12, 13, 14, 15, 2, 2, 2, 2, 2, 2,
00446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00464 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00465 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00466 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00467 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00469 2, 2, 2, 2, 2, 2, 1, 2
00470 };
00471
00472 #if SL_DEBUG
00473
00474
00475 static const slx_type_uint8 slx_prhs[] =
00476 {
00477 0, 0, 3, 8, 9, 10, 13, 15, 19, 21,
00478 23, 26, 33, 34, 35, 37, 41, 42, 49, 50,
00479 51, 54, 55, 58, 62, 65, 67, 69, 71, 73,
00480 75, 77, 79, 81, 83, 85, 87, 89, 94, 95,
00481 97
00482 };
00483
00484
00485 static const slx_type_int8 slx_rhs[] =
00486 {
00487 17, 0, -1, 18, 20, 23, 19, -1, -1, -1,
00488 14, 21, -1, 22, -1, 21, 15, 22, -1, 7,
00489 -1, 24, -1, 24, 23, -1, 25, 4, 27, 40,
00490 3, 26, -1, -1, -1, 28, -1, 27, 15, 28,
00491 -1, -1, 29, 38, 36, 31, 39, 30, -1, -1,
00492 -1, 37, 33, -1, -1, 32, 33, -1, 31, 37,
00493 33, -1, 35, 34, -1, 35, -1, 34, -1, 7,
00494 -1, 5, -1, 8, -1, 9, -1, 6, -1, 12,
00495 -1, 13, -1, 11, -1, 10, -1, 31, -1, 38,
00496 36, 31, 39, -1, -1, 15, -1, -1
00497 };
00498
00499
00500 static const slx_type_uint16 slx_rline[] =
00501 {
00502 0, 82, 82, 86, 93, 98, 101, 102, 105, 112,
00503 113, 116, 120, 128, 139, 140, 141, 144, 148, 161,
00504 166, 167, 167, 168, 171, 183, 195, 206, 221, 227,
00505 235, 243, 251, 259, 268, 270, 274, 275, 279, 307,
00506 308
00507 };
00508 #endif
00509
00510 #if SL_DEBUG || SL_ERROR_VERBOSE || SL_TOKEN_TABLE
00511
00512
00513 static const char *const slx_tname[] =
00514 {
00515 "$end", "error", "$undefined", "ACCFERM", "ACCOUVR", "CONSTANTE",
00516 "EGAL", "IDENT", "INF", "INFEGAL", "MOINS", "PLUS", "SUP", "SUPEGAL",
00517 "VAR", "VIRG", "$accept", "s_list", "inisl", "endsl", "defvar", "l_var",
00518 "newid", "l_sys", "system", "inisys", "endsys", "l_eq", "eq", "debeq",
00519 "feq", "membre", "$@1", "terme", "ident", "const", "op", "addop",
00520 "multi_membre", "fin_mult_membre", "virg_opt", 0
00521 };
00522 #endif
00523
00524 # ifdef SL_PRINT
00525
00526
00527 static const slx_type_uint16 slx_toknum[] =
00528 {
00529 0, 256, 257, 1, 2, 3, 4, 5, 6, 7,
00530 8, 9, 10, 11, 12, 13
00531 };
00532 # endif
00533
00534
00535 static const slx_type_uint8 slx_r1[] =
00536 {
00537 0, 16, 17, 18, 19, 20, 21, 21, 22, 23,
00538 23, 24, 25, 26, 27, 27, 27, 28, 29, 30,
00539 31, 32, 31, 31, 33, 33, 33, 34, 35, 36,
00540 36, 36, 36, 36, 37, 37, 38, 38, 39, 40,
00541 40
00542 };
00543
00544
00545 static const slx_type_uint8 slx_r2[] =
00546 {
00547 0, 2, 4, 0, 0, 2, 1, 3, 1, 1,
00548 2, 6, 0, 0, 1, 3, 0, 6, 0, 0,
00549 2, 0, 2, 3, 2, 1, 1, 1, 1, 1,
00550 1, 1, 1, 1, 1, 1, 1, 4, 0, 1,
00551 0
00552 };
00553
00554
00555
00556
00557 static const slx_type_uint8 slx_defact[] =
00558 {
00559 3, 0, 0, 1, 0, 12, 8, 5, 6, 4,
00560 9, 0, 0, 2, 10, 18, 7, 40, 14, 21,
00561 18, 0, 35, 34, 36, 0, 0, 0, 15, 13,
00562 0, 28, 27, 22, 26, 25, 20, 31, 29, 30,
00563 32, 33, 21, 11, 23, 24, 38, 37, 17
00564 };
00565
00566
00567 static const slx_type_int8 slx_defgoto[] =
00568 {
00569 -1, 1, 2, 13, 5, 7, 8, 9, 10, 11,
00570 43, 17, 18, 19, 48, 24, 25, 33, 34, 35,
00571 42, 26, 27, 47, 21
00572 };
00573
00574
00575
00576 #define SL_PACT_NINF -25
00577 static const slx_type_int8 slx_pact[] =
00578 {
00579 -25, 7, 2, -25, 11, -25, -25, 4, -25, -25,
00580 16, 17, 11, -25, -25, -2, -25, 8, -25, 1,
00581 21, 22, -25, -25, 1, 10, 10, -3, -25, -25,
00582 10, -25, -25, -25, -25, 19, -25, -25, -25, -25,
00583 -25, -25, 1, -25, -25, -25, 1, -1, -25
00584 };
00585
00586
00587 static const slx_type_int8 slx_pgoto[] =
00588 {
00589 -25, -25, -25, -25, -25, -25, 15, 18, -25, -25,
00590 -25, -25, 9, -25, -25, -12, -25, -22, -4, -25,
00591 -25, -24, -25, -25, -25
00592 };
00593
00594
00595
00596
00597
00598 #define SL_TABLE_NINF -40
00599 static const slx_type_int8 slx_table[] =
00600 {
00601 30, -16, -19, 37, 36, 38, 39, 3, 44, 40,
00602 41, 22, 23, -16, -19, 31, 4, 32, 6, 12,
00603 -12, 15, 30, 20, -39, 29, 32, 16, 14, 28,
00604 46, 45
00605 };
00606
00607 static const slx_type_uint8 slx_check[] =
00608 {
00609 24, 3, 3, 6, 26, 8, 9, 0, 30, 12,
00610 13, 10, 11, 15, 15, 5, 14, 7, 7, 15,
00611 4, 4, 46, 15, 3, 3, 7, 12, 10, 20,
00612 42, 35
00613 };
00614
00615
00616
00617 static const slx_type_uint8 slx_stos[] =
00618 {
00619 0, 17, 18, 0, 14, 20, 7, 21, 22, 23,
00620 24, 25, 15, 19, 23, 4, 22, 27, 28, 29,
00621 15, 40, 10, 11, 31, 32, 37, 38, 28, 3,
00622 37, 5, 7, 33, 34, 35, 33, 6, 8, 9,
00623 12, 13, 36, 26, 33, 34, 31, 39, 30
00624 };
00625
00626 #define slx_errok (slx_errstatus = 0)
00627 #define slx_clearin (slx_char = SL_EMPTY)
00628 #define SL_EMPTY (-2)
00629 #define SL_EOF 0
00630
00631 #define SL_ACCEPT goto slx_acceptlab
00632 #define SL_ABORT goto slx_abortlab
00633 #define SL_ERROR goto slx_errorlab
00634
00635
00636
00637
00638
00639
00640 #define SL_FAIL goto slx_errlab
00641
00642 #define SL_RECOVERING() (!!slx_errstatus)
00643
00644 #define SL_BACKUP(Token, Value) \
00645 do \
00646 if (slx_char == SL_EMPTY && slx_len == 1) \
00647 { \
00648 slx_char = (Token); \
00649 slx_lval = (Value); \
00650 slx_token = SL_TRANSLATE (slx_char); \
00651 SL_POPSTACK (1); \
00652 goto slx_backup; \
00653 } \
00654 else \
00655 { \
00656 slx_error (SL__("syntax error: cannot back up")); \
00657 SL_ERROR; \
00658 } \
00659 while (SL_ID (0))
00660
00661
00662 #define SL_TERROR 1
00663 #define SL_ERRCODE 256
00664
00665
00666
00667
00668
00669
00670 #define SL_RHSLOC(Rhs, K) ((Rhs)[K])
00671 #ifndef SL_LLOC_DEFAULT
00672 # define SL_LLOC_DEFAULT(Current, Rhs, N) \
00673 do \
00674 if (SL_ID (N)) \
00675 { \
00676 (Current).first_line = SL_RHSLOC (Rhs, 1).first_line; \
00677 (Current).first_column = SL_RHSLOC (Rhs, 1).first_column; \
00678 (Current).last_line = SL_RHSLOC (Rhs, N).last_line; \
00679 (Current).last_column = SL_RHSLOC (Rhs, N).last_column; \
00680 } \
00681 else \
00682 { \
00683 (Current).first_line = (Current).last_line = \
00684 SL_RHSLOC (Rhs, 0).last_line; \
00685 (Current).first_column = (Current).last_column = \
00686 SL_RHSLOC (Rhs, 0).last_column; \
00687 } \
00688 while (SL_ID (0))
00689 #endif
00690
00691
00692
00693
00694
00695
00696 #ifndef SL__LOCATION_PRINT
00697 # if SL_LTYPE_IS_TRIVIAL
00698 # define SL__LOCATION_PRINT(File, Loc) \
00699 fprintf (File, "%d.%d-%d.%d", \
00700 (Loc).first_line, (Loc).first_column, \
00701 (Loc).last_line, (Loc).last_column)
00702 # else
00703 # define SL__LOCATION_PRINT(File, Loc) ((void) 0)
00704 # endif
00705 #endif
00706
00707
00708
00709
00710 #ifdef SL_LEX_PARAM
00711 # define SL_LEX slx_lex (SL_LEX_PARAM)
00712 #else
00713 # define SL_LEX slx_lex ()
00714 #endif
00715
00716
00717 #if SL_DEBUG
00718
00719 # ifndef SL_FPRINTF
00720 # include <stdio.h>
00721 # define SL_FPRINTF fprintf
00722 # endif
00723
00724 # define SL_DPRINTF(Args) \
00725 do { \
00726 if (slx_debug) \
00727 SL_FPRINTF Args; \
00728 } while (SL_ID (0))
00729
00730 # define SL__SYMBOL_PRINT(Title, Type, Value, Location) \
00731 do { \
00732 if (slx_debug) \
00733 { \
00734 SL_FPRINTF (stderr, "%s ", Title); \
00735 slx__symbol_print (stderr, \
00736 Type, Value); \
00737 SL_FPRINTF (stderr, "\n"); \
00738 } \
00739 } while (SL_ID (0))
00740
00741
00742
00743
00744
00745
00746
00747 #if (defined __STDC__ || defined __C99__FUNC__ \
00748 || defined __cplusplus || defined _MSC_VER)
00749 static void
00750 slx__symbol_value_print (FILE *slx_output, int slx_type, SL_STYPE const * const slx_valuep)
00751 #else
00752 static void
00753 slx__symbol_value_print (slx_output, slx_type, slx_valuep)
00754 FILE *slx_output;
00755 int slx_type;
00756 SL_STYPE const * const slx_valuep;
00757 #endif
00758 {
00759 if (!slx_valuep)
00760 return;
00761 # ifdef SL_PRINT
00762 if (slx_type < SL_NTOKENS)
00763 SL_PRINT (slx_output, slx_toknum[slx_type], *slx_valuep);
00764 # else
00765 SL_USE (slx_output);
00766 # endif
00767 switch (slx_type)
00768 {
00769 default:
00770 break;
00771 }
00772 }
00773
00774
00775
00776
00777
00778
00779 #if (defined __STDC__ || defined __C99__FUNC__ \
00780 || defined __cplusplus || defined _MSC_VER)
00781 static void
00782 slx__symbol_print (FILE *slx_output, int slx_type, SL_STYPE const * const slx_valuep)
00783 #else
00784 static void
00785 slx__symbol_print (slx_output, slx_type, slx_valuep)
00786 FILE *slx_output;
00787 int slx_type;
00788 SL_STYPE const * const slx_valuep;
00789 #endif
00790 {
00791 if (slx_type < SL_NTOKENS)
00792 SL_FPRINTF (slx_output, "token %s (", slx_tname[slx_type]);
00793 else
00794 SL_FPRINTF (slx_output, "nterm %s (", slx_tname[slx_type]);
00795
00796 slx__symbol_value_print (slx_output, slx_type, slx_valuep);
00797 SL_FPRINTF (slx_output, ")");
00798 }
00799
00800
00801
00802
00803
00804
00805 #if (defined __STDC__ || defined __C99__FUNC__ \
00806 || defined __cplusplus || defined _MSC_VER)
00807 static void
00808 slx__stack_print (slx_type_int16 *slx_bottom, slx_type_int16 *slx_top)
00809 #else
00810 static void
00811 slx__stack_print (slx_bottom, slx_top)
00812 slx_type_int16 *slx_bottom;
00813 slx_type_int16 *slx_top;
00814 #endif
00815 {
00816 SL_FPRINTF (stderr, "Stack now");
00817 for (; slx_bottom <= slx_top; slx_bottom++)
00818 {
00819 int slx_bot = *slx_bottom;
00820 SL_FPRINTF (stderr, " %d", slx_bot);
00821 }
00822 SL_FPRINTF (stderr, "\n");
00823 }
00824
00825 # define SL__STACK_PRINT(Bottom, Top) \
00826 do { \
00827 if (slx_debug) \
00828 slx__stack_print ((Bottom), (Top)); \
00829 } while (SL_ID (0))
00830
00831
00832
00833
00834
00835
00836 #if (defined __STDC__ || defined __C99__FUNC__ \
00837 || defined __cplusplus || defined _MSC_VER)
00838 static void
00839 slx__reduce_print (SL_STYPE *slx_vsp, int slx_rule)
00840 #else
00841 static void
00842 slx__reduce_print (slx_vsp, slx_rule)
00843 SL_STYPE *slx_vsp;
00844 int slx_rule;
00845 #endif
00846 {
00847 int slx_nrhs = slx_r2[slx_rule];
00848 int slx_i;
00849 unsigned long int slx_lno = slx_rline[slx_rule];
00850 SL_FPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
00851 slx_rule - 1, slx_lno);
00852
00853 for (slx_i = 0; slx_i < slx_nrhs; slx_i++)
00854 {
00855 SL_FPRINTF (stderr, " $%d = ", slx_i + 1);
00856 slx__symbol_print (stderr, slx_rhs[slx_prhs[slx_rule] + slx_i],
00857 &(slx_vsp[(slx_i + 1) - (slx_nrhs)])
00858 );
00859 SL_FPRINTF (stderr, "\n");
00860 }
00861 }
00862
00863 # define SL__REDUCE_PRINT(Rule) \
00864 do { \
00865 if (slx_debug) \
00866 slx__reduce_print (slx_vsp, Rule); \
00867 } while (SL_ID (0))
00868
00869
00870
00871 int slx_debug;
00872 #else
00873 # define SL_DPRINTF(Args)
00874 # define SL__SYMBOL_PRINT(Title, Type, Value, Location)
00875 # define SL__STACK_PRINT(Bottom, Top)
00876 # define SL__REDUCE_PRINT(Rule)
00877 #endif
00878
00879
00880
00881 #ifndef SL_INITDEPTH
00882 # define SL_INITDEPTH 200
00883 #endif
00884
00885
00886
00887
00888
00889
00890
00891
00892 #ifndef SL_MAXDEPTH
00893 # define SL_MAXDEPTH 10000
00894 #endif
00895
00896
00897
00898 #if SL_ERROR_VERBOSE
00899
00900 # ifndef slx_strlen
00901 # if defined __GLIBC__ && defined _STRING_H
00902 # define slx_strlen strlen
00903 # else
00904
00905 #if (defined __STDC__ || defined __C99__FUNC__ \
00906 || defined __cplusplus || defined _MSC_VER)
00907 static SL_SIZE_T
00908 slx_strlen (const char *slx_str)
00909 #else
00910 static SL_SIZE_T
00911 slx_strlen (slx_str)
00912 const char *slx_str;
00913 #endif
00914 {
00915 SL_SIZE_T slx_len;
00916 for (slx_len = 0; slx_str[slx_len]; slx_len++)
00917 continue;
00918 return slx_len;
00919 }
00920 # endif
00921 # endif
00922
00923 # ifndef slx_stpcpy
00924 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
00925 # define slx_stpcpy stpcpy
00926 # else
00927
00928
00929 #if (defined __STDC__ || defined __C99__FUNC__ \
00930 || defined __cplusplus || defined _MSC_VER)
00931 static char *
00932 slx_stpcpy (char *slx_dest, const char *slx_src)
00933 #else
00934 static char *
00935 slx_stpcpy (slx_dest, slx_src)
00936 char *slx_dest;
00937 const char *slx_src;
00938 #endif
00939 {
00940 char *slx_d = slx_dest;
00941 const char *slx_s = slx_src;
00942
00943 while ((*slx_d++ = *slx_s++) != '\0')
00944 continue;
00945
00946 return slx_d - 1;
00947 }
00948 # endif
00949 # endif
00950
00951 # ifndef slx_tnamerr
00952
00953
00954
00955
00956
00957
00958
00959 static SL_SIZE_T
00960 slx_tnamerr (char *slx_res, const char *slx_str)
00961 {
00962 if (*slx_str == '"')
00963 {
00964 SL_SIZE_T slx_n = 0;
00965 char const *slx_p = slx_str;
00966
00967 for (;;)
00968 switch (*++slx_p)
00969 {
00970 case '\'':
00971 case ',':
00972 goto do_not_strip_quotes;
00973
00974 case '\\':
00975 if (*++slx_p != '\\')
00976 goto do_not_strip_quotes;
00977
00978 default:
00979 if (slx_res)
00980 slx_res[slx_n] = *slx_p;
00981 slx_n++;
00982 break;
00983
00984 case '"':
00985 if (slx_res)
00986 slx_res[slx_n] = '\0';
00987 return slx_n;
00988 }
00989 do_not_strip_quotes: ;
00990 }
00991
00992 if (! slx_res)
00993 return slx_strlen (slx_str);
00994
00995 return slx_stpcpy (slx_res, slx_str) - slx_res;
00996 }
00997 # endif
00998
00999
01000
01001
01002
01003
01004
01005
01006 static SL_SIZE_T
01007 slx_syntax_error (char *slx_result, int slx_state, int slx_char)
01008 {
01009 int slx_n = slx_pact[slx_state];
01010
01011 if (! (SL_PACT_NINF < slx_n && slx_n <= SL_LAST))
01012 return 0;
01013 else
01014 {
01015 int slx_type = SL_TRANSLATE (slx_char);
01016 SL_SIZE_T slx_size0 = slx_tnamerr (0, slx_tname[slx_type]);
01017 SL_SIZE_T slx_size = slx_size0;
01018 SL_SIZE_T slx_size1;
01019 int slx_size_overflow = 0;
01020 enum { SL_ERROR_VERBOSE_ARGS_MAXIMUM = 5 };
01021 char const *slx_arg[SL_ERROR_VERBOSE_ARGS_MAXIMUM];
01022 int slx_x;
01023
01024 # if 0
01025
01026
01027 SL__("syntax error, unexpected %s");
01028 SL__("syntax error, unexpected %s, expecting %s");
01029 SL__("syntax error, unexpected %s, expecting %s or %s");
01030 SL__("syntax error, unexpected %s, expecting %s or %s or %s");
01031 SL__("syntax error, unexpected %s, expecting %s or %s or %s or %s");
01032 # endif
01033 char *slx_fmt;
01034 char const *slx_f;
01035 static char const slx_unexpected[] = "syntax error, unexpected %s";
01036 static char const slx_expecting[] = ", expecting %s";
01037 static char const slx_or[] = " or %s";
01038 char slx_format[sizeof slx_unexpected
01039 + sizeof slx_expecting - 1
01040 + ((SL_ERROR_VERBOSE_ARGS_MAXIMUM - 2)
01041 * (sizeof slx_or - 1))];
01042 char const *slx_prefix = slx_expecting;
01043
01044
01045
01046 int slx_xbegin = slx_n < 0 ? -slx_n : 0;
01047
01048
01049 int slx_checklim = SL_LAST - slx_n + 1;
01050 int slx_xend = slx_checklim < SL_NTOKENS ? slx_checklim : SL_NTOKENS;
01051 int slx_count = 1;
01052
01053 slx_arg[0] = slx_tname[slx_type];
01054 slx_fmt = slx_stpcpy (slx_format, slx_unexpected);
01055
01056 for (slx_x = slx_xbegin; slx_x < slx_xend; ++slx_x)
01057 if (slx_check[slx_x + slx_n] == slx_x && slx_x != SL_TERROR)
01058 {
01059 if (slx_count == SL_ERROR_VERBOSE_ARGS_MAXIMUM)
01060 {
01061 slx_count = 1;
01062 slx_size = slx_size0;
01063 slx_format[sizeof slx_unexpected - 1] = '\0';
01064 break;
01065 }
01066 slx_arg[slx_count++] = slx_tname[slx_x];
01067 slx_size1 = slx_size + slx_tnamerr (0, slx_tname[slx_x]);
01068 slx_size_overflow |= (slx_size1 < slx_size);
01069 slx_size = slx_size1;
01070 slx_fmt = slx_stpcpy (slx_fmt, slx_prefix);
01071 slx_prefix = slx_or;
01072 }
01073
01074 slx_f = SL__(slx_format);
01075 slx_size1 = slx_size + slx_strlen (slx_f);
01076 slx_size_overflow |= (slx_size1 < slx_size);
01077 slx_size = slx_size1;
01078
01079 if (slx_size_overflow)
01080 return SL_SIZE_MAXIMUM;
01081
01082 if (slx_result)
01083 {
01084
01085
01086
01087 char *slx_p = slx_result;
01088 int slx_i = 0;
01089 while ((*slx_p = *slx_f) != '\0')
01090 {
01091 if (*slx_p == '%' && slx_f[1] == 's' && slx_i < slx_count)
01092 {
01093 slx_p += slx_tnamerr (slx_p, slx_arg[slx_i++]);
01094 slx_f += 2;
01095 }
01096 else
01097 {
01098 slx_p++;
01099 slx_f++;
01100 }
01101 }
01102 }
01103 return slx_size;
01104 }
01105 }
01106 #endif
01107
01108
01109
01110
01111
01112
01113
01114 #if (defined __STDC__ || defined __C99__FUNC__ \
01115 || defined __cplusplus || defined _MSC_VER)
01116 static void
01117 slx_destruct (const char *slx_msg, int slx_type, SL_STYPE *slx_valuep)
01118 #else
01119 static void
01120 slx_destruct (slx_msg, slx_type, slx_valuep)
01121 const char *slx_msg;
01122 int slx_type;
01123 SL_STYPE *slx_valuep;
01124 #endif
01125 {
01126 SL_USE (slx_valuep);
01127
01128 if (!slx_msg)
01129 slx_msg = "Deleting";
01130 SL__SYMBOL_PRINT (slx_msg, slx_type, slx_valuep, slx_locationp);
01131
01132 switch (slx_type)
01133 {
01134
01135 default:
01136 break;
01137 }
01138 }
01139
01140
01141 #ifdef SL_PARSE_PARAM
01142 #if defined __STDC__ || defined __cplusplus
01143 int slx_parse (void *SL_PARSE_PARAM);
01144 #else
01145 int slx_parse ();
01146 #endif
01147 #else
01148 #if defined __STDC__ || defined __cplusplus
01149 int slx_parse (void);
01150 #else
01151 int slx_parse ();
01152 #endif
01153 #endif
01154
01155
01156
01157 int slx_char;
01158
01159
01160 SL_STYPE slx_lval;
01161
01162
01163 int slx_nerrs;
01164
01165
01166
01167
01168
01169
01170
01171 #ifdef SL_PARSE_PARAM
01172 #if (defined __STDC__ || defined __C99__FUNC__ \
01173 || defined __cplusplus || defined _MSC_VER)
01174 int
01175 slx_parse (void *SL_PARSE_PARAM)
01176 #else
01177 int
01178 slx_parse (SL_PARSE_PARAM)
01179 void *SL_PARSE_PARAM;
01180 #endif
01181 #else
01182 #if (defined __STDC__ || defined __C99__FUNC__ \
01183 || defined __cplusplus || defined _MSC_VER)
01184 int
01185 slx_parse (void)
01186 #else
01187 int
01188 slx_parse ()
01189
01190 #endif
01191 #endif
01192 {
01193
01194
01195 int slx_state;
01196
01197 int slx_errstatus;
01198
01199
01200
01201
01202
01203
01204
01205
01206
01207 slx_type_int16 slx_ssa[SL_INITDEPTH];
01208 slx_type_int16 *slx_ss;
01209 slx_type_int16 *slx_ssp;
01210
01211
01212 SL_STYPE slx_vsa[SL_INITDEPTH];
01213 SL_STYPE *slx_vs;
01214 SL_STYPE *slx_vsp;
01215
01216 SL_SIZE_T slx_stacksize;
01217
01218 int slx_n;
01219 int slx_result;
01220
01221 int slx_token;
01222
01223
01224 SL_STYPE slx_val;
01225
01226 #if SL_ERROR_VERBOSE
01227
01228 char slx_msgbuf[128];
01229 char *slx_msg = slx_msgbuf;
01230 SL_SIZE_T slx_msg_alloc = sizeof slx_msgbuf;
01231 #endif
01232
01233 #define SL_POPSTACK(N) (slx_vsp -= (N), slx_ssp -= (N))
01234
01235
01236
01237 int slx_len = 0;
01238
01239 slx_token = 0;
01240 slx_ss = slx_ssa;
01241 slx_vs = slx_vsa;
01242 slx_stacksize = SL_INITDEPTH;
01243
01244 SL_DPRINTF ((stderr, "Starting parse\n"));
01245
01246 slx_state = 0;
01247 slx_errstatus = 0;
01248 slx_nerrs = 0;
01249 slx_char = SL_EMPTY;
01250
01251
01252
01253
01254
01255 slx_ssp = slx_ss;
01256 slx_vsp = slx_vs;
01257
01258 goto slx_setstate;
01259
01260
01261
01262
01263 slx_newstate:
01264
01265
01266 slx_ssp++;
01267
01268 slx_setstate:
01269 *slx_ssp = slx_state;
01270
01271 if (slx_ss + slx_stacksize - 1 <= slx_ssp)
01272 {
01273
01274 SL_SIZE_T slx_size = slx_ssp - slx_ss + 1;
01275
01276 #ifdef slx_overflow
01277 {
01278
01279
01280
01281 SL_STYPE *slx_vs1 = slx_vs;
01282 slx_type_int16 *slx_ss1 = slx_ss;
01283
01284
01285
01286
01287
01288 slx_overflow (SL__("memory exhausted"),
01289 &slx_ss1, slx_size * sizeof (*slx_ssp),
01290 &slx_vs1, slx_size * sizeof (*slx_vsp),
01291 &slx_stacksize);
01292
01293 slx_ss = slx_ss1;
01294 slx_vs = slx_vs1;
01295 }
01296 #else
01297 # ifndef SL_STACK_RELOCATE
01298 goto slx_exhaustedlab;
01299 # else
01300
01301 if (SL_MAXDEPTH <= slx_stacksize)
01302 goto slx_exhaustedlab;
01303 slx_stacksize *= 2;
01304 if (SL_MAXDEPTH < slx_stacksize)
01305 slx_stacksize = SL_MAXDEPTH;
01306
01307 {
01308 slx_type_int16 *slx_ss1 = slx_ss;
01309 union slx_alloc *slx_ptr =
01310 (union slx_alloc *) SL_STACK_ALLOC (SL_STACK_BYTES (slx_stacksize));
01311 if (! slx_ptr)
01312 goto slx_exhaustedlab;
01313 SL_STACK_RELOCATE (slx_ss_alloc, slx_ss);
01314 SL_STACK_RELOCATE (slx_vs_alloc, slx_vs);
01315 # undef SL_STACK_RELOCATE
01316 if (slx_ss1 != slx_ssa)
01317 SL_STACK_FREE (slx_ss1);
01318 }
01319 # endif
01320 #endif
01321
01322 slx_ssp = slx_ss + slx_size - 1;
01323 slx_vsp = slx_vs + slx_size - 1;
01324
01325 SL_DPRINTF ((stderr, "Stack size increased to %lu\n",
01326 (unsigned long int) slx_stacksize));
01327
01328 if (slx_ss + slx_stacksize - 1 <= slx_ssp)
01329 SL_ABORT;
01330 }
01331
01332 SL_DPRINTF ((stderr, "Entering state %d\n", slx_state));
01333
01334 if (slx_state == SL_FINAL)
01335 SL_ACCEPT;
01336
01337 goto slx_backup;
01338
01339
01340
01341
01342 slx_backup:
01343
01344
01345
01346
01347
01348 slx_n = slx_pact[slx_state];
01349 if (slx_n == SL_PACT_NINF)
01350 goto slx_default;
01351
01352
01353
01354
01355 if (slx_char == SL_EMPTY)
01356 {
01357 SL_DPRINTF ((stderr, "Reading a token: "));
01358 slx_char = SL_LEX;
01359 }
01360
01361 if (slx_char <= SL_EOF)
01362 {
01363 slx_char = slx_token = SL_EOF;
01364 SL_DPRINTF ((stderr, "Now at end of input.\n"));
01365 }
01366 else
01367 {
01368 slx_token = SL_TRANSLATE (slx_char);
01369 SL__SYMBOL_PRINT ("Next token is", slx_token, &slx_lval, &slx_lloc);
01370 }
01371
01372
01373
01374 slx_n += slx_token;
01375 if (slx_n < 0 || SL_LAST < slx_n || slx_check[slx_n] != slx_token)
01376 goto slx_default;
01377 slx_n = slx_table[slx_n];
01378 if (slx_n <= 0)
01379 {
01380 if (slx_n == 0 || slx_n == SL_TABLE_NINF)
01381 goto slx_errlab;
01382 slx_n = -slx_n;
01383 goto slx_reduce;
01384 }
01385
01386
01387
01388 if (slx_errstatus)
01389 slx_errstatus--;
01390
01391
01392 SL__SYMBOL_PRINT ("Shifting", slx_token, &slx_lval, &slx_lloc);
01393
01394
01395 slx_char = SL_EMPTY;
01396
01397 slx_state = slx_n;
01398 *++slx_vsp = slx_lval;
01399
01400 goto slx_newstate;
01401
01402
01403
01404
01405
01406 slx_default:
01407 slx_n = slx_defact[slx_state];
01408 if (slx_n == 0)
01409 goto slx_errlab;
01410 goto slx_reduce;
01411
01412
01413
01414
01415
01416 slx_reduce:
01417
01418 slx_len = slx_r2[slx_n];
01419
01420
01421
01422
01423
01424
01425
01426
01427
01428 slx_val = slx_vsp[1-slx_len];
01429
01430
01431 SL__REDUCE_PRINT (slx_n);
01432 switch (slx_n)
01433 {
01434 case 3:
01435
01436
01437 #line 86 "sl_gram.y"
01438 {
01439 sl_yacc = NULL;
01440 syntax_error = FALSE;
01441 }
01442 break;
01443
01444 case 4:
01445
01446
01447 #line 93 "sl_gram.y"
01448 {
01449 vect_rm( (Pvecteur) ba_yacc ); ba_yacc = NULL;
01450 }
01451 break;
01452
01453 case 8:
01454
01455
01456 #line 106 "sl_gram.y"
01457 {
01458 if(!base_contains_variable_p(ba_yacc, (Variable) slx_text))
01459 ba_yacc = vect_add_variable(ba_yacc, (Variable) strdup(slx_text));
01460 }
01461 break;
01462
01463 case 12:
01464
01465
01466 #line 120 "sl_gram.y"
01467 {
01468
01469 ps_yacc = sc_new();
01470 init_globals();
01471 }
01472 break;
01473
01474 case 13:
01475
01476
01477 #line 128 "sl_gram.y"
01478 {
01479
01480 if (ps_yacc != NULL) {
01481 ps_yacc->base = NULL;
01482 sc_creer_base( ps_yacc );
01483 }
01484 sl_yacc = sl_append_system_first( sl_yacc, ps_yacc );
01485 }
01486 break;
01487
01488 case 18:
01489
01490
01491 #line 148 "sl_gram.y"
01492 {
01493 fac = VALUE_ONE;
01494 sens = 1;
01495 cote = GAUCHE;
01496 b1 = 0;
01497 b2 = 0;
01498 operat = 0;
01499 cp = NULL;
01500 eq = contrainte_new();
01501 }
01502 break;
01503
01504 case 19:
01505
01506
01507 #line 161 "sl_gram.y"
01508 {
01509 contrainte_free(eq);
01510 }
01511 break;
01512
01513 case 21:
01514
01515
01516 #line 167 "sl_gram.y"
01517 { fac = VALUE_ONE;}
01518 break;
01519
01520 case 24:
01521
01522
01523 #line 172 "sl_gram.y"
01524 {
01525 if (cote==DROIT)
01526 value_oppose(fac);
01527
01528
01529 vect_add_elem(&(eq->vecteur), (Variable) (slx_vsp[(2) - (2)].Variable),value_mult(fac,(slx_vsp[(1) - (2)].Value)));
01530
01531
01532 if (operat) vect_add_elem(&cp,(Variable) (slx_vsp[(2) - (2)].Variable),
01533 value_uminus(value_mult(fac,(slx_vsp[(1) - (2)].Value))));
01534 }
01535 break;
01536
01537 case 25:
01538
01539
01540 #line 184 "sl_gram.y"
01541 {
01542 Value v = value_mult(fac,(slx_vsp[(1) - (1)].Value));
01543 if (cote==DROIT)
01544 {
01545 value_addto(b1,v); value_substract(b2,v);
01546 }
01547 else
01548 {
01549 value_addto(b2,v); value_substract(b1,v);
01550 }
01551 }
01552 break;
01553
01554 case 26:
01555
01556
01557 #line 196 "sl_gram.y"
01558 {
01559 if (cote==DROIT) value_oppose(fac);
01560
01561
01562 vect_add_elem (&(eq->vecteur),(Variable) (slx_vsp[(1) - (1)].Variable),fac);
01563
01564 if (operat) vect_add_elem(&cp,(Variable) (slx_vsp[(1) - (1)].Variable),value_uminus(fac));
01565 }
01566 break;
01567
01568 case 27:
01569
01570
01571 #line 207 "sl_gram.y"
01572 {
01573 va_yacc = base_find_variable_name(ba_yacc,
01574 (Variable) slx_text,
01575 variable_default_name);
01576 if(VARIABLE_UNDEFINED_P(va_yacc)) {
01577 (void) fprintf(stderr,
01578 "Variable %s not declared. Add it to the VAR list!\n",
01579 variable_default_name((Variable) slx_text));
01580 exit(1);
01581 }
01582 (slx_val.Variable) = va_yacc;
01583 }
01584 break;
01585
01586 case 28:
01587
01588
01589 #line 222 "sl_gram.y"
01590 { sscan_Value(slx_text, &valcst);
01591 (slx_val.Value) = (Value) valcst;
01592 }
01593 break;
01594
01595 case 29:
01596
01597
01598 #line 228 "sl_gram.y"
01599 {
01600 cote = DROIT;
01601 sens = 1;
01602 operat = OPINF;
01603 cp = NULL;
01604 b2 = 0;
01605 }
01606 break;
01607
01608 case 30:
01609
01610
01611 #line 236 "sl_gram.y"
01612 {
01613 cote = DROIT;
01614 sens = 1;
01615 operat = OPINFEGAL;
01616 cp = NULL;
01617 b2 = 0;
01618 }
01619 break;
01620
01621 case 31:
01622
01623
01624 #line 244 "sl_gram.y"
01625 {
01626 cote = DROIT;
01627 sens = 1;
01628 operat = OPEGAL;
01629 cp = NULL;
01630 b2 = 0;
01631 }
01632 break;
01633
01634 case 32:
01635
01636
01637 #line 252 "sl_gram.y"
01638 {
01639 cote = DROIT;
01640 sens = -1;
01641 operat = OPSUP;
01642 cp = NULL;
01643 b2 = 0;
01644 }
01645 break;
01646
01647 case 33:
01648
01649
01650 #line 260 "sl_gram.y"
01651 {
01652 cote = DROIT;
01653 sens = -1;
01654 operat = OPSUPEGAL;
01655 cp = NULL;
01656 b2 = 0;
01657 }
01658 break;
01659
01660 case 34:
01661
01662
01663 #line 269 "sl_gram.y"
01664 { fac = VALUE_ONE; }
01665 break;
01666
01667 case 35:
01668
01669
01670 #line 271 "sl_gram.y"
01671 { fac = VALUE_MONE; }
01672 break;
01673
01674 case 38:
01675
01676
01677 #line 279 "sl_gram.y"
01678 {
01679 vect_add_elem(&(eq->vecteur),TCST,value_uminus(b1));
01680 switch (operat) {
01681 case OPINF:
01682 creer_ineg(ps_yacc,eq,sens);
01683 vect_add_elem(&(eq->vecteur),TCST,VALUE_ONE);
01684 break;
01685 case OPINFEGAL:
01686 creer_ineg(ps_yacc,eq,sens);
01687 break;
01688 case OPSUPEGAL:
01689 creer_ineg(ps_yacc,eq,sens);
01690 break;
01691 case OPSUP:
01692 creer_ineg(ps_yacc,eq,sens);
01693 vect_add_elem (&(eq->vecteur),TCST,VALUE_ONE);
01694 break;
01695 case OPEGAL:
01696 creer_eg(ps_yacc,eq);
01697 break;
01698 }
01699
01700 eq = contrainte_new();
01701 eq->vecteur = cp;
01702 b1 = b2;
01703 }
01704 break;
01705
01706
01707
01708
01709 #line 1710 "y.tab.c"
01710 default: break;
01711 }
01712 SL__SYMBOL_PRINT ("-> $$ =", slx_r1[slx_n], &slx_val, &slx_loc);
01713
01714 SL_POPSTACK (slx_len);
01715 slx_len = 0;
01716 SL__STACK_PRINT (slx_ss, slx_ssp);
01717
01718 *++slx_vsp = slx_val;
01719
01720
01721
01722
01723
01724 slx_n = slx_r1[slx_n];
01725
01726 slx_state = slx_pgoto[slx_n - SL_NTOKENS] + *slx_ssp;
01727 if (0 <= slx_state && slx_state <= SL_LAST && slx_check[slx_state] == *slx_ssp)
01728 slx_state = slx_table[slx_state];
01729 else
01730 slx_state = slx_defgoto[slx_n - SL_NTOKENS];
01731
01732 goto slx_newstate;
01733
01734
01735
01736
01737
01738 slx_errlab:
01739
01740 if (!slx_errstatus)
01741 {
01742 ++slx_nerrs;
01743 #if ! SL_ERROR_VERBOSE
01744 slx_error (SL__("syntax error"));
01745 #else
01746 {
01747 SL_SIZE_T slx_size = slx_syntax_error (0, slx_state, slx_char);
01748 if (slx_msg_alloc < slx_size && slx_msg_alloc < SL_STACK_ALLOC_MAXIMUM)
01749 {
01750 SL_SIZE_T slx_alloc = 2 * slx_size;
01751 if (! (slx_size <= slx_alloc && slx_alloc <= SL_STACK_ALLOC_MAXIMUM))
01752 slx_alloc = SL_STACK_ALLOC_MAXIMUM;
01753 if (slx_msg != slx_msgbuf)
01754 SL_STACK_FREE (slx_msg);
01755 slx_msg = (char *) SL_STACK_ALLOC (slx_alloc);
01756 if (slx_msg)
01757 slx_msg_alloc = slx_alloc;
01758 else
01759 {
01760 slx_msg = slx_msgbuf;
01761 slx_msg_alloc = sizeof slx_msgbuf;
01762 }
01763 }
01764
01765 if (0 < slx_size && slx_size <= slx_msg_alloc)
01766 {
01767 (void) slx_syntax_error (slx_msg, slx_state, slx_char);
01768 slx_error (slx_msg);
01769 }
01770 else
01771 {
01772 slx_error (SL__("syntax error"));
01773 if (slx_size != 0)
01774 goto slx_exhaustedlab;
01775 }
01776 }
01777 #endif
01778 }
01779
01780
01781
01782 if (slx_errstatus == 3)
01783 {
01784
01785
01786
01787 if (slx_char <= SL_EOF)
01788 {
01789
01790 if (slx_char == SL_EOF)
01791 SL_ABORT;
01792 }
01793 else
01794 {
01795 slx_destruct ("Error: discarding",
01796 slx_token, &slx_lval);
01797 slx_char = SL_EMPTY;
01798 }
01799 }
01800
01801
01802
01803 goto slx_errlab1;
01804
01805
01806
01807
01808
01809 slx_errorlab:
01810
01811
01812
01813
01814 if ( 0)
01815 goto slx_errorlab;
01816
01817
01818
01819 SL_POPSTACK (slx_len);
01820 slx_len = 0;
01821 SL__STACK_PRINT (slx_ss, slx_ssp);
01822 slx_state = *slx_ssp;
01823 goto slx_errlab1;
01824
01825
01826
01827
01828
01829 slx_errlab1:
01830 slx_errstatus = 3;
01831
01832 for (;;)
01833 {
01834 slx_n = slx_pact[slx_state];
01835 if (slx_n != SL_PACT_NINF)
01836 {
01837 slx_n += SL_TERROR;
01838 if (0 <= slx_n && slx_n <= SL_LAST && slx_check[slx_n] == SL_TERROR)
01839 {
01840 slx_n = slx_table[slx_n];
01841 if (0 < slx_n)
01842 break;
01843 }
01844 }
01845
01846
01847 if (slx_ssp == slx_ss)
01848 SL_ABORT;
01849
01850
01851 slx_destruct ("Error: popping",
01852 slx_stos[slx_state], slx_vsp);
01853 SL_POPSTACK (1);
01854 slx_state = *slx_ssp;
01855 SL__STACK_PRINT (slx_ss, slx_ssp);
01856 }
01857
01858 *++slx_vsp = slx_lval;
01859
01860
01861
01862 SL__SYMBOL_PRINT ("Shifting", slx_stos[slx_n], slx_vsp, slx_lsp);
01863
01864 slx_state = slx_n;
01865 goto slx_newstate;
01866
01867
01868
01869
01870
01871 slx_acceptlab:
01872 slx_result = 0;
01873 goto slx_return;
01874
01875
01876
01877
01878 slx_abortlab:
01879 slx_result = 1;
01880 goto slx_return;
01881
01882 #if !defined(slx_overflow) || SL_ERROR_VERBOSE
01883
01884
01885
01886 slx_exhaustedlab:
01887 slx_error (SL__("memory exhausted"));
01888 slx_result = 2;
01889
01890 #endif
01891
01892 slx_return:
01893 if (slx_char != SL_EMPTY)
01894 slx_destruct ("Cleanup: discarding lookahead",
01895 slx_token, &slx_lval);
01896
01897
01898 SL_POPSTACK (slx_len);
01899 SL__STACK_PRINT (slx_ss, slx_ssp);
01900 while (slx_ssp != slx_ss)
01901 {
01902 slx_destruct ("Cleanup: popping",
01903 slx_stos[*slx_ssp], slx_vsp);
01904 SL_POPSTACK (1);
01905 }
01906 #ifndef slx_overflow
01907 if (slx_ss != slx_ssa)
01908 SL_STACK_FREE (slx_ss);
01909 #endif
01910 #if SL_ERROR_VERBOSE
01911 if (slx_msg != slx_msgbuf)
01912 SL_STACK_FREE (slx_msg);
01913 #endif
01914
01915 return SL_ID (slx_result);
01916 }
01917
01918
01919
01920
01921 #line 311 "sl_gram.y"
01922
01923
01924 int slx_error(s)
01925 char *s;
01926 {
01927
01928 int c;
01929 (void) fprintf(stderr,"%s near %s\n",s,slx_text);
01930 while ((c = getchar()) != EOF) putchar(c);
01931 syntax_error = TRUE;
01932 return 0;
01933 }
01934
01935