My Project
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   30802
 
#define YYBISON_VERSION   "3.8.2"
 
#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 YY_USE(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 YYNOMEM   goto yyexhaustedlab
 
#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 ,
  MONOM = 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 , MONOM = 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 465 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 348 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 610 of file readcf.cc.

◆ YY_ASSERT

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

Definition at line 414 of file readcf.cc.

◆ YY_ATTRIBUTE_PURE

#define YY_ATTRIBUTE_PURE

Definition at line 357 of file readcf.cc.

◆ YY_ATTRIBUTE_UNUSED

#define YY_ATTRIBUTE_UNUSED

Definition at line 365 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 394 of file readcf.cc.

◆ YY_IGNORE_MAYBE_UNINITIALIZED_END

#define YY_IGNORE_MAYBE_UNINITIALIZED_END

Definition at line 395 of file readcf.cc.

◆ YY_IGNORE_USELESS_CAST_BEGIN

#define YY_IGNORE_USELESS_CAST_BEGIN

Definition at line 409 of file readcf.cc.

◆ YY_IGNORE_USELESS_CAST_END

#define YY_IGNORE_USELESS_CAST_END

Definition at line 410 of file readcf.cc.

◆ YY_INITIAL_VALUE

#define YY_INITIAL_VALUE (   Value)    Value

Definition at line 391 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 877 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 876 of file readcf.cc.

◆ YY_SYMBOL_PRINT

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

Definition at line 875 of file readcf.cc.

◆ YY_USE

#define YY_USE (   E)    ((void) (E))

Definition at line 371 of file readcf.cc.

◆ YYABORT

#define YYABORT   goto yyabortlab

Definition at line 725 of file readcf.cc.

◆ YYACCEPT

#define YYACCEPT   goto yyacceptlab

Definition at line 724 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(!FE_OPT_NO_SHELL_FLAG)(void) system(sys)
#define YY_(Msgid)
Definition: readcf.cc:348
int yychar
Definition: readcf.cc:922
#define YYEMPTY
Definition: readcf.cc:176

Definition at line 732 of file readcf.cc.

◆ YYBISON

#define YYBISON   30802

Definition at line 49 of file readcf.cc.

◆ YYBISON_VERSION

#define YYBISON_VERSION   "3.8.2"

Definition at line 52 of file readcf.cc.

◆ yyclearin

#define yyclearin   (yychar = YYEMPTY)

Definition at line 722 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 874 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 751 of file readcf.cc.

◆ yyerrok

#define yyerrok   (yyerrstatus = 0)

Definition at line 721 of file readcf.cc.

◆ YYerror

#define YYerror   256

Definition at line 178 of file readcf.cc.

◆ YYERROR

#define YYERROR   goto yyerrorlab

Definition at line 726 of file readcf.cc.

◆ YYFINAL

#define YYFINAL   2

Definition at line 544 of file readcf.cc.

◆ YYFREE

#define YYFREE   free

Definition at line 475 of file readcf.cc.

◆ YYINITDEPTH

#define YYINITDEPTH   200

Definition at line 883 of file readcf.cc.

◆ YYLAST

#define YYLAST   44

Definition at line 546 of file readcf.cc.

◆ YYMALLOC

#define YYMALLOC   malloc

Definition at line 469 of file readcf.cc.

◆ YYMAXDEPTH

#define YYMAXDEPTH   10000

Definition at line 894 of file readcf.cc.

◆ YYMAXUTOK

#define YYMAXUTOK   259

Definition at line 558 of file readcf.cc.

◆ YYNNTS

#define YYNNTS   4

Definition at line 551 of file readcf.cc.

◆ YYNOMEM

#define YYNOMEM   goto yyexhaustedlab

Definition at line 727 of file readcf.cc.

◆ YYNRULES

#define YYNRULES   14

Definition at line 553 of file readcf.cc.

◆ YYNSTATES

#define YYNSTATES   25

Definition at line 555 of file readcf.cc.

◆ YYNTOKENS

#define YYNTOKENS   13

Definition at line 549 of file readcf.cc.

◆ YYPACT_NINF

#define YYPACT_NINF   (-8)

Definition at line 633 of file readcf.cc.

◆ yypact_value_is_default

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

Definition at line 635 of file readcf.cc.

◆ YYPOPSTACK

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

◆ YYPTRDIFF_MAXIMUM

#define YYPTRDIFF_MAXIMUM   LONG_MAX

Definition at line 308 of file readcf.cc.

◆ YYPTRDIFF_T

#define YYPTRDIFF_T   long

Definition at line 307 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 730 of file readcf.cc.

◆ YYSIZE_MAXIMUM

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

Definition at line 325 of file readcf.cc.

◆ YYSIZE_T

#define YYSIZE_T   unsigned

Definition at line 321 of file readcf.cc.

◆ YYSIZEOF

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

Definition at line 331 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 455 of file readcf.cc.

◆ YYSTACK_ALLOC_MAXIMUM

#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM

Definition at line 458 of file readcf.cc.

◆ YYSTACK_FREE

#define YYSTACK_FREE   YYFREE

Definition at line 456 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 638 of file readcf.cc.

◆ yytable_value_is_error

#define yytable_value_is_error (   Yyn)     0

Definition at line 640 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:570
yysymbol_kind_t
Definition: readcf.cc:200
@ YYSYMBOL_YYUNDEF
Definition: readcf.cc:204
#define YYMAXUTOK
Definition: readcf.cc:558

Definition at line 563 of file readcf.cc.

◆ YYUNDEF

#define YYUNDEF   257

Definition at line 179 of file readcf.cc.

Typedef Documentation

◆ yy_state_fast_t

typedef int yy_state_fast_t

Definition at line 338 of file readcf.cc.

◆ yy_state_t

Definition at line 335 of file readcf.cc.

◆ yysymbol_kind_t

Definition at line 194 of file readcf.cc.

◆ yytoken_kind_t

Definition at line 126 of file readcf.cc.

◆ yytype_int16

typedef short yytype_int16

Definition at line 259 of file readcf.cc.

◆ yytype_int8

typedef signed char yytype_int8

Definition at line 251 of file readcf.cc.

◆ yytype_uint16

typedef unsigned short yytype_uint16

Definition at line 291 of file readcf.cc.

◆ yytype_uint8

typedef unsigned char yytype_uint8

Definition at line 280 of file readcf.cc.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
YYENOMEM 

Definition at line 719 of file readcf.cc.

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

◆ 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 199 of file readcf.cc.

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

◆ 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 
MONOM 
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 
MONOM 
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 1499 of file readcf.cc.

1500 {
1501  CanonicalForm theRetvalue;
1502  retvalue = new CanonicalForm();
1503 #ifdef BISONPP
1504  YY_parse_CLASS my_parser;
1505  defaultin = &str;
1506  if ( my_parser.yyparse() == 0 ) {
1507  theRetvalue = *retvalue;
1508  delete retvalue;
1509  return theRetvalue;
1510  }
1511  else {
1512  delete retvalue;
1513  return 0;
1514  }
1515 #else
1516  defaultin = &str;
1517  if ( yyparse() == 0 ) {
1518  theRetvalue = *retvalue;
1519  delete retvalue;
1520  return theRetvalue;
1521  }
1522  else {
1523  delete retvalue;
1524  return 0;
1525  }
1526 #endif
1527 }
factory's main class
Definition: canonicalform.h:86
char * str(leftv arg)
Definition: shared.cc:704
static ISTREAM * defaultin
Definition: readcf.cc:124
int yyparse(void)
Definition: readcf.cc:937
static CanonicalForm * retvalue
Definition: readcf.cc:126

◆ readString()

char * readString ( ISTREAM s)
static

Definition at line 1529 of file readcf.cc.

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

◆ yydestruct()

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

Definition at line 907 of file readcf.cc.

909 {
910  YY_USE (yyvaluep);
911  if (!yymsg)
912  yymsg = "Deleting";
913  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
914 
916  YY_USE (yykind);
918 }
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: readcf.cc:394
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: readcf.cc:395
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
Definition: readcf.cc:875
#define YY_USE(E)
Definition: readcf.cc:371

◆ yyerror()

void yyerror ( char *  s)

Definition at line 1438 of file readcf.cc.

1440 {
1441  CERR << s << "\n";
1442 }
#define CERR
Definition: readcf.cc:94

◆ yylex()

int yylex ( )

Definition at line 1447 of file readcf.cc.

1449 {
1450  int c;
1451 
1452  while ((c = defaultin->get()) == ' ' || c == '\t' || c == '\n' ) ;
1453  if ( isdigit( c ) ) {
1454  defaultin->putback( c );
1456  return NUM;
1457  }
1458  else if ( isalpha( c ) ) {
1459  // look for generators of GF(q)
1460  if ( getCharacteristic() > 0 && getGFDegree() > 1 && c == gf_name ) {
1461 #ifdef BISONPP
1462  this->yylval = getGFGenerator();
1463 #else
1464  yylval = getGFGenerator();
1465 #endif
1466  }
1467  else if ( c == getDefaultVarName() ) {
1468  int cc;
1469  cc = defaultin->get();
1470  if ( cc == '_' ) {
1472 #ifdef BISONPP
1473  this->yylval = Variable( index.getintval() );
1474 #else
1475  yylval = Variable( index.getintval() );
1476 #endif
1477  }
1478  else {
1479  defaultin->putback( cc );
1480 #ifdef BISONPP
1481  this->yylval = Variable( (char)c );
1482 #else
1483  yylval = Variable( (char)c );
1484 #endif
1485  }
1486  }
1487  else {
1488 #ifdef BISONPP
1489  this->yylval = Variable( (char)c );
1490 #else
1491  yylval = Variable( (char)c );
1492 #endif
1493  }
1494  return NUM;
1495  }
1496  return c;
1497 }
int getGFDegree()
Definition: cf_char.cc:75
CanonicalForm getGFGenerator()
Definition: cf_char.cc:81
int FACTORY_PUBLIC getCharacteristic()
Definition: cf_char.cc:70
factory's class for variables
Definition: factory.h:127
char getDefaultVarName()
Definition: variable.cc:244
VAR 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:925
static char * readString(ISTREAM &)
Definition: readcf.cc:1529

◆ yyparse()

int yyparse ( void  )

Definition at line 937 of file readcf.cc.

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

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 922 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 686 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 655 of file readcf.cc.

◆ yydefgoto

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

Definition at line 669 of file readcf.cc.

◆ yylval

YYSTYPE yylval

Definition at line 925 of file readcf.cc.

◆ yynerrs

int yynerrs

Definition at line 927 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 645 of file readcf.cc.

◆ yypgoto

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

Definition at line 663 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 705 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 712 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 697 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 677 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 570 of file readcf.cc.