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   30706
 
#define YYBISON_VERSION   "3.7.6"
 
#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 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 {
  YYEMPTY = -2 , YYEOF = 0 , YYerror = 256 , YYUNDEF = 257 ,
  NUM = 258 , NEG = 259 , 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
}
 
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 457 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 346 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 602 of file readcf.cc.

◆ YY_ASSERT

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

Definition at line 406 of file readcf.cc.

◆ YY_ATTRIBUTE_PURE

#define YY_ATTRIBUTE_PURE

Definition at line 355 of file readcf.cc.

◆ YY_ATTRIBUTE_UNUSED

#define YY_ATTRIBUTE_UNUSED

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

◆ YY_IGNORE_MAYBE_UNINITIALIZED_END

#define YY_IGNORE_MAYBE_UNINITIALIZED_END

Definition at line 387 of file readcf.cc.

◆ YY_IGNORE_USELESS_CAST_BEGIN

#define YY_IGNORE_USELESS_CAST_BEGIN

Definition at line 401 of file readcf.cc.

◆ YY_IGNORE_USELESS_CAST_END

#define YY_IGNORE_USELESS_CAST_END

Definition at line 402 of file readcf.cc.

◆ YY_INITIAL_VALUE

#define YY_INITIAL_VALUE (   Value)    Value

Definition at line 383 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 885 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 884 of file readcf.cc.

◆ YY_SYMBOL_PRINT

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

Definition at line 883 of file readcf.cc.

◆ YY_USE

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

Definition at line 369 of file readcf.cc.

◆ YYABORT

#define YYABORT   goto yyabortlab

Definition at line 727 of file readcf.cc.

◆ YYACCEPT

#define YYACCEPT   goto yyacceptlab

Definition at line 726 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(both_non_zero==0)
Definition: cfEzgcd.cc:91
#define YY_(Msgid)
Definition: readcf.cc:346
int yychar
Definition: readcf.cc:930
#define YYEMPTY
Definition: readcf.cc:176

Definition at line 733 of file readcf.cc.

◆ YYBISON

#define YYBISON   30706

Definition at line 49 of file readcf.cc.

◆ YYBISON_VERSION

#define YYBISON_VERSION   "3.7.6"

Definition at line 52 of file readcf.cc.

◆ yyclearin

#define yyclearin   (yychar = YYEMPTY)

Definition at line 724 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 882 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 752 of file readcf.cc.

◆ yyerrok

#define yyerrok   (yyerrstatus = 0)

Definition at line 723 of file readcf.cc.

◆ YYerror

#define YYerror   256

Definition at line 178 of file readcf.cc.

◆ YYERROR

#define YYERROR   goto yyerrorlab

Definition at line 728 of file readcf.cc.

◆ YYFINAL

#define YYFINAL   2

Definition at line 536 of file readcf.cc.

◆ YYFREE

#define YYFREE   free

Definition at line 467 of file readcf.cc.

◆ YYINITDEPTH

#define YYINITDEPTH   200

Definition at line 891 of file readcf.cc.

◆ YYLAST

#define YYLAST   44

Definition at line 538 of file readcf.cc.

◆ YYMALLOC

#define YYMALLOC   malloc

Definition at line 461 of file readcf.cc.

◆ YYMAXDEPTH

#define YYMAXDEPTH   10000

Definition at line 902 of file readcf.cc.

◆ YYMAXUTOK

#define YYMAXUTOK   259

Definition at line 550 of file readcf.cc.

◆ YYNNTS

#define YYNNTS   4

Definition at line 543 of file readcf.cc.

◆ YYNRULES

#define YYNRULES   14

Definition at line 545 of file readcf.cc.

◆ YYNSTATES

#define YYNSTATES   25

Definition at line 547 of file readcf.cc.

◆ YYNTOKENS

#define YYNTOKENS   13

Definition at line 541 of file readcf.cc.

◆ YYPACT_NINF

#define YYPACT_NINF   (-8)

Definition at line 635 of file readcf.cc.

◆ yypact_value_is_default

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

Definition at line 637 of file readcf.cc.

◆ YYPOPSTACK

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

◆ YYPTRDIFF_MAXIMUM

#define YYPTRDIFF_MAXIMUM   LONG_MAX

Definition at line 306 of file readcf.cc.

◆ YYPTRDIFF_T

#define YYPTRDIFF_T   long

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

◆ YYSIZE_MAXIMUM

#define YYSIZE_MAXIMUM
Value:
: YY_CAST (YYSIZE_T, -1)))
#define YYPTRDIFF_MAXIMUM
Definition: readcf.cc:306
#define YY_CAST(Type, Val)
Definition: readcf.cc:133
#define YYSIZE_T
Definition: readcf.cc:319
#define YYPTRDIFF_T
Definition: readcf.cc:305

Definition at line 323 of file readcf.cc.

◆ YYSIZE_T

#define YYSIZE_T   unsigned

Definition at line 319 of file readcf.cc.

◆ YYSIZEOF

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

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

◆ YYSTACK_ALLOC_MAXIMUM

#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM

Definition at line 450 of file readcf.cc.

◆ YYSTACK_FREE

#define YYSTACK_FREE   YYFREE

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

◆ yytable_value_is_error

#define yytable_value_is_error (   Yyn)     0

Definition at line 642 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:562
yysymbol_kind_t
Definition: readcf.cc:198
@ YYSYMBOL_YYUNDEF
Definition: readcf.cc:202
#define YYMAXUTOK
Definition: readcf.cc:550

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

◆ yy_state_t

Definition at line 333 of file readcf.cc.

◆ yysymbol_kind_t

Definition at line 218 of file readcf.cc.

◆ yytoken_kind_t

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

◆ yytype_uint8

typedef unsigned char yytype_uint8

Definition at line 278 of file readcf.cc.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
YYENOMEM 

Definition at line 721 of file readcf.cc.

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

◆ 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
YYEMPTY 
YYEOF 
YYerror 
YYUNDEF 
NUM 
NEG 
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 

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

1507{
1508 CanonicalForm theRetvalue;
1509 retvalue = new CanonicalForm();
1510#ifdef BISONPP
1511 YY_parse_CLASS my_parser;
1512 defaultin = &str;
1513 if ( my_parser.yyparse() == 0 ) {
1514 theRetvalue = *retvalue;
1515 delete retvalue;
1516 return theRetvalue;
1517 }
1518 else {
1519 delete retvalue;
1520 return 0;
1521 }
1522#else
1523 defaultin = &str;
1524 if ( yyparse() == 0 ) {
1525 theRetvalue = *retvalue;
1526 delete retvalue;
1527 return theRetvalue;
1528 }
1529 else {
1530 delete retvalue;
1531 return 0;
1532 }
1533#endif
1534}
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:945
static CanonicalForm * retvalue
Definition: readcf.cc:126

◆ readString()

char * readString ( ISTREAM s)
static

Definition at line 1536 of file readcf.cc.

1537{
1538 static char * buffer = 0;
1539 static int bufsize = 0;
1540
1541 if ( buffer == 0 ) {
1542 bufsize = 10000;
1543 buffer = new char[bufsize];
1544 }
1545 int i = 0, c, goon = 1;
1546 while ( goon ) {
1547 while ( isdigit( c = s.get() ) && i < bufsize - 2 ) {
1548 buffer[i] = c;
1549 i++;
1550 }
1551 if ( isdigit( c ) ) {
1552 bufsize += 1000;
1553 char * newbuffer = (char*)memcpy( new char[bufsize], buffer, bufsize - 1000 );
1554 delete [] buffer;
1555 buffer = newbuffer;
1556 buffer[i] = c;
1557 i++;
1558 }
1559 else {
1560 goon = 0;
1561 buffer[i] = '\0';
1562 s.putback( c );
1563 }
1564 }
1565 return buffer;
1566}
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 915 of file readcf.cc.

917{
918 YY_USE (yyvaluep);
919 if (!yymsg)
920 yymsg = "Deleting";
921 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
922
924 YY_USE (yykind);
926}
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: readcf.cc:386
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: readcf.cc:387
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
Definition: readcf.cc:883
#define YY_USE(E)
Definition: readcf.cc:369

◆ yyerror()

void yyerror ( char *  s)

Definition at line 1445 of file readcf.cc.

1447{
1448 CERR << s << "\n";
1449}
#define CERR
Definition: readcf.cc:94

◆ yylex()

int yylex ( )

Definition at line 1454 of file readcf.cc.

1456{
1457 int c;
1458
1459 while ((c = defaultin->get()) == ' ' || c == '\t' || c == '\n' ) ;
1460 if ( isdigit( c ) ) {
1461 defaultin->putback( c );
1463 return NUM;
1464 }
1465 else if ( isalpha( c ) ) {
1466 // look for generators of GF(q)
1467 if ( getCharacteristic() > 0 && getGFDegree() > 1 && c == gf_name ) {
1468#ifdef BISONPP
1469 this->yylval = getGFGenerator();
1470#else
1472#endif
1473 }
1474 else if ( c == getDefaultVarName() ) {
1475 int cc;
1476 cc = defaultin->get();
1477 if ( cc == '_' ) {
1479#ifdef BISONPP
1480 this->yylval = Variable( index.getintval() );
1481#else
1482 yylval = Variable( index.getintval() );
1483#endif
1484 }
1485 else {
1486 defaultin->putback( cc );
1487#ifdef BISONPP
1488 this->yylval = Variable( (char)c );
1489#else
1490 yylval = Variable( (char)c );
1491#endif
1492 }
1493 }
1494 else {
1495#ifdef BISONPP
1496 this->yylval = Variable( (char)c );
1497#else
1498 yylval = Variable( (char)c );
1499#endif
1500 }
1501 return NUM;
1502 }
1503 return c;
1504}
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:134
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:933
static char * readString(ISTREAM &)
Definition: readcf.cc:1536

◆ yyparse()

int yyparse ( void  )

Definition at line 945 of file readcf.cc.

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

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 930 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 688 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 657 of file readcf.cc.

◆ yydefgoto

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

Definition at line 671 of file readcf.cc.

◆ yylval

YYSTYPE yylval

Definition at line 933 of file readcf.cc.

◆ yynerrs

int yynerrs

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

◆ yypgoto

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

Definition at line 665 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 707 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 714 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 699 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 679 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 562 of file readcf.cc.