#include <stdio.h>#include <stdlib.h>#include <string.h>#include "boolean.h"#include "arithmetique.h"#include "vecteur.h"#include "contrainte.h"#include "sc.h"#include "malloc.h"#include "union.h"Go to the source code of this file.
Data Structures | |
| union | SL_STYPE |
| union | slx_alloc |
| ! defined slx_overflow || SL_ERROR_VERBOSE More... | |
Defines | |
| #define | SL_BISON 1 |
| A Bison parser, made by GNU Bison 2.4.1. | |
| #define | SL_BISON_VERSION "2.4.1" |
| Bison version. | |
| #define | SL_SKELETON_NAME "yacc.c" |
| Skeleton name. | |
| #define | SL_PURE 0 |
| Pure parsers. | |
| #define | SL_PUSH 0 |
| Push parsers. | |
| #define | SL_PULL 1 |
| Pull parsers. | |
| #define | SL_LSP_NEEDED 0 |
| Using locations. | |
| #define | OPINF 1 |
| ode des operateurs de comparaison | |
| #define | OPINFEGAL 2 |
| #define | OPEGAL 3 |
| #define | OPSUPEGAL 4 |
| #define | OPSUP 5 |
| #define | DROIT 1 |
| #define | GAUCHE 2 |
| #define | SL_DEBUG 0 |
| define NULL 0 | |
| #define | SL_ERROR_VERBOSE 0 |
| Enabling verbose error messages. | |
| #define | SL_TOKEN_TABLE 0 |
| Enabling the token table. | |
| #define | ACCFERM 1 |
| Tokens. | |
| #define | ACCOUVR 2 |
| #define | CONSTANTE 3 |
| #define | EGAL 4 |
| #define | IDENT 5 |
| #define | INF 6 |
| #define | INFEGAL 7 |
| #define | MOINS 8 |
| #define | PLUS 9 |
| #define | SUP 10 |
| #define | SUPEGAL 11 |
| #define | VAR 12 |
| #define | VIRG 13 |
| #define | SL_STYPE_IS_TRIVIAL 1 |
| #define | slx_stype SL_STYPE |
| #define | SL_STYPE_IS_DECLARED 1 |
| #define | SL_SIZE_T unsigned int |
| #define | SL_SIZE_MAXIMUM ((SL_SIZE_T) -1) |
| #define | SL__(msgid) msgid |
| #define | SL_USE(e) ((void) (e)) |
| Suppress unused-variable warnings by "using" E. | |
| #define | SL_ID(n) (n) |
| Identity function, used to suppress warnings about constant conditions. | |
| #define | SL_STACK_ALLOC SL_MALLOC |
| The parser invokes alloca or malloc; define the necessary symbols. | |
| #define | SL_STACK_FREE SL_FREE |
| #define | SL_STACK_ALLOC_MAXIMUM SL_SIZE_MAXIMUM |
| #define | SL_MALLOC malloc |
| #define | SL_FREE free |
| #define | SL_STACK_GAP_MAXIMUM (sizeof (union slx_alloc) - 1) |
| The size of the maximum gap between one aligned stack and the next. | |
| #define | SL_STACK_BYTES(N) |
| The size of an array large to enough to hold all stacks, each with N elements. | |
| #define | SL_COPY(To, From, Count) |
| Copy COUNT objects from FROM to TO. | |
| #define | SL_STACK_RELOCATE(Stack_alloc, Stack) |
| Relocate STACK from its old location to the new one. | |
| #define | SL_FINAL 3 |
| SL_FINAL -- State number of the termination state. | |
| #define | SL_LAST 31 |
| SL_LAST -- Last index in SL_TABLE. | |
| #define | SL_NTOKENS 16 |
| SL_NTOKENS -- Number of terminals. | |
| #define | SL_NNTS 25 |
| SL_NNTS -- Number of nonterminals. | |
| #define | SL_NRULES 40 |
| SL_NRULES -- Number of rules. | |
| #define | SL_NSTATES 49 |
| SL_NRULES -- Number of states. | |
| #define | SL_UNDEFTOK 2 |
| SL_TRANSLATE(SL_LEX) -- Bison symbol number corresponding to SL_LEX. | |
| #define | SL_MAXUTOK 257 |
| #define | SL_TRANSLATE(SL_X) ((unsigned int) (SL_X) <= SL_MAXUTOK ? slx_translate[SL_X] : SL_UNDEFTOK) |
| #define | SL_PACT_NINF -25 |
| SL_PACT[STATE-NUM] -- Index in SL_TABLE of the portion describing STATE-NUM. | |
| #define | SL_TABLE_NINF -40 |
| SL_TABLE[SL_PACT[STATE-NUM]]. | |
| #define | slx_errok (slx_errstatus = 0) |
| #define | slx_clearin (slx_char = SL_EMPTY) |
| #define | SL_EMPTY (-2) |
| #define | SL_EOF 0 |
| #define | SL_ACCEPT goto slx_acceptlab |
| #define | SL_ABORT goto slx_abortlab |
| #define | SL_ERROR goto slx_errorlab |
| #define | SL_FAIL goto slx_errlab |
| Like SL_ERROR except do call slx_error. | |
| #define | SL_RECOVERING() (!!slx_errstatus) |
| #define | SL_BACKUP(Token, Value) |
| #define | SL_TERROR 1 |
| #define | SL_ERRCODE 256 |
| #define | SL_RHSLOC(Rhs, K) ((Rhs)[K]) |
| SL_LLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. | |
| #define | SL_LLOC_DEFAULT(Current, Rhs, N) |
| #define | SL__LOCATION_PRINT(File, Loc) ((void) 0) |
| SL__LOCATION_PRINT -- Print the location on the stream. | |
| #define | SL_LEX slx_lex () |
| SL_LEX -- calling `slx_lex' with the right arguments. | |
| #define | SL_DPRINTF(Args) |
| Enable debugging if requested. | |
| #define | SL__SYMBOL_PRINT(Title, Type, Value, Location) |
| #define | SL__STACK_PRINT(Bottom, Top) |
| #define | SL__REDUCE_PRINT(Rule) |
| #define | SL_INITDEPTH 200 |
| !SL_DEBUG | |
| #define | SL_MAXDEPTH 10000 |
| SL_MAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). | |
| #define | SL_POPSTACK(N) (slx_vsp -= (N), slx_ssp -= (N)) |
Typedefs | |
| typedef unsigned char | slx_type_uint8 |
| Copy the second part of user declarations. | |
| typedef short int | slx_type_int8 |
| typedef unsigned short int | slx_type_uint16 |
| typedef short int | slx_type_int16 |
Enumerations | |
| enum | slx_tokentype { ACCFERM = 1, ACCOUVR = 2, CONSTANTE = 3, EGAL = 4, IDENT = 5, INF = 6, INFEGAL = 7, MOINS = 8, PLUS = 9, SUP = 10, SUPEGAL = 11, VAR = 12, VIRG = 13, ACCFERM = 1, ACCOUVR = 2, CONSTANTE = 3, EGAL = 4, IDENT = 5, INF = 6, INFEGAL = 7, MOINS = 8, PLUS = 9, SUP = 10, SUPEGAL = 11, VAR = 12, VIRG = 13 } |
| Tokens. More... | |
Functions | |
| static void | slx_destruct (char *slx_msg, int slx_type, SL_STYPE *slx_valuep) const |
| SL_ERROR_VERBOSE. | |
| int | slx_parse () |
| Prevent warnings from -Wmissing-prototypes. | |
| int | slx_error (char *s) |
| Line 1675 of yacc.c. | |
Variables | |
| char | slx_text [] |
| Copy the first part of user declarations. | |
| Psysteme | ps_yacc |
| dialogue avec l'analyseur lexical | |
| boolean | syntax_error |
| Value | valcst |
| Value | fac |
| int | sens |
| facteur multiplicatif suivant qu'on analyse un terme | |
| short int | cote |
| indique le sens de l'inegalite sens = -1 ==> l'operateur est soit > ,soit >=, sens = 1 ==> l'operateur est soit <, soit <= | |
| Value | b1 |
| booleen indiquant quel membre est en cours d'analyse | |
| Value | b2 |
| Pcontrainte | eq |
| element du vecteur colonne du systeme donne par l'analyse d'une contrainte | |
| Pvecteur | cp |
| pointeur sur l'egalite ou l'inegalite courante | |
| short int | operat |
| pointeur sur le membre courant | |
| Pcontrainte | p_eg_fin |
| dernier operateur rencontre | |
| Pcontrainte | p_ineg_fin |
| pointeur sur la derniere inegalite | |
| Pvecteur | p_pred |
| pointeur sur le predecesseur du couple courant | |
| Pvecteur | p_membre_courant |
| Psyslist | sl_yacc |
| Pbase | ba_yacc = vect_add_variable(ba_yacc, (Variable) strdup(yytext)) |
| Variable | va_yacc |
| static const slx_type_uint8 | slx_translate [] |
| SL_TRANSLATE[SL_LEX] -- Bison symbol number corresponding to SL_LEX. | |
| static const slx_type_uint8 | slx_r1 [] |
| SL_R1[SL_N] -- Symbol number of symbol that rule SL_N derives. | |
| static const slx_type_uint8 | slx_r2 [] |
| SL_R2[SL_N] -- Number of symbols composing right hand side of rule SL_N. | |
| static const slx_type_uint8 | slx_defact [] |
| SL_DEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when SL_TABLE doesn't specify something else to do. | |
| static const slx_type_int8 | slx_defgoto [] |
| SL_DEFGOTO[NTERM-NUM]. | |
| static const slx_type_int8 | slx_pact [] |
| static const slx_type_int8 | slx_pgoto [] |
| SL_PGOTO[NTERM-NUM]. | |
| static const slx_type_int8 | slx_table [] |
| static const slx_type_uint8 | slx_check [] |
| static const slx_type_uint8 | slx_stos [] |
| SL_STOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. | |
| int | slx_char |
| ! SL_PARSE_PARAM | |
| SL_STYPE | slx_lval |
| The semantic value of the lookahead symbol. | |
| int | slx_nerrs |
| Number of syntax errors so far. | |
| #define SL__ | ( | msgid | ) | msgid |
| #define SL__LOCATION_PRINT | ( | File, | |||
| Loc | ) | ((void) 0) |
| #define SL__REDUCE_PRINT | ( | Rule | ) |
| #define SL__STACK_PRINT | ( | Bottom, | |||
| Top | ) |
| #define SL__SYMBOL_PRINT | ( | Title, | |||
| Type, | |||||
| Value, | |||||
| Location | ) |
| #define SL_ABORT goto slx_abortlab |
| #define SL_ACCEPT goto slx_acceptlab |
| #define SL_BACKUP | ( | Token, | |||
| Value | ) |
| #define SL_BISON 1 |
A Bison parser, made by GNU Bison 2.4.1.
Skeleton implementation for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception.
This special exception was added by the Free Software Foundation in version 2.2 of Bison. C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. All symbols defined below should begin with slx_ or SL_, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. Identify Bison output.
| #define SL_COPY | ( | To, | |||
| From, | |||||
| Count | ) |
| #define SL_DEBUG 0 |
| #define SL_DPRINTF | ( | Args | ) |
Enable debugging if requested.
!SL_DEBUG
Definition at line 873 of file sl_gram.c.
Referenced by slx_parse().
| #define SL_EMPTY (-2) |
| #define SL_EOF 0 |
| #define SL_ERROR_VERBOSE 0 |
| #define SL_FAIL goto slx_errlab |
| #define SL_FINAL 3 |
SL_FINAL -- State number of the termination state.
Definition at line 421 of file sl_gram.c.
Referenced by slx_parse().
Identity function, used to suppress warnings about constant conditions.
Definition at line 278 of file sl_gram.c.
Referenced by slx_parse().
| #define SL_INITDEPTH 200 |
!SL_DEBUG
SL_INITDEPTH -- initial size of the parser's stacks.
Definition at line 882 of file sl_gram.c.
Referenced by slx_parse().
| #define SL_LAST 31 |
SL_LAST -- Last index in SL_TABLE.
Definition at line 423 of file sl_gram.c.
Referenced by slx_parse().
| #define SL_LEX slx_lex () |
SL_LEX -- calling `slx_lex' with the right arguments.
Definition at line 713 of file sl_gram.c.
Referenced by slx_parse().
| #define SL_LLOC_DEFAULT | ( | Current, | |||
| Rhs, | |||||
| N | ) |
Value:
do \ if (SL_ID (N)) \ { \ (Current).first_line = SL_RHSLOC (Rhs, 1).first_line; \ (Current).first_column = SL_RHSLOC (Rhs, 1).first_column; \ (Current).last_line = SL_RHSLOC (Rhs, N).last_line; \ (Current).last_column = SL_RHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ SL_RHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ SL_RHSLOC (Rhs, 0).last_column; \ } \ while (SL_ID (0))
| #define SL_MAXDEPTH 10000 |
SL_MAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used).
Do not make this value too large; the results are undefined if SL_STACK_ALLOC_MAXIMUM < SL_STACK_BYTES (SL_MAXDEPTH) evaluated with infinite-precision integer arithmetic.
Definition at line 893 of file sl_gram.c.
Referenced by slx_parse().
| #define SL_NTOKENS 16 |
SL_NTOKENS -- Number of terminals.
Definition at line 426 of file sl_gram.c.
Referenced by slx_parse().
| #define SL_PACT_NINF -25 |
SL_PACT[STATE-NUM] -- Index in SL_TABLE of the portion describing STATE-NUM.
Definition at line 576 of file sl_gram.c.
Referenced by slx_parse().
| #define SL_POPSTACK | ( | N | ) | (slx_vsp -= (N), slx_ssp -= (N)) |
Referenced by slx_parse().
| #define SL_RHSLOC | ( | Rhs, | |||
| K | ) | ((Rhs)[K]) |
| #define SL_SIZE_T unsigned int |
| #define SL_STACK_ALLOC SL_MALLOC |
The parser invokes alloca or malloc; define the necessary symbols.
Definition at line 333 of file sl_gram.c.
Referenced by slx_parse().
| #define SL_STACK_ALLOC_MAXIMUM SL_SIZE_MAXIMUM |
| #define SL_STACK_BYTES | ( | N | ) |
Value:
((N) * (sizeof (slx_type_int16) + sizeof (SL_STYPE)) \ + SL_STACK_GAP_MAXIMUM)
Definition at line 380 of file sl_gram.c.
Referenced by slx_parse().
| #define SL_STACK_FREE SL_FREE |
| #define SL_STACK_GAP_MAXIMUM (sizeof (union slx_alloc) - 1) |
| #define SL_STACK_RELOCATE | ( | Stack_alloc, | |||
| Stack | ) |
Value:
do \ { \ SL_SIZE_T slx_newbytes; \ SL_COPY (&slx_ptr->Stack_alloc, Stack, slx_size); \ Stack = &slx_ptr->Stack_alloc; \ slx_newbytes = slx_stacksize * sizeof (*Stack) + SL_STACK_GAP_MAXIMUM; \ slx_ptr += slx_newbytes / sizeof (*slx_ptr); \ } \ while (SL_ID (0))
The local variables SL_SIZE and SL_STACKSIZE give the old and new number of elements in the stack, and SL_PTR gives the new location of the stack. Advance SL_PTR to a properly aligned location for the next stack.
Definition at line 407 of file sl_gram.c.
Referenced by slx_parse().
| #define SL_TABLE_NINF -40 |
SL_TABLE[SL_PACT[STATE-NUM]].
What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what SL_DEFACT says. If SL_TABLE_NINF, syntax error.
Definition at line 598 of file sl_gram.c.
Referenced by slx_parse().
| #define SL_TERROR 1 |
| #define SL_TRANSLATE | ( | SL_X | ) | ((unsigned int) (SL_X) <= SL_MAXUTOK ? slx_translate[SL_X] : SL_UNDEFTOK) |
| #define SL_UNDEFTOK 2 |
SL_TRANSLATE(SL_LEX) -- Bison symbol number corresponding to SL_LEX.
| #define SL_USE | ( | e | ) | ((void) (e)) |
Suppress unused-variable warnings by "using" E.
Definition at line 271 of file sl_gram.c.
Referenced by slx_destruct().
| typedef short int slx_type_int16 |
| typedef short int slx_type_int8 |
| typedef unsigned short int slx_type_uint16 |
| typedef unsigned char slx_type_uint8 |
| enum slx_tokentype |
Tokens.
Put the tokens into the symbol table, so that GDB and other debuggers know about them.
| ACCFERM | |
| ACCOUVR | |
| CONSTANTE | |
| EGAL | |
| IDENT | |
| INF | |
| INFEGAL | |
| MOINS | |
| PLUS | |
| SUP | |
| SUPEGAL | |
| VAR | |
| VIRG | |
| ACCFERM | |
| ACCOUVR | |
| CONSTANTE | |
| EGAL | |
| IDENT | |
| INF | |
| INFEGAL | |
| MOINS | |
| PLUS | |
| SUP | |
| SUPEGAL | |
| VAR | |
| VIRG |
Definition at line 149 of file sl_gram.c.
00149 { 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 };
| static void slx_destruct | ( | char * | slx_msg, | |
| int | slx_type, | |||
| SL_STYPE * | slx_valuep | |||
| ) | const [static] |
SL_ERROR_VERBOSE.
----------------------------------------------. | Release the memory associated to this symbol. | `----------------------------------------------- RGSUSED
Definition at line 1120 of file sl_gram.c.
References SL__SYMBOL_PRINT, and SL_USE.
Referenced by slx_parse().
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 }
| int slx_error | ( | char * | s | ) |
Line 1675 of yacc.c.
procedure minimum de recouvrement d'erreurs
Definition at line 1924 of file sl_gram.c.
References c, fprintf(), slx_text, syntax_error, and TRUE.
Referenced by slx_parse().
01926 { 01927 /* procedure minimum de recouvrement d'erreurs */ 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 }
| int slx_parse | ( | ) |
Prevent warnings from -Wmissing-prototypes.
------------------------.
! SL_PARSE_PARAM
| slx_parse or slx_push_parse. | `------------------------- ! SL_PARSE_PARAM
Number of tokens to shift before error messages enabled.
The stacks and their tools: `slx_ss': related to states. `slx_vs': related to semantic values.
Refer to the stacks thru separate pointers, to allow slx_overflow to reallocate them elsewhere.
The state stack.
The semantic value stack.
Lookahead token as an internal (translated) token number.
The variables used to return semantic value and location from the action routines.
The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped.
Cause a token to be read.
Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized.
-----------------------------------------------------------. | slx_newstate -- Push a new state, which is found in slx_state. | `------------------------------------------------------------
In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks.
Get the current used size of the three stacks, in elements.
no slx_overflow
Extend the stack our own way.
no slx_overflow
----------. | slx_backup. | `-----------
Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one.
First try to decide what to do without reference to lookahead token.
Not known => get a lookahead token if don't already have one.
SL_CHAR is either SL_EMPTY or SL_EOF or a valid lookahead symbol.
If the proper action on seeing token SL_TOKEN is to reduce or to detect an error, take that action.
Count tokens shifted since error; after three, turn off error status.
Shift the lookahead token.
Discard the shifted token.
----------------------------------------------------------. | slx_default -- do the default action for the current state. | `-----------------------------------------------------------
----------------------------. | slx_reduce -- Do a reduction. | `-----------------------------
slx_n is the number of a rule to reduce with.
If SL_LEN is nonzero, implement the default value of the action: `$$ = $1'.
Otherwise, the following line sets SL_VAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to SL_VAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that SL_VAL may be used uninitialized.
Line 1455 of yacc.c
Initialisation de la liste des systemes
Line 1455 of yacc.c
Fin de la list des systemes
Line 1455 of yacc.c
Line 1455 of yacc.c
initialisation des parametres de la liste de systemes
et initialisation des variables
Line 1455 of yacc.c
on rajoute le systeme trouve a la liste
Line 1455 of yacc.c
Line 1455 of yacc.c
Line 1455 of yacc.c
Line 1455 of yacc.c
ajout du couple (ident,const) a la contrainte courante
duplication du couple (ident,const) de la combinaison lineaire traitee
Line 1455 of yacc.c
Line 1455 of yacc.c
ajout du couple (ident,1) a la contrainte courante
duplication du couple (ident,1) de la combinaison lineaire traitee
Line 1455 of yacc.c
Line 1455 of yacc.c
Line 1455 of yacc.c
Line 1455 of yacc.c
Line 1455 of yacc.c
Line 1455 of yacc.c
Line 1455 of yacc.c
Line 1455 of yacc.c
Line 1455 of yacc.c
Line 1455 of yacc.c
Line 1455 of yacc.c
Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by.
-----------------------------------. | slx_errlab -- here on detecting error | `------------------------------------
If not already recovering from an error, report this error.
If just tried and failed to reuse lookahead token after an error, discard it.
Return failure if at end of input.
Else will try to reuse lookahead token after shifting the error token.
--------------------------------------------------. | slx_errorlab -- error raised explicitly by SL_ERROR. | `---------------------------------------------------
Pacify compilers like GCC when the user code never invokes SL_ERROR and the label slx_errorlab therefore never appears in user code.
ONSTCOND
Do not reclaim the symbols of the rule which action triggered this SL_ERROR.
------------------------------------------------------------. | slx_errlab1 -- common code for both syntax error and SL_ERROR. | `-------------------------------------------------------------
Each real token shifted decrements this.
Pop the current state because it cannot handle the error token.
Shift the error token.
------------------------------------. | slx_acceptlab -- SL_ACCEPT comes here. | `-------------------------------------
----------------------------------. | slx_abortlab -- SL_ABORT comes here. | `-----------------------------------
------------------------------------------------. | slx_exhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------
Fall through.
Do not reclaim the symbols of the rule which action triggered this SL_ABORT or SL_ACCEPT.
Make sure SL_ID is used.
Definition at line 1188 of file sl_gram.c.
References b1, b2, base_contains_variable_p(), base_find_variable_name(), contrainte_free(), contrainte_new(), cote, cp, creer_eg(), creer_ineg(), DROIT, exit(), fac, FALSE, fprintf(), GAUCHE, init_globals(), NULL, OPEGAL, operat, OPINF, OPINFEGAL, OPSUP, OPSUPEGAL, ps_yacc, sc_creer_base(), sc_new(), sens, SL__, SL__REDUCE_PRINT, SL__STACK_PRINT, SL__SYMBOL_PRINT, SL_ABORT, SL_ACCEPT, sl_append_system_first(), SL_DPRINTF, SL_EMPTY, SL_EOF, SL_FINAL, SL_ID, SL_INITDEPTH, SL_LAST, SL_LEX, SL_MAXDEPTH, SL_NTOKENS, SL_PACT_NINF, SL_POPSTACK, SL_SIZE_T, SL_STACK_ALLOC, SL_STACK_ALLOC_MAXIMUM, SL_STACK_BYTES, SL_STACK_FREE, SL_STACK_RELOCATE, SL_TABLE_NINF, SL_TERROR, SL_TRANSLATE, slx_destruct(), slx_error(), slx_alloc::slx_ss_alloc, slx_text, slx_alloc::slx_vs_alloc, sscan_Value(), strdup(), syntax_error, TCST, v, va_yacc, valcst, SL_STYPE::Value, value_addto, VALUE_MONE, value_mult, VALUE_ONE, value_oppose, value_substract, value_uminus, SL_STYPE::Variable, variable_default_name, VARIABLE_UNDEFINED_P, vect_add_elem(), vect_add_variable(), vect_rm(), and Scontrainte::vecteur.
Referenced by sl_read().
01192 { 01193 01194 01195 int slx_state; 01196 /* Number of tokens to shift before error messages enabled. */ 01197 int slx_errstatus; 01198 01199 /* The stacks and their tools: 01200 `slx_ss': related to states. 01201 `slx_vs': related to semantic values. 01202 01203 Refer to the stacks thru separate pointers, to allow slx_overflow 01204 to reallocate them elsewhere. */ 01205 01206 /* The state stack. */ 01207 slx_type_int16 slx_ssa[SL_INITDEPTH]; 01208 slx_type_int16 *slx_ss; 01209 slx_type_int16 *slx_ssp; 01210 01211 /* The semantic value stack. */ 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 /* Lookahead token as an internal (translated) token number. */ 01221 int slx_token; 01222 /* The variables used to return semantic value and location from the 01223 action routines. */ 01224 SL_STYPE slx_val; 01225 01226 #if SL_ERROR_VERBOSE 01227 /* Buffer for error messages, and its allocated size. */ 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 /* The number of symbols on the RHS of the reduced rule. 01236 Keep to zero when no symbol should be popped. */ 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; /* Cause a token to be read. */ 01250 01251 /* Initialize stack pointers. 01252 Waste one element of value and location stack 01253 so that they stay on the same level as the state stack. 01254 The wasted elements are never initialized. */ 01255 slx_ssp = slx_ss; 01256 slx_vsp = slx_vs; 01257 01258 goto slx_setstate; 01259 01260 /*------------------------------------------------------------. 01261 | slx_newstate -- Push a new state, which is found in slx_state. | 01262 `------------------------------------------------------------*/ 01263 slx_newstate: 01264 /* In all cases, when you get here, the value and location stacks 01265 have just been pushed. So pushing a state here evens the stacks. */ 01266 slx_ssp++; 01267 01268 slx_setstate: 01269 *slx_ssp = slx_state; 01270 01271 if (slx_ss + slx_stacksize - 1 <= slx_ssp) 01272 { 01273 /* Get the current used size of the three stacks, in elements. */ 01274 SL_SIZE_T slx_size = slx_ssp - slx_ss + 1; 01275 01276 #ifdef slx_overflow 01277 { 01278 /* Give user a chance to reallocate the stack. Use copies of 01279 these so that the &'s don't force the real ones into 01280 memory. */ 01281 SL_STYPE *slx_vs1 = slx_vs; 01282 slx_type_int16 *slx_ss1 = slx_ss; 01283 01284 /* Each stack pointer address is followed by the size of the 01285 data in use in that stack, in bytes. This used to be a 01286 conditional around just the two extra args, but that might 01287 be undefined if slx_overflow is a macro. */ 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 /* no slx_overflow */ 01297 # ifndef SL_STACK_RELOCATE 01298 goto slx_exhaustedlab; 01299 # else 01300 /* Extend the stack our own way. */ 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 /* no slx_overflow */ 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 | slx_backup. | 01341 `-----------*/ 01342 slx_backup: 01343 01344 /* Do appropriate processing given the current state. Read a 01345 lookahead token if we need one and don't already have one. */ 01346 01347 /* First try to decide what to do without reference to lookahead token. */ 01348 slx_n = slx_pact[slx_state]; 01349 if (slx_n == SL_PACT_NINF) 01350 goto slx_default; 01351 01352 /* Not known => get a lookahead token if don't already have one. */ 01353 01354 /* SL_CHAR is either SL_EMPTY or SL_EOF or a valid lookahead symbol. */ 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 /* If the proper action on seeing token SL_TOKEN is to reduce or to 01373 detect an error, take that action. */ 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 /* Count tokens shifted since error; after three, turn off error 01387 status. */ 01388 if (slx_errstatus) 01389 slx_errstatus--; 01390 01391 /* Shift the lookahead token. */ 01392 SL__SYMBOL_PRINT ("Shifting", slx_token, &slx_lval, &slx_lloc); 01393 01394 /* Discard the shifted token. */ 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 | slx_default -- do the default action for the current state. | 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 | slx_reduce -- Do a reduction. | 01415 `-----------------------------*/ 01416 slx_reduce: 01417 /* slx_n is the number of a rule to reduce with. */ 01418 slx_len = slx_r2[slx_n]; 01419 01420 /* If SL_LEN is nonzero, implement the default value of the action: 01421 `$$ = $1'. 01422 01423 Otherwise, the following line sets SL_VAL to garbage. 01424 This behavior is undocumented and Bison 01425 users should not rely upon it. Assigning to SL_VAL 01426 unconditionally makes the parser a bit smaller, and it avoids a 01427 GCC warning that SL_VAL may be used uninitialized. */ 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 /* Line 1455 of yacc.c */ 01437 #line 86 "sl_gram.y" 01438 { /* Initialisation de la liste des systemes */ 01439 sl_yacc = NULL; 01440 syntax_error = FALSE; 01441 } 01442 break; 01443 01444 case 4: 01445 01446 /* Line 1455 of yacc.c */ 01447 #line 93 "sl_gram.y" 01448 { /* Fin de la list des systemes */ 01449 vect_rm( (Pvecteur) ba_yacc ); ba_yacc = NULL; 01450 } 01451 break; 01452 01453 case 8: 01454 01455 /* Line 1455 of yacc.c */ 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 /* Line 1455 of yacc.c */ 01466 #line 120 "sl_gram.y" 01467 { /* initialisation des parametres de la liste de systemes */ 01468 /* et initialisation des variables */ 01469 ps_yacc = sc_new(); 01470 init_globals(); 01471 } 01472 break; 01473 01474 case 13: 01475 01476 /* Line 1455 of yacc.c */ 01477 #line 128 "sl_gram.y" 01478 { 01479 /* on rajoute le systeme trouve a la liste */ 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 /* Line 1455 of yacc.c */ 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 /* Line 1455 of yacc.c */ 01507 #line 161 "sl_gram.y" 01508 { 01509 contrainte_free(eq); 01510 } 01511 break; 01512 01513 case 21: 01514 01515 /* Line 1455 of yacc.c */ 01516 #line 167 "sl_gram.y" 01517 { fac = VALUE_ONE;} 01518 break; 01519 01520 case 24: 01521 01522 /* Line 1455 of yacc.c */ 01523 #line 172 "sl_gram.y" 01524 { 01525 if (cote==DROIT) 01526 value_oppose(fac); 01527 01528 /* ajout du couple (ident,const) a la contrainte courante */ 01529 vect_add_elem(&(eq->vecteur), (Variable) (slx_vsp[(2) - (2)].Variable),value_mult(fac,(slx_vsp[(1) - (2)].Value))); 01530 /* duplication du couple (ident,const) de la combinaison lineaire 01531 traitee*/ 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 /* Line 1455 of yacc.c */ 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 /* Line 1455 of yacc.c */ 01557 #line 196 "sl_gram.y" 01558 { 01559 if (cote==DROIT) value_oppose(fac); 01560 01561 /* ajout du couple (ident,1) a la contrainte courante */ 01562 vect_add_elem (&(eq->vecteur),(Variable) (slx_vsp[(1) - (1)].Variable),fac); 01563 /* duplication du couple (ident,1) de la combinaison lineaire traitee */ 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 /* Line 1455 of yacc.c */ 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 /* Line 1455 of yacc.c */ 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 /* Line 1455 of yacc.c */ 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 /* Line 1455 of yacc.c */ 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 /* Line 1455 of yacc.c */ 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 /* Line 1455 of yacc.c */ 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 /* Line 1455 of yacc.c */ 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 /* Line 1455 of yacc.c */ 01663 #line 269 "sl_gram.y" 01664 { fac = VALUE_ONE; } 01665 break; 01666 01667 case 35: 01668 01669 /* Line 1455 of yacc.c */ 01670 #line 271 "sl_gram.y" 01671 { fac = VALUE_MONE; } 01672 break; 01673 01674 case 38: 01675 01676 /* Line 1455 of yacc.c */ 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 /* Line 1455 of yacc.c */ 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 /* Now `shift' the result of the reduction. Determine what state 01721 that goes to, based on the state we popped back to and the rule 01722 number reduced by. */ 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 | slx_errlab -- here on detecting error | 01737 `------------------------------------*/ 01738 slx_errlab: 01739 /* If not already recovering from an error, report this error. */ 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 /* If just tried and failed to reuse lookahead token after an 01785 error, discard it. */ 01786 01787 if (slx_char <= SL_EOF) 01788 { 01789 /* Return failure if at end of input. */ 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 /* Else will try to reuse lookahead token after shifting the error 01802 token. */ 01803 goto slx_errlab1; 01804 01805 01806 /*---------------------------------------------------. 01807 | slx_errorlab -- error raised explicitly by SL_ERROR. | 01808 `---------------------------------------------------*/ 01809 slx_errorlab: 01810 01811 /* Pacify compilers like GCC when the user code never invokes 01812 SL_ERROR and the label slx_errorlab therefore never appears in user 01813 code. */ 01814 if (/*CONSTCOND*/ 0) 01815 goto slx_errorlab; 01816 01817 /* Do not reclaim the symbols of the rule which action triggered 01818 this SL_ERROR. */ 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 | slx_errlab1 -- common code for both syntax error and SL_ERROR. | 01828 `-------------------------------------------------------------*/ 01829 slx_errlab1: 01830 slx_errstatus = 3; /* Each real token shifted decrements this. */ 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 /* Pop the current state because it cannot handle the error token. */ 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 /* Shift the error token. */ 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 | slx_acceptlab -- SL_ACCEPT comes here. | 01870 `-------------------------------------*/ 01871 slx_acceptlab: 01872 slx_result = 0; 01873 goto slx_return; 01874 01875 /*-----------------------------------. 01876 | slx_abortlab -- SL_ABORT comes here. | 01877 `-----------------------------------*/ 01878 slx_abortlab: 01879 slx_result = 1; 01880 goto slx_return; 01881 01882 #if !defined(slx_overflow) || SL_ERROR_VERBOSE 01883 /*-------------------------------------------------. 01884 | slx_exhaustedlab -- memory exhaustion comes here. | 01885 `-------------------------------------------------*/ 01886 slx_exhaustedlab: 01887 slx_error (SL__("memory exhausted")); 01888 slx_result = 2; 01889 /* Fall through. */ 01890 #endif 01891 01892 slx_return: 01893 if (slx_char != SL_EMPTY) 01894 slx_destruct ("Cleanup: discarding lookahead", 01895 slx_token, &slx_lval); 01896 /* Do not reclaim the symbols of the rule which action triggered 01897 this SL_ABORT or SL_ACCEPT. */ 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 /* Make sure SL_ID is used. */ 01915 return SL_ID (slx_result); 01916 }
| short int cote |
dernier operateur rencontre
dernier operateur rencontre
Ces fonction ne sont utilisables que dans ce contexte particulier car elles utilisent des variables globales
* init_globals(): initialisation des variables globales
* new_ident (ps,s) : - introduction de la nouvelle variable s dans la base
* rec_ident (ps,s) : - recherche du rang de la variable s dans la base
* creer_eg (p) : - ajout d'une egalite, dont les couples (variable,coefficient) sont pointes par p
* creer_ineg (p): - ajout d'une inegalite, dont les couples (variable,coefficient) sont pointes par p
Corinne Ancourt
Modifications:
| int sens |
const slx_type_uint8 slx_check[] [static] |
const slx_type_uint8 slx_defact[] [static] |
Initial value:
{
3, 0, 0, 1, 0, 12, 8, 5, 6, 4,
9, 0, 0, 2, 10, 18, 7, 40, 14, 21,
18, 0, 35, 34, 36, 0, 0, 0, 15, 13,
0, 28, 27, 22, 26, 25, 20, 31, 29, 30,
32, 33, 21, 11, 23, 24, 38, 37, 17
}
Zero means the default is an error.
const slx_type_int8 slx_defgoto[] [static] |
const slx_type_int8 slx_pact[] [static] |
const slx_type_int8 slx_pgoto[] [static] |
const slx_type_uint8 slx_r1[] [static] |
const slx_type_uint8 slx_r2[] [static] |
const slx_type_uint8 slx_stos[] [static] |
Initial value:
{
0, 17, 18, 0, 14, 20, 7, 21, 22, 23,
24, 25, 15, 19, 23, 4, 22, 27, 28, 29,
15, 40, 10, 11, 31, 32, 37, 38, 28, 3,
37, 5, 7, 33, 34, 35, 33, 6, 8, 9,
12, 13, 36, 26, 33, 34, 31, 39, 30
}
const slx_type_int8 slx_table[] [static] |
| char * slx_text |
Copy the first part of user declarations.
Line 189 of yacc.c
Definition at line 475 of file sl_lex.c.
Referenced by slx_error(), slx_get_text(), and slx_parse().
const slx_type_uint8 slx_translate[] [static] |
Initial value:
{
0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 1, 2
}
1.5.8