My Project  UNKNOWN_GIT_VERSION
Macros | Typedefs | Enumerations | Functions | Variables
readcf.cc File Reference
#include "config.h"
#include "factory/factoryconf.h"
#include <cstring>
#include <ctype.h>
#include <iostream>
#include "cf_assert.h"
#include "canonicalform.h"
#include "cf_defs.h"
#include "gfops.h"
#include "parseutil.h"
#include "variable.h"
#include <limits.h>
#include <stdlib.h>

Go to the source code of this file.

Macros

#define YYBISON   30704
 
#define YYBISON_VERSION   "3.7.4"
 
#define YYSKELETON_NAME   "yacc.c"
 
#define YYPURE   0
 
#define YYPUSH   0
 
#define YYPULL   1
 
#define ISTREAM   std::istream
 
#define CERR   std::cerr
 
#define YYSTYPE   ParseUtil
 
#define YY_CAST(Type, Val)   static_cast<Type> (Val)
 
#define YY_REINTERPRET_CAST(Type, Val)   reinterpret_cast<Type> (Val)
 
#define YY_NULLPTR   0
 
#define YYDEBUG   0
 
#define YYTOKENTYPE
 
#define YYEMPTY   -2
 
#define YYEOF   0
 
#define YYerror   256
 
#define YYUNDEF   257
 
#define NUM   258
 
#define NEG   259
 
#define YYPTRDIFF_T   long
 
#define YYPTRDIFF_MAXIMUM   LONG_MAX
 
#define YYSIZE_T   unsigned
 
#define YYSIZE_MAXIMUM
 
#define YYSIZEOF(X)   YY_CAST (YYPTRDIFF_T, sizeof (X))
 
#define YY_(Msgid)   Msgid
 
#define YY_ATTRIBUTE_PURE
 
#define YY_ATTRIBUTE_UNUSED
 
#define YYUSE(E)   ((void) (E))
 
#define YY_INITIAL_VALUE(Value)   Value
 
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
 
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
 
#define YY_IGNORE_USELESS_CAST_BEGIN
 
#define YY_IGNORE_USELESS_CAST_END
 
#define YY_ASSERT(E)   ((void) (0 && (E)))
 
#define YYSTACK_ALLOC   YYMALLOC
 
#define YYSTACK_FREE   YYFREE
 
#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM
 
#define EXIT_SUCCESS   0
 
#define YYMALLOC   malloc
 
#define YYFREE   free
 
#define YYFINAL   2
 
#define YYLAST   44
 
#define YYNTOKENS   13
 
#define YYNNTS   4
 
#define YYNRULES   14
 
#define YYNSTATES   25
 
#define YYMAXUTOK   259
 
#define YYTRANSLATE(YYX)
 
#define YY_ACCESSING_SYMBOL(State)   YY_CAST (yysymbol_kind_t, yystos[State])
 Accessing symbol of state STATE. More...
 
#define YYPACT_NINF   (-8)
 
#define yypact_value_is_default(Yyn)    ((Yyn) == YYPACT_NINF)
 
#define YYTABLE_NINF   (-1)
 
#define yytable_value_is_error(Yyn)    0
 
#define yyerrok   (yyerrstatus = 0)
 
#define yyclearin   (yychar = YYEMPTY)
 
#define YYACCEPT   goto yyacceptlab
 
#define YYABORT   goto yyabortlab
 
#define YYERROR   goto yyerrorlab
 
#define YYRECOVERING()   (!!yyerrstatus)
 
#define YYBACKUP(Token, Value)
 
#define YYERRCODE   YYUNDEF
 
#define YYDPRINTF(Args)   ((void) 0)
 
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
 
#define YY_STACK_PRINT(Bottom, Top)
 
#define YY_REDUCE_PRINT(Rule)
 
#define YYINITDEPTH   200
 
#define YYMAXDEPTH   10000
 
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
 

Typedefs

typedef enum yytokentype yytoken_kind_t
 
typedef enum yysymbol_kind_t yysymbol_kind_t
 
typedef signed char yytype_int8
 
typedef short yytype_int16
 
typedef unsigned char yytype_uint8
 
typedef unsigned short yytype_uint16
 
typedef yytype_int8 yy_state_t
 
typedef int yy_state_fast_t
 

Enumerations

enum  yytokentype {
  DOTDOT = 258 , EQUAL_EQUAL = 259 , GE = 260 , LE = 261 ,
  MINUSMINUS = 262 , NOT = 263 , NOTEQUAL = 264 , PLUSPLUS = 265 ,
  COLONCOLON = 266 , ARROW = 267 , GRING_CMD = 268 , BIGINTMAT_CMD = 269 ,
  INTMAT_CMD = 270 , PROC_CMD = 271 , RING_CMD = 272 , BEGIN_RING = 273 ,
  BUCKET_CMD = 274 , IDEAL_CMD = 275 , MAP_CMD = 276 , MATRIX_CMD = 277 ,
  MODUL_CMD = 278 , NUMBER_CMD = 279 , POLY_CMD = 280 , RESOLUTION_CMD = 281 ,
  SMATRIX_CMD = 282 , VECTOR_CMD = 283 , BETTI_CMD = 284 , E_CMD = 285 ,
  FETCH_CMD = 286 , FREEMODULE_CMD = 287 , KEEPRING_CMD = 288 , IMAP_CMD = 289 ,
  KOSZUL_CMD = 290 , MAXID_CMD = 291 , MONOM_CMD = 292 , PAR_CMD = 293 ,
  PREIMAGE_CMD = 294 , VAR_CMD = 295 , VALTVARS = 296 , VMAXDEG = 297 ,
  VMAXMULT = 298 , VNOETHER = 299 , VMINPOLY = 300 , END_RING = 301 ,
  CMD_1 = 302 , CMD_2 = 303 , CMD_3 = 304 , CMD_12 = 305 ,
  CMD_13 = 306 , CMD_23 = 307 , CMD_123 = 308 , CMD_M = 309 ,
  ROOT_DECL = 310 , ROOT_DECL_LIST = 311 , RING_DECL = 312 , RING_DECL_LIST = 313 ,
  EXAMPLE_CMD = 314 , EXPORT_CMD = 315 , HELP_CMD = 316 , KILL_CMD = 317 ,
  LIB_CMD = 318 , LISTVAR_CMD = 319 , SETRING_CMD = 320 , TYPE_CMD = 321 ,
  STRINGTOK = 322 , BLOCKTOK = 323 , INT_CONST = 324 , UNKNOWN_IDENT = 325 ,
  RINGVAR = 326 , PROC_DEF = 327 , APPLY = 328 , ASSUME_CMD = 329 ,
  BREAK_CMD = 330 , CONTINUE_CMD = 331 , ELSE_CMD = 332 , EVAL = 333 ,
  QUOTE = 334 , FOR_CMD = 335 , IF_CMD = 336 , SYS_BREAK = 337 ,
  WHILE_CMD = 338 , RETURN = 339 , PARAMETER = 340 , SYSVAR = 341 ,
  UMINUS = 342 , DOTDOT = 258 , EQUAL_EQUAL = 259 , GE = 260 ,
  LE = 261 , MINUSMINUS = 262 , NOT = 263 , NOTEQUAL = 264 ,
  PLUSPLUS = 265 , COLONCOLON = 266 , ARROW = 267 , GRING_CMD = 268 ,
  BIGINTMAT_CMD = 269 , INTMAT_CMD = 270 , PROC_CMD = 271 , RING_CMD = 272 ,
  BEGIN_RING = 273 , BUCKET_CMD = 274 , IDEAL_CMD = 275 , MAP_CMD = 276 ,
  MATRIX_CMD = 277 , MODUL_CMD = 278 , NUMBER_CMD = 279 , POLY_CMD = 280 ,
  RESOLUTION_CMD = 281 , SMATRIX_CMD = 282 , VECTOR_CMD = 283 , BETTI_CMD = 284 ,
  E_CMD = 285 , FETCH_CMD = 286 , FREEMODULE_CMD = 287 , KEEPRING_CMD = 288 ,
  IMAP_CMD = 289 , KOSZUL_CMD = 290 , MAXID_CMD = 291 , MONOM_CMD = 292 ,
  PAR_CMD = 293 , PREIMAGE_CMD = 294 , VAR_CMD = 295 , VALTVARS = 296 ,
  VMAXDEG = 297 , VMAXMULT = 298 , VNOETHER = 299 , VMINPOLY = 300 ,
  END_RING = 301 , CMD_1 = 302 , CMD_2 = 303 , CMD_3 = 304 ,
  CMD_12 = 305 , CMD_13 = 306 , CMD_23 = 307 , CMD_123 = 308 ,
  CMD_M = 309 , ROOT_DECL = 310 , ROOT_DECL_LIST = 311 , RING_DECL = 312 ,
  RING_DECL_LIST = 313 , EXAMPLE_CMD = 314 , EXPORT_CMD = 315 , HELP_CMD = 316 ,
  KILL_CMD = 317 , LIB_CMD = 318 , LISTVAR_CMD = 319 , SETRING_CMD = 320 ,
  TYPE_CMD = 321 , STRINGTOK = 322 , BLOCKTOK = 323 , INT_CONST = 324 ,
  UNKNOWN_IDENT = 325 , RINGVAR = 326 , PROC_DEF = 327 , APPLY = 328 ,
  ASSUME_CMD = 329 , BREAK_CMD = 330 , CONTINUE_CMD = 331 , ELSE_CMD = 332 ,
  EVAL = 333 , QUOTE = 334 , FOR_CMD = 335 , IF_CMD = 336 ,
  SYS_BREAK = 337 , WHILE_CMD = 338 , RETURN = 339 , PARAMETER = 340 ,
  SYSVAR = 341 , UMINUS = 342 , YYEMPTY = -2 , YYEOF = 0 ,
  YYerror = 256 , YYUNDEF = 257 , NUM = 258 , NEG = 259
}
 
enum  yysymbol_kind_t {
  YYSYMBOL_YYEMPTY = -2 , YYSYMBOL_YYEOF = 0 , YYSYMBOL_YYerror = 1 , YYSYMBOL_YYUNDEF = 2 ,
  YYSYMBOL_NUM = 3 , YYSYMBOL_4_ = 4 , YYSYMBOL_5_ = 5 , YYSYMBOL_6_ = 6 ,
  YYSYMBOL_7_ = 7 , YYSYMBOL_NEG = 8 , YYSYMBOL_9_ = 9 , YYSYMBOL_10_ = 10 ,
  YYSYMBOL_11_ = 11 , YYSYMBOL_12_ = 12 , YYSYMBOL_YYACCEPT = 13 , YYSYMBOL_input = 14 ,
  YYSYMBOL_line = 15 , YYSYMBOL_exp = 16
}
 
enum  { YYENOMEM = -2 }
 

Functions

static char * readString (ISTREAM &)
 
void yyerror (char *s)
 
int yylex ()
 
int yyparse (void)
 
static void yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
 
CanonicalForm readCF (ISTREAM &str)
 

Variables

static ISTREAMdefaultin = 0
 
static CanonicalFormretvalue = 0
 
YYSTYPE yylval
 
static const yytype_int8 yytranslate []
 
static const yytype_int8 yypact []
 
static const yytype_int8 yydefact []
 
static const yytype_int8 yypgoto []
 
static const yytype_int8 yydefgoto []
 
static const yytype_int8 yytable []
 
static const yytype_int8 yycheck []
 
static const yytype_int8 yystos []
 
static const yytype_int8 yyr1 []
 
static const yytype_int8 yyr2 []
 
int yychar
 
int yynerrs
 

Macro Definition Documentation

◆ CERR

#define CERR   std::cerr

Definition at line 94 of file readcf.cc.

◆ EXIT_SUCCESS

#define EXIT_SUCCESS   0

Definition at line 445 of file readcf.cc.

◆ ISTREAM

#define ISTREAM   std::istream

Definition at line 93 of file readcf.cc.

◆ NEG

#define NEG   259

Definition at line 181 of file readcf.cc.

◆ NUM

#define NUM   258

Definition at line 180 of file readcf.cc.

◆ YY_

#define YY_ (   Msgid)    Msgid

Definition at line 334 of file readcf.cc.

◆ YY_ACCESSING_SYMBOL

#define YY_ACCESSING_SYMBOL (   State)    YY_CAST (yysymbol_kind_t, yystos[State])

Accessing symbol of state STATE.


Definition at line 590 of file readcf.cc.

◆ YY_ASSERT

#define YY_ASSERT (   E)    ((void) (0 && (E)))

Definition at line 394 of file readcf.cc.

◆ YY_ATTRIBUTE_PURE

#define YY_ATTRIBUTE_PURE

Definition at line 343 of file readcf.cc.

◆ YY_ATTRIBUTE_UNUSED

#define YY_ATTRIBUTE_UNUSED

Definition at line 351 of file readcf.cc.

◆ YY_CAST

#define YY_CAST (   Type,
  Val 
)    static_cast<Type> (Val)

Definition at line 133 of file readcf.cc.

◆ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

Definition at line 374 of file readcf.cc.

◆ YY_IGNORE_MAYBE_UNINITIALIZED_END

#define YY_IGNORE_MAYBE_UNINITIALIZED_END

Definition at line 375 of file readcf.cc.

◆ YY_IGNORE_USELESS_CAST_BEGIN

#define YY_IGNORE_USELESS_CAST_BEGIN

Definition at line 389 of file readcf.cc.

◆ YY_IGNORE_USELESS_CAST_END

#define YY_IGNORE_USELESS_CAST_END

Definition at line 390 of file readcf.cc.

◆ YY_INITIAL_VALUE

#define YY_INITIAL_VALUE (   Value)    Value

Definition at line 371 of file readcf.cc.

◆ YY_NULLPTR

#define YY_NULLPTR   0

Definition at line 145 of file readcf.cc.

◆ YY_REDUCE_PRINT

#define YY_REDUCE_PRINT (   Rule)

Definition at line 873 of file readcf.cc.

◆ YY_REINTERPRET_CAST

#define YY_REINTERPRET_CAST (   Type,
  Val 
)    reinterpret_cast<Type> (Val)

Definition at line 134 of file readcf.cc.

◆ YY_STACK_PRINT

#define YY_STACK_PRINT (   Bottom,
  Top 
)

Definition at line 872 of file readcf.cc.

◆ YY_SYMBOL_PRINT

#define YY_SYMBOL_PRINT (   Title,
  Kind,
  Value,
  Location 
)

Definition at line 871 of file readcf.cc.

◆ YYABORT

#define YYABORT   goto yyabortlab

Definition at line 715 of file readcf.cc.

◆ YYACCEPT

#define YYACCEPT   goto yyacceptlab

Definition at line 714 of file readcf.cc.

◆ YYBACKUP

#define YYBACKUP (   Token,
  Value 
)
Value:
{ \
yychar = (Token); \
yylval = (Value); \
YYPOPSTACK (yylen); \
yystate = *yyssp; \
goto yybackup; \
} \
else \
{ \
yyerror (YY_("syntax error: cannot back up")); \
YYERROR; \
} \
while (0)
if(yy_init)
Definition: libparse.cc:1418
#define YY_(Msgid)
Definition: readcf.cc:334
int yychar
Definition: readcf.cc:918
#define YYEMPTY
Definition: readcf.cc:176

Definition at line 721 of file readcf.cc.

◆ YYBISON

#define YYBISON   30704

Definition at line 49 of file readcf.cc.

◆ YYBISON_VERSION

#define YYBISON_VERSION   "3.7.4"

Definition at line 52 of file readcf.cc.

◆ yyclearin

#define yyclearin   (yychar = YYEMPTY)

Definition at line 712 of file readcf.cc.

◆ YYDEBUG

#define YYDEBUG   0

Definition at line 155 of file readcf.cc.

◆ YYDPRINTF

#define YYDPRINTF (   Args)    ((void) 0)

Definition at line 870 of file readcf.cc.

◆ YYEMPTY

#define YYEMPTY   -2

Definition at line 176 of file readcf.cc.

◆ YYEOF

#define YYEOF   0

Definition at line 177 of file readcf.cc.

◆ YYERRCODE

#define YYERRCODE   YYUNDEF

Definition at line 740 of file readcf.cc.

◆ yyerrok

#define yyerrok   (yyerrstatus = 0)

Definition at line 711 of file readcf.cc.

◆ YYerror

#define YYerror   256

Definition at line 178 of file readcf.cc.

◆ YYERROR

#define YYERROR   goto yyerrorlab

Definition at line 716 of file readcf.cc.

◆ YYFINAL

#define YYFINAL   2

Definition at line 524 of file readcf.cc.

◆ YYFREE

#define YYFREE   free

Definition at line 455 of file readcf.cc.

◆ YYINITDEPTH

#define YYINITDEPTH   200

Definition at line 879 of file readcf.cc.

◆ YYLAST

#define YYLAST   44

Definition at line 526 of file readcf.cc.

◆ YYMALLOC

#define YYMALLOC   malloc

Definition at line 449 of file readcf.cc.

◆ YYMAXDEPTH

#define YYMAXDEPTH   10000

Definition at line 890 of file readcf.cc.

◆ YYMAXUTOK

#define YYMAXUTOK   259

Definition at line 538 of file readcf.cc.

◆ YYNNTS

#define YYNNTS   4

Definition at line 531 of file readcf.cc.

◆ YYNRULES

#define YYNRULES   14

Definition at line 533 of file readcf.cc.

◆ YYNSTATES

#define YYNSTATES   25

Definition at line 535 of file readcf.cc.

◆ YYNTOKENS

#define YYNTOKENS   13

Definition at line 529 of file readcf.cc.

◆ YYPACT_NINF

#define YYPACT_NINF   (-8)

Definition at line 623 of file readcf.cc.

◆ yypact_value_is_default

#define yypact_value_is_default (   Yyn)     ((Yyn) == YYPACT_NINF)

Definition at line 625 of file readcf.cc.

◆ YYPOPSTACK

#define YYPOPSTACK (   N)    (yyvsp -= (N), yyssp -= (N))

◆ YYPTRDIFF_MAXIMUM

#define YYPTRDIFF_MAXIMUM   LONG_MAX

Definition at line 294 of file readcf.cc.

◆ YYPTRDIFF_T

#define YYPTRDIFF_T   long

Definition at line 293 of file readcf.cc.

◆ YYPULL

#define YYPULL   1

Definition at line 64 of file readcf.cc.

◆ YYPURE

#define YYPURE   0

Definition at line 58 of file readcf.cc.

◆ YYPUSH

#define YYPUSH   0

Definition at line 61 of file readcf.cc.

◆ YYRECOVERING

#define YYRECOVERING ( )    (!!yyerrstatus)

Definition at line 719 of file readcf.cc.

◆ YYSIZE_MAXIMUM

#define YYSIZE_MAXIMUM
Value:
: YY_CAST (YYSIZE_T, -1)))
#define YYPTRDIFF_MAXIMUM
Definition: readcf.cc:294
#define YY_CAST(Type, Val)
Definition: readcf.cc:133
#define YYSIZE_T
Definition: readcf.cc:307
#define YYPTRDIFF_T
Definition: readcf.cc:293

Definition at line 311 of file readcf.cc.

◆ YYSIZE_T

#define YYSIZE_T   unsigned

Definition at line 307 of file readcf.cc.

◆ YYSIZEOF

#define YYSIZEOF (   X)    YY_CAST (YYPTRDIFF_T, sizeof (X))

Definition at line 317 of file readcf.cc.

◆ YYSKELETON_NAME

#define YYSKELETON_NAME   "yacc.c"

Definition at line 55 of file readcf.cc.

◆ YYSTACK_ALLOC

#define YYSTACK_ALLOC   YYMALLOC

Definition at line 435 of file readcf.cc.

◆ YYSTACK_ALLOC_MAXIMUM

#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM

Definition at line 438 of file readcf.cc.

◆ YYSTACK_FREE

#define YYSTACK_FREE   YYFREE

Definition at line 436 of file readcf.cc.

◆ YYSTYPE

#define YYSTYPE   ParseUtil

Definition at line 111 of file readcf.cc.

◆ YYTABLE_NINF

#define YYTABLE_NINF   (-1)

Definition at line 628 of file readcf.cc.

◆ yytable_value_is_error

#define yytable_value_is_error (   Yyn)     0

Definition at line 630 of file readcf.cc.

◆ YYTOKENTYPE

#define YYTOKENTYPE

Definition at line 163 of file readcf.cc.

◆ YYTRANSLATE

#define YYTRANSLATE (   YYX)
Value:
(0 <= (YYX) && (YYX) <= YYMAXUTOK \
static const yytype_int8 yytranslate[]
Definition: readcf.cc:550
yysymbol_kind_t
Definition: readcf.cc:198
@ YYSYMBOL_YYUNDEF
Definition: readcf.cc:202
#define YYMAXUTOK
Definition: readcf.cc:538

Definition at line 543 of file readcf.cc.

◆ YYUNDEF

#define YYUNDEF   257

Definition at line 179 of file readcf.cc.

◆ YYUSE

#define YYUSE (   E)    ((void) (E))

Definition at line 357 of file readcf.cc.

Typedef Documentation

◆ yy_state_fast_t

typedef int yy_state_fast_t

Definition at line 324 of file readcf.cc.

◆ yy_state_t

Definition at line 321 of file readcf.cc.

◆ yysymbol_kind_t

Definition at line 193 of file readcf.cc.

◆ yytoken_kind_t

Definition at line 126 of file readcf.cc.

◆ yytype_int16

typedef short yytype_int16

Definition at line 257 of file readcf.cc.

◆ yytype_int8

typedef signed char yytype_int8

Definition at line 249 of file readcf.cc.

◆ yytype_uint16

typedef unsigned short yytype_uint16

Definition at line 277 of file readcf.cc.

◆ yytype_uint8

typedef unsigned char yytype_uint8

Definition at line 266 of file readcf.cc.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
YYENOMEM 

Definition at line 709 of file readcf.cc.

709 { YYENOMEM = -2 };
@ YYENOMEM
Definition: readcf.cc:709

◆ yysymbol_kind_t

Enumerator
YYSYMBOL_YYEMPTY 
YYSYMBOL_YYEOF 
YYSYMBOL_YYerror 
YYSYMBOL_YYUNDEF 
YYSYMBOL_NUM 
YYSYMBOL_4_ 
YYSYMBOL_5_ 
YYSYMBOL_6_ 
YYSYMBOL_7_ 
YYSYMBOL_NEG 
YYSYMBOL_9_ 
YYSYMBOL_10_ 
YYSYMBOL_11_ 
YYSYMBOL_12_ 
YYSYMBOL_YYACCEPT 
YYSYMBOL_input 
YYSYMBOL_line 
YYSYMBOL_exp 

Definition at line 197 of file readcf.cc.

198 {
199  YYSYMBOL_YYEMPTY = -2,
200  YYSYMBOL_YYEOF = 0, /* "end of file" */
201  YYSYMBOL_YYerror = 1, /* error */
202  YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
203  YYSYMBOL_NUM = 3, /* NUM */
204  YYSYMBOL_4_ = 4, /* '-' */
205  YYSYMBOL_5_ = 5, /* '+' */
206  YYSYMBOL_6_ = 6, /* '*' */
207  YYSYMBOL_7_ = 7, /* '/' */
208  YYSYMBOL_NEG = 8, /* NEG */
209  YYSYMBOL_9_ = 9, /* '^' */
210  YYSYMBOL_10_ = 10, /* ';' */
211  YYSYMBOL_11_ = 11, /* '(' */
212  YYSYMBOL_12_ = 12, /* ')' */
213  YYSYMBOL_YYACCEPT = 13, /* $accept */
214  YYSYMBOL_input = 14, /* input */
215  YYSYMBOL_line = 15, /* line */
216  YYSYMBOL_exp = 16 /* exp */
217 };
@ YYSYMBOL_7_
Definition: readcf.cc:207
@ YYSYMBOL_YYerror
Definition: readcf.cc:201
@ YYSYMBOL_12_
Definition: readcf.cc:212
@ YYSYMBOL_exp
Definition: readcf.cc:216
@ YYSYMBOL_10_
Definition: readcf.cc:210
@ YYSYMBOL_9_
Definition: readcf.cc:209
@ YYSYMBOL_11_
Definition: readcf.cc:211
@ YYSYMBOL_NEG
Definition: readcf.cc:208
@ YYSYMBOL_6_
Definition: readcf.cc:206
@ YYSYMBOL_line
Definition: readcf.cc:215
@ YYSYMBOL_NUM
Definition: readcf.cc:203
@ YYSYMBOL_YYACCEPT
Definition: readcf.cc:213
@ YYSYMBOL_4_
Definition: readcf.cc:204
@ YYSYMBOL_YYEOF
Definition: readcf.cc:200
@ YYSYMBOL_input
Definition: readcf.cc:214
@ YYSYMBOL_YYEMPTY
Definition: readcf.cc:199
@ YYSYMBOL_5_
Definition: readcf.cc:205

◆ yytokentype

Enumerator
DOTDOT 
EQUAL_EQUAL 
GE 
LE 
MINUSMINUS 
NOT 
NOTEQUAL 
PLUSPLUS 
COLONCOLON 
ARROW 
GRING_CMD 
BIGINTMAT_CMD 
INTMAT_CMD 
PROC_CMD 
RING_CMD 
BEGIN_RING 
BUCKET_CMD 
IDEAL_CMD 
MAP_CMD 
MATRIX_CMD 
MODUL_CMD 
NUMBER_CMD 
POLY_CMD 
RESOLUTION_CMD 
SMATRIX_CMD 
VECTOR_CMD 
BETTI_CMD 
E_CMD 
FETCH_CMD 
FREEMODULE_CMD 
KEEPRING_CMD 
IMAP_CMD 
KOSZUL_CMD 
MAXID_CMD 
MONOM_CMD 
PAR_CMD 
PREIMAGE_CMD 
VAR_CMD 
VALTVARS 
VMAXDEG 
VMAXMULT 
VNOETHER 
VMINPOLY 
END_RING 
CMD_1 
CMD_2 
CMD_3 
CMD_12 
CMD_13 
CMD_23 
CMD_123 
CMD_M 
ROOT_DECL 
ROOT_DECL_LIST 
RING_DECL 
RING_DECL_LIST 
EXAMPLE_CMD 
EXPORT_CMD 
HELP_CMD 
KILL_CMD 
LIB_CMD 
LISTVAR_CMD 
SETRING_CMD 
TYPE_CMD 
STRINGTOK 
BLOCKTOK 
INT_CONST 
UNKNOWN_IDENT 
RINGVAR 
PROC_DEF 
APPLY 
ASSUME_CMD 
BREAK_CMD 
CONTINUE_CMD 
ELSE_CMD 
EVAL 
QUOTE 
FOR_CMD 
IF_CMD 
SYS_BREAK 
WHILE_CMD 
RETURN 
PARAMETER 
SYSVAR 
UMINUS 
DOTDOT 
EQUAL_EQUAL 
GE 
LE 
MINUSMINUS 
NOT 
NOTEQUAL 
PLUSPLUS 
COLONCOLON 
ARROW 
GRING_CMD 
BIGINTMAT_CMD 
INTMAT_CMD 
PROC_CMD 
RING_CMD 
BEGIN_RING 
BUCKET_CMD 
IDEAL_CMD 
MAP_CMD 
MATRIX_CMD 
MODUL_CMD 
NUMBER_CMD 
POLY_CMD 
RESOLUTION_CMD 
SMATRIX_CMD 
VECTOR_CMD 
BETTI_CMD 
E_CMD 
FETCH_CMD 
FREEMODULE_CMD 
KEEPRING_CMD 
IMAP_CMD 
KOSZUL_CMD 
MAXID_CMD 
MONOM_CMD 
PAR_CMD 
PREIMAGE_CMD 
VAR_CMD 
VALTVARS 
VMAXDEG 
VMAXMULT 
VNOETHER 
VMINPOLY 
END_RING 
CMD_1 
CMD_2 
CMD_3 
CMD_12 
CMD_13 
CMD_23 
CMD_123 
CMD_M 
ROOT_DECL 
ROOT_DECL_LIST 
RING_DECL 
RING_DECL_LIST 
EXAMPLE_CMD 
EXPORT_CMD 
HELP_CMD 
KILL_CMD 
LIB_CMD 
LISTVAR_CMD 
SETRING_CMD 
TYPE_CMD 
STRINGTOK 
BLOCKTOK 
INT_CONST 
UNKNOWN_IDENT 
RINGVAR 
PROC_DEF 
APPLY 
ASSUME_CMD 
BREAK_CMD 
CONTINUE_CMD 
ELSE_CMD 
EVAL 
QUOTE 
FOR_CMD 
IF_CMD 
SYS_BREAK 
WHILE_CMD 
RETURN 
PARAMETER 
SYSVAR 
UMINUS 
YYEMPTY 
YYEOF 
YYerror 
YYUNDEF 
NUM 
NEG 

Definition at line 164 of file readcf.cc.

165  {
166  YYEMPTY = -2,
167  YYEOF = 0, /* "end of file" */
168  YYerror = 256, /* error */
169  YYUNDEF = 257, /* "invalid token" */
170  NUM = 258, /* NUM */
171  NEG = 259 /* NEG */
172  };
#define YYEOF
Definition: readcf.cc:177
#define YYerror
Definition: readcf.cc:178
#define YYUNDEF
Definition: readcf.cc:179
#define NEG
Definition: readcf.cc:181
#define NUM
Definition: readcf.cc:180

Function Documentation

◆ readCF()

CanonicalForm readCF ( ISTREAM str)

Definition at line 1494 of file readcf.cc.

1495 {
1496  CanonicalForm theRetvalue;
1497  retvalue = new CanonicalForm();
1498 #ifdef BISONPP
1499  YY_parse_CLASS my_parser;
1500  defaultin = &str;
1501  if ( my_parser.yyparse() == 0 ) {
1502  theRetvalue = *retvalue;
1503  delete retvalue;
1504  return theRetvalue;
1505  }
1506  else {
1507  delete retvalue;
1508  return 0;
1509  }
1510 #else
1511  defaultin = &str;
1512  if ( yyparse() == 0 ) {
1513  theRetvalue = *retvalue;
1514  delete retvalue;
1515  return theRetvalue;
1516  }
1517  else {
1518  delete retvalue;
1519  return 0;
1520  }
1521 #endif
1522 }
factory's main class
Definition: canonicalform.h:83
static ISTREAM * defaultin
Definition: readcf.cc:124
int yyparse(void)
Definition: readcf.cc:933
static CanonicalForm * retvalue
Definition: readcf.cc:126

◆ readString()

char * readString ( ISTREAM s)
static

Definition at line 1524 of file readcf.cc.

1525 {
1526  static char * buffer = 0;
1527  static int bufsize = 0;
1528 
1529  if ( buffer == 0 ) {
1530  bufsize = 10000;
1531  buffer = new char[bufsize];
1532  }
1533  int i = 0, c, goon = 1;
1534  while ( goon ) {
1535  while ( isdigit( c = s.get() ) && i < bufsize - 2 ) {
1536  buffer[i] = c;
1537  i++;
1538  }
1539  if ( isdigit( c ) ) {
1540  bufsize += 1000;
1541  char * newbuffer = (char*)memcpy( new char[bufsize], buffer, bufsize - 1000 );
1542  delete [] buffer;
1543  buffer = newbuffer;
1544  buffer[i] = c;
1545  i++;
1546  }
1547  else {
1548  goon = 0;
1549  buffer[i] = '\0';
1550  s.putback( c );
1551  }
1552  }
1553  return buffer;
1554 }
int i
Definition: cfEzgcd.cc:125
const CanonicalForm int s
Definition: facAbsFact.cc:55

◆ yydestruct()

static void yydestruct ( const char *  yymsg,
yysymbol_kind_t  yykind,
YYSTYPE yyvaluep 
)
static

Definition at line 903 of file readcf.cc.

905 {
906  YYUSE (yyvaluep);
907  if (!yymsg)
908  yymsg = "Deleting";
909  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
910 
912  YYUSE (yykind);
914 }
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: readcf.cc:374
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: readcf.cc:375
#define YYUSE(E)
Definition: readcf.cc:357
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
Definition: readcf.cc:871

◆ yyerror()

void yyerror ( char *  s)

Definition at line 1433 of file readcf.cc.

1435 {
1436  CERR << s << "\n";
1437 }
#define CERR
Definition: readcf.cc:94

◆ yylex()

int yylex ( )

Definition at line 1442 of file readcf.cc.

1444 {
1445  int c;
1446 
1447  while ((c = defaultin->get()) == ' ' || c == '\t' || c == '\n' ) ;
1448  if ( isdigit( c ) ) {
1449  defaultin->putback( c );
1451  return NUM;
1452  }
1453  else if ( isalpha( c ) ) {
1454  // look for generators of GF(q)
1455  if ( getCharacteristic() > 0 && getGFDegree() > 1 && c == gf_name ) {
1456 #ifdef BISONPP
1457  this->yylval = getGFGenerator();
1458 #else
1459  yylval = getGFGenerator();
1460 #endif
1461  }
1462  else if ( c == getDefaultVarName() ) {
1463  int cc;
1464  cc = defaultin->get();
1465  if ( cc == '_' ) {
1467 #ifdef BISONPP
1468  this->yylval = Variable( index.getintval() );
1469 #else
1470  yylval = Variable( index.getintval() );
1471 #endif
1472  }
1473  else {
1474  defaultin->putback( cc );
1475 #ifdef BISONPP
1476  this->yylval = Variable( (char)c );
1477 #else
1478  yylval = Variable( (char)c );
1479 #endif
1480  }
1481  }
1482  else {
1483 #ifdef BISONPP
1484  this->yylval = Variable( (char)c );
1485 #else
1486  yylval = Variable( (char)c );
1487 #endif
1488  }
1489  return NUM;
1490  }
1491  return c;
1492 }
int getCharacteristic()
Definition: cf_char.cc:51
int getGFDegree()
Definition: cf_char.cc:56
CanonicalForm getGFGenerator()
Definition: cf_char.cc:62
factory's class for variables
Definition: factory.h:118
char getDefaultVarName()
Definition: variable.cc:244
char gf_name
Definition: gfops.cc:52
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
YYSTYPE yylval
Definition: readcf.cc:921
static char * readString(ISTREAM &)
Definition: readcf.cc:1524

◆ yyparse()

int yyparse ( void  )

Definition at line 933 of file readcf.cc.

934 {
935  yy_state_fast_t yystate = 0;
936  /* Number of tokens to shift before error messages enabled. */
937  int yyerrstatus = 0;
938 
939  /* Refer to the stacks through separate pointers, to allow yyoverflow
940  to reallocate them elsewhere. */
941 
942  /* Their size. */
943  YYPTRDIFF_T yystacksize = YYINITDEPTH;
944 
945  /* The state stack: array, bottom, top. */
946  yy_state_t yyssa[YYINITDEPTH];
947  yy_state_t *yyss = yyssa;
948  yy_state_t *yyssp = yyss;
949 
950  /* The semantic value stack: array, bottom, top. */
951  YYSTYPE yyvsa[YYINITDEPTH];
952  YYSTYPE *yyvs = yyvsa;
953  YYSTYPE *yyvsp = yyvs;
954 
955  int yyn;
956  /* The return value of yyparse. */
957  int yyresult;
958  /* Lookahead symbol kind. */
960  /* The variables used to return semantic value and location from the
961  action routines. */
962  YYSTYPE yyval;
963 
964 
965 
966 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
967 
968  /* The number of symbols on the RHS of the reduced rule.
969  Keep to zero when no symbol should be popped. */
970  int yylen = 0;
971 
972  YYDPRINTF ((stderr, "Starting parse\n"));
973 
974  yychar = YYEMPTY; /* Cause a token to be read. */
975  goto yysetstate;
976 
977 
978 /*------------------------------------------------------------.
979 | yynewstate -- push a new state, which is found in yystate. |
980 `------------------------------------------------------------*/
981 yynewstate:
982  /* In all cases, when you get here, the value and location stacks
983  have just been pushed. So pushing a state here evens the stacks. */
984  yyssp++;
985 
986 
987 /*--------------------------------------------------------------------.
988 | yysetstate -- set current state (the top of the stack) to yystate. |
989 `--------------------------------------------------------------------*/
990 yysetstate:
991  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
992  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
994  *yyssp = YY_CAST (yy_state_t, yystate);
996  YY_STACK_PRINT (yyss, yyssp);
997 
998  if (yyss + yystacksize - 1 <= yyssp)
999 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1000  goto yyexhaustedlab;
1001 #else
1002  {
1003  /* Get the current used size of the three stacks, in elements. */
1004  YYPTRDIFF_T yysize = yyssp - yyss + 1;
1005 
1006 # if defined yyoverflow
1007  {
1008  /* Give user a chance to reallocate the stack. Use copies of
1009  these so that the &'s don't force the real ones into
1010  memory. */
1011  yy_state_t *yyss1 = yyss;
1012  YYSTYPE *yyvs1 = yyvs;
1013 
1014  /* Each stack pointer address is followed by the size of the
1015  data in use in that stack, in bytes. This used to be a
1016  conditional around just the two extra args, but that might
1017  be undefined if yyoverflow is a macro. */
1018  yyoverflow (YY_("memory exhausted"),
1019  &yyss1, yysize * YYSIZEOF (*yyssp),
1020  &yyvs1, yysize * YYSIZEOF (*yyvsp),
1021  &yystacksize);
1022  yyss = yyss1;
1023  yyvs = yyvs1;
1024  }
1025 # else /* defined YYSTACK_RELOCATE */
1026  /* Extend the stack our own way. */
1027  if (YYMAXDEPTH <= yystacksize)
1028  goto yyexhaustedlab;
1029  yystacksize *= 2;
1030  if (YYMAXDEPTH < yystacksize)
1031  yystacksize = YYMAXDEPTH;
1032 
1033  {
1034  yy_state_t *yyss1 = yyss;
1035  union yyalloc *yyptr =
1036  YY_CAST (union yyalloc *,
1037  YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1038  if (! yyptr)
1039  goto yyexhaustedlab;
1040  YYSTACK_RELOCATE (yyss_alloc, yyss);
1041  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1042 # undef YYSTACK_RELOCATE
1043  if (yyss1 != yyssa)
1044  YYSTACK_FREE (yyss1);
1045  }
1046 # endif
1047 
1048  yyssp = yyss + yysize - 1;
1049  yyvsp = yyvs + yysize - 1;
1050 
1052  YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1053  YY_CAST (long, yystacksize)));
1055 
1056  if (yyss + yystacksize - 1 <= yyssp)
1057  YYABORT;
1058  }
1059 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1060 
1061  if (yystate == YYFINAL)
1062  YYACCEPT;
1063 
1064  goto yybackup;
1065 
1066 
1067 /*-----------.
1068 | yybackup. |
1069 `-----------*/
1070 yybackup:
1071  /* Do appropriate processing given the current state. Read a
1072  lookahead token if we need one and don't already have one. */
1073 
1074  /* First try to decide what to do without reference to lookahead token. */
1075  yyn = yypact[yystate];
1076  if (yypact_value_is_default (yyn))
1077  goto yydefault;
1078 
1079  /* Not known => get a lookahead token if don't already have one. */
1080 
1081  /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1082  if (yychar == YYEMPTY)
1083  {
1084  YYDPRINTF ((stderr, "Reading a token\n"));
1085  yychar = yylex ();
1086  }
1087 
1088  if (yychar <= YYEOF)
1089  {
1090  yychar = YYEOF;
1091  yytoken = YYSYMBOL_YYEOF;
1092  YYDPRINTF ((stderr, "Now at end of input.\n"));
1093  }
1094  else if (yychar == YYerror)
1095  {
1096  /* The scanner already issued an error message, process directly
1097  to error recovery. But do not keep the error token as
1098  lookahead, it is too special and may lead us to an endless
1099  loop in error recovery. */
1100  yychar = YYUNDEF;
1101  yytoken = YYSYMBOL_YYerror;
1102  goto yyerrlab1;
1103  }
1104  else
1105  {
1106  yytoken = YYTRANSLATE (yychar);
1107  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1108  }
1109 
1110  /* If the proper action on seeing token YYTOKEN is to reduce or to
1111  detect an error, take that action. */
1112  yyn += yytoken;
1113  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1114  goto yydefault;
1115  yyn = yytable[yyn];
1116  if (yyn <= 0)
1117  {
1118  if (yytable_value_is_error (yyn))
1119  goto yyerrlab;
1120  yyn = -yyn;
1121  goto yyreduce;
1122  }
1123 
1124  /* Count tokens shifted since error; after three, turn off error
1125  status. */
1126  if (yyerrstatus)
1127  yyerrstatus--;
1128 
1129  /* Shift the lookahead token. */
1130  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1131  yystate = yyn;
1133  *++yyvsp = yylval;
1135 
1136  /* Discard the shifted token. */
1137  yychar = YYEMPTY;
1138  goto yynewstate;
1139 
1140 
1141 /*-----------------------------------------------------------.
1142 | yydefault -- do the default action for the current state. |
1143 `-----------------------------------------------------------*/
1144 yydefault:
1145  yyn = yydefact[yystate];
1146  if (yyn == 0)
1147  goto yyerrlab;
1148  goto yyreduce;
1149 
1150 
1151 /*-----------------------------.
1152 | yyreduce -- do a reduction. |
1153 `-----------------------------*/
1154 yyreduce:
1155  /* yyn is the number of a rule to reduce with. */
1156  yylen = yyr2[yyn];
1157 
1158  /* If YYLEN is nonzero, implement the default value of the action:
1159  '$$ = $1'.
1160 
1161  Otherwise, the following line sets YYVAL to garbage.
1162  This behavior is undocumented and Bison
1163  users should not rely upon it. Assigning to YYVAL
1164  unconditionally makes the parser a bit smaller, and it avoids a
1165  GCC warning that YYVAL may be used uninitialized. */
1166  yyval = yyvsp[1-yylen];
1167 
1168 
1169  YY_REDUCE_PRINT (yyn);
1170  switch (yyn)
1171  {
1172  case 5: /* line: exp ';' */
1173 #line 78 "readcf.yy"
1174  { *retvalue = yyvsp[-1].getval(); return 0; }
1175 #line 1176 "readcf.cc"
1176  break;
1177 
1178  case 6: /* exp: NUM */
1179 #line 81 "readcf.yy"
1180  { yyval = yyvsp[0]; }
1181 #line 1182 "readcf.cc"
1182  break;
1183 
1184  case 7: /* exp: exp '+' exp */
1185 #line 82 "readcf.yy"
1186  { yyval = yyvsp[-2].getval() + yyvsp[0].getval(); }
1187 #line 1188 "readcf.cc"
1188  break;
1189 
1190  case 8: /* exp: exp '-' exp */
1191 #line 83 "readcf.yy"
1192  { yyval = yyvsp[-2].getval() - yyvsp[0].getval(); }
1193 #line 1194 "readcf.cc"
1194  break;
1195 
1196  case 9: /* exp: exp '*' exp */
1197 #line 84 "readcf.yy"
1198  { yyval = yyvsp[-2].getval() * yyvsp[0].getval(); }
1199 #line 1200 "readcf.cc"
1200  break;
1201 
1202  case 10: /* exp: exp '/' exp */
1203 #line 85 "readcf.yy"
1204  { yyval = yyvsp[-2].getval() / yyvsp[0].getval(); }
1205 #line 1206 "readcf.cc"
1206  break;
1207 
1208  case 11: /* exp: '-' exp */
1209 #line 86 "readcf.yy"
1210  { yyval = -yyvsp[0].getval(); }
1211 #line 1212 "readcf.cc"
1212  break;
1213 
1214  case 12: /* exp: '+' exp */
1215 #line 87 "readcf.yy"
1216  { yyval = yyvsp[0].getval(); }
1217 #line 1218 "readcf.cc"
1218  break;
1219 
1220  case 13: /* exp: exp '^' NUM */
1221 #line 88 "readcf.yy"
1222  { yyval = power( yyvsp[-2].getval(), yyvsp[0].getintval() ); }
1223 #line 1224 "readcf.cc"
1224  break;
1225 
1226  case 14: /* exp: '(' exp ')' */
1227 #line 89 "readcf.yy"
1228  { yyval = yyvsp[-1].getval(); }
1229 #line 1230 "readcf.cc"
1230  break;
1231 
1232 
1233 #line 1234 "readcf.cc"
1234 
1235  default: break;
1236  }
1237  /* User semantic actions sometimes alter yychar, and that requires
1238  that yytoken be updated with the new translation. We take the
1239  approach of translating immediately before every use of yytoken.
1240  One alternative is translating here after every semantic action,
1241  but that translation would be missed if the semantic action invokes
1242  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1243  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1244  incorrect destructor might then be invoked immediately. In the
1245  case of YYERROR or YYBACKUP, subsequent parser actions might lead
1246  to an incorrect destructor call or verbose syntax error message
1247  before the lookahead is translated. */
1248  YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1249 
1250  YYPOPSTACK (yylen);
1251  yylen = 0;
1252 
1253  *++yyvsp = yyval;
1254 
1255  /* Now 'shift' the result of the reduction. Determine what state
1256  that goes to, based on the state we popped back to and the rule
1257  number reduced by. */
1258  {
1259  const int yylhs = yyr1[yyn] - YYNTOKENS;
1260  const int yyi = yypgoto[yylhs] + *yyssp;
1261  yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1262  ? yytable[yyi]
1263  : yydefgoto[yylhs]);
1264  }
1265 
1266  goto yynewstate;
1267 
1268 
1269 /*--------------------------------------.
1270 | yyerrlab -- here on detecting error. |
1271 `--------------------------------------*/
1272 yyerrlab:
1273  /* Make sure we have latest lookahead translation. See comments at
1274  user semantic actions for why this is necessary. */
1275  yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1276  /* If not already recovering from an error, report this error. */
1277  if (!yyerrstatus)
1278  {
1279  ++yynerrs;
1280  yyerror (YY_("syntax error"));
1281  }
1282 
1283  if (yyerrstatus == 3)
1284  {
1285  /* If just tried and failed to reuse lookahead token after an
1286  error, discard it. */
1287 
1288  if (yychar <= YYEOF)
1289  {
1290  /* Return failure if at end of input. */
1291  if (yychar == YYEOF)
1292  YYABORT;
1293  }
1294  else
1295  {
1296  yydestruct ("Error: discarding",
1297  yytoken, &yylval);
1298  yychar = YYEMPTY;
1299  }
1300  }
1301 
1302  /* Else will try to reuse lookahead token after shifting the error
1303  token. */
1304  goto yyerrlab1;
1305 
1306 
1307 /*---------------------------------------------------.
1308 | yyerrorlab -- error raised explicitly by YYERROR. |
1309 `---------------------------------------------------*/
1310 yyerrorlab:
1311  /* Pacify compilers when the user code never invokes YYERROR and the
1312  label yyerrorlab therefore never appears in user code. */
1313  if (0)
1314  YYERROR;
1315 
1316  /* Do not reclaim the symbols of the rule whose action triggered
1317  this YYERROR. */
1318  YYPOPSTACK (yylen);
1319  yylen = 0;
1320  YY_STACK_PRINT (yyss, yyssp);
1321  yystate = *yyssp;
1322  goto yyerrlab1;
1323 
1324 
1325 /*-------------------------------------------------------------.
1326 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1327 `-------------------------------------------------------------*/
1328 yyerrlab1:
1329  yyerrstatus = 3; /* Each real token shifted decrements this. */
1330 
1331  /* Pop stack until we find a state that shifts the error token. */
1332  for (;;)
1333  {
1334  yyn = yypact[yystate];
1335  if (!yypact_value_is_default (yyn))
1336  {
1337  yyn += YYSYMBOL_YYerror;
1338  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1339  {
1340  yyn = yytable[yyn];
1341  if (0 < yyn)
1342  break;
1343  }
1344  }
1345 
1346  /* Pop the current state because it cannot handle the error token. */
1347  if (yyssp == yyss)
1348  YYABORT;
1349 
1350 
1351  yydestruct ("Error: popping",
1352  YY_ACCESSING_SYMBOL (yystate), yyvsp);
1353  YYPOPSTACK (1);
1354  yystate = *yyssp;
1355  YY_STACK_PRINT (yyss, yyssp);
1356  }
1357 
1359  *++yyvsp = yylval;
1361 
1362 
1363  /* Shift the error token. */
1364  YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1365 
1366  yystate = yyn;
1367  goto yynewstate;
1368 
1369 
1370 /*-------------------------------------.
1371 | yyacceptlab -- YYACCEPT comes here. |
1372 `-------------------------------------*/
1373 yyacceptlab:
1374  yyresult = 0;
1375  goto yyreturn;
1376 
1377 
1378 /*-----------------------------------.
1379 | yyabortlab -- YYABORT comes here. |
1380 `-----------------------------------*/
1381 yyabortlab:
1382  yyresult = 1;
1383  goto yyreturn;
1384 
1385 
1386 #if !defined yyoverflow
1387 /*-------------------------------------------------.
1388 | yyexhaustedlab -- memory exhaustion comes here. |
1389 `-------------------------------------------------*/
1390 yyexhaustedlab:
1391  yyerror (YY_("memory exhausted"));
1392  yyresult = 2;
1393  goto yyreturn;
1394 #endif
1395 
1396 
1397 /*-------------------------------------------------------.
1398 | yyreturn -- parsing is finished, clean up and return. |
1399 `-------------------------------------------------------*/
1400 yyreturn:
1401  if (yychar != YYEMPTY)
1402  {
1403  /* Make sure we have latest lookahead translation. See comments at
1404  user semantic actions for why this is necessary. */
1405  yytoken = YYTRANSLATE (yychar);
1406  yydestruct ("Cleanup: discarding lookahead",
1407  yytoken, &yylval);
1408  }
1409  /* Do not reclaim the symbols of the rule whose action triggered
1410  this YYABORT or YYACCEPT. */
1411  YYPOPSTACK (yylen);
1412  YY_STACK_PRINT (yyss, yyssp);
1413  while (yyssp != yyss)
1414  {
1415  yydestruct ("Cleanup: popping",
1416  YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
1417  YYPOPSTACK (1);
1418  }
1419 #ifndef yyoverflow
1420  if (yyss != yyssa)
1421  YYSTACK_FREE (yyss);
1422 #endif
1423 
1424  return yyresult;
1425 }
CanonicalForm power(const CanonicalForm &f, int n)
exponentiation
InternalCF * getval() const
int yynerrs
Definition: readcf.cc:923
#define YYMAXDEPTH
Definition: readcf.cc:890
void yyerror(char *s)
Definition: readcf.cc:1433
#define YYSTACK_FREE
Definition: readcf.cc:436
#define YY_ASSERT(E)
Definition: readcf.cc:394
static const yytype_int8 yydefact[]
Definition: readcf.cc:645
#define YYNSTATES
Definition: readcf.cc:535
#define YYSTYPE
Definition: readcf.cc:111
#define YY_IGNORE_USELESS_CAST_END
Definition: readcf.cc:390
#define YYABORT
Definition: readcf.cc:715
static const yytype_int8 yycheck[]
Definition: readcf.cc:676
#define YY_REDUCE_PRINT(Rule)
Definition: readcf.cc:873
static void yydestruct(const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
Definition: readcf.cc:903
static const yytype_int8 yypact[]
Definition: readcf.cc:635
#define YYFINAL
Definition: readcf.cc:524
#define YY_ACCESSING_SYMBOL(State)
Accessing symbol of state STATE.
Definition: readcf.cc:590
#define YYNTOKENS
Definition: readcf.cc:529
#define YY_STACK_PRINT(Bottom, Top)
Definition: readcf.cc:872
#define YY_IGNORE_USELESS_CAST_BEGIN
Definition: readcf.cc:389
static const yytype_int8 yyr2[]
Definition: readcf.cc:702
static const yytype_int8 yytable[]
Definition: readcf.cc:667
int yylex()
Definition: readcf.cc:1442
#define YYACCEPT
Definition: readcf.cc:714
#define yytable_value_is_error(Yyn)
Definition: readcf.cc:630
#define YYTRANSLATE(YYX)
Definition: readcf.cc:543
static const yytype_int8 yypgoto[]
Definition: readcf.cc:653
static const yytype_int8 yyr1[]
Definition: readcf.cc:695
#define YYPOPSTACK(N)
int yy_state_fast_t
Definition: readcf.cc:324
static const yytype_int8 yydefgoto[]
Definition: readcf.cc:659
#define YYLAST
Definition: readcf.cc:526
#define yypact_value_is_default(Yyn)
Definition: readcf.cc:625
#define YYINITDEPTH
Definition: readcf.cc:879
#define YYERROR
Definition: readcf.cc:716
#define YYSIZEOF(X)
Definition: readcf.cc:317
#define YYSTACK_ALLOC
Definition: readcf.cc:435
yytype_int8 yy_state_t
Definition: readcf.cc:321
#define YYDPRINTF(Args)
Definition: readcf.cc:870

Variable Documentation

◆ defaultin

ISTREAM* defaultin = 0
static

Definition at line 124 of file readcf.cc.

◆ retvalue

CanonicalForm* retvalue = 0
static

Definition at line 126 of file readcf.cc.

◆ yychar

int yychar

Definition at line 918 of file readcf.cc.

◆ yycheck

const yytype_int8 yycheck[]
static
Initial value:
=
{
4, 5, 9, 7, 3, -1, 3, 4, 5, 13,
14, 15, 16, 0, 11, -1, 3, 4, 5, -1,
-1, -1, -1, 10, 11, 4, 5, 6, 7, -1,
9, -1, -1, 12, 4, 5, 6, 7, -1, 9,
10, 6, 7, -1, 9
}

Definition at line 676 of file readcf.cc.

◆ yydefact

const yytype_int8 yydefact[]
static
Initial value:
=
{
2, 0, 1, 6, 0, 0, 4, 0, 3, 0,
11, 12, 0, 0, 0, 0, 0, 0, 5, 14,
8, 7, 9, 10, 13
}

Definition at line 645 of file readcf.cc.

◆ yydefgoto

const yytype_int8 yydefgoto[]
static
Initial value:
=
{
-1, 1, 8, 9
}

Definition at line 659 of file readcf.cc.

◆ yylval

YYSTYPE yylval

Definition at line 921 of file readcf.cc.

◆ yynerrs

int yynerrs

Definition at line 923 of file readcf.cc.

◆ yypact

const yytype_int8 yypact[]
static
Initial value:
=
{
-8, 13, -8, -8, 3, 3, -8, 3, -8, 30,
-7, -7, 21, 3, 3, 3, 3, 1, -8, -8,
35, 35, -7, -7, -8
}

Definition at line 635 of file readcf.cc.

◆ yypgoto

const yytype_int8 yypgoto[]
static
Initial value:
=
{
-8, -8, -8, -4
}

Definition at line 653 of file readcf.cc.

◆ yyr1

const yytype_int8 yyr1[]
static
Initial value:
=
{
0, 13, 14, 14, 15, 15, 16, 16, 16, 16,
16, 16, 16, 16, 16
}

Definition at line 695 of file readcf.cc.

◆ yyr2

const yytype_int8 yyr2[]
static
Initial value:
=
{
0, 2, 0, 2, 1, 2, 1, 3, 3, 3,
3, 2, 2, 3, 3
}

Definition at line 702 of file readcf.cc.

◆ yystos

const yytype_int8 yystos[]
static
Initial value:
=
{
0, 14, 0, 3, 4, 5, 10, 11, 15, 16,
16, 16, 16, 4, 5, 6, 7, 9, 10, 12,
16, 16, 16, 16, 3
}

Definition at line 687 of file readcf.cc.

◆ yytable

const yytype_int8 yytable[]
static
Initial value:
=
{
10, 11, 17, 12, 24, 0, 3, 4, 5, 20,
21, 22, 23, 2, 7, 0, 3, 4, 5, 0,
0, 0, 0, 6, 7, 13, 14, 15, 16, 0,
17, 0, 0, 19, 13, 14, 15, 16, 0, 17,
18, 15, 16, 0, 17
}

Definition at line 667 of file readcf.cc.

◆ yytranslate

const yytype_int8 yytranslate[]
static
Initial value:
=
{
0, 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,
11, 12, 6, 5, 2, 4, 2, 7, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 10,
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, 9, 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, 3, 8
}

Definition at line 550 of file readcf.cc.