/* A Bison parser, made from calc_eqn.y
by GNU bison 1.35. */
#define YYBISON 1 /* Identify Bison output. */
# define DIGIT 257
# define LETTER 258
#line 2 "calc_eqn.y"
#include <stdio.h>
#include <ctype.h>
extern int regs[26]; /* values of variables a, b, c, ... */
extern int eqn_result; /* returned equation value */
extern char line[]; /* equation line to parse */
extern int line_index; /* index, initialize to zero, each equation */
static void yyerror(char *message);
static int yylex();
#ifndef YYSTYPE
# define YYSTYPE int
# define YYSTYPE_IS_TRIVIAL 1
#endif
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#define YYFINAL 29
#define YYFLAG -32768
#define YYNTBASE 13
/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
#define YYTRANSLATE(x) ((unsigned)(x) <= 258 ? yytranslate[x] : 20)
/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
static const char yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
6, 2, 2, 2, 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,
11, 12, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 5,
2, 7, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 8, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 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, 3, 4
};
#if YYDEBUG
static const short yyprhs[] =
{
0, 0, 1, 5, 9, 12, 16, 18, 22, 26,
28, 32, 34, 37, 39, 43, 45, 47, 49
};
static const short yyrhs[] =
{
-1, 13, 14, 5, 0, 13, 14, 6, 0, 13,
6, 0, 13, 1, 6, 0, 15, 0, 4, 7,
15, 0, 15, 8, 16, 0, 16, 0, 16, 9,
17, 0, 17, 0, 10, 18, 0, 18, 0, 11,
15, 12, 0, 4, 0, 19, 0, 3, 0, 19,
3, 0
};
#endif
#if YYDEBUG
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const short yyrline[] =
{
0, 24, 25, 26, 27, 28, 31, 33, 36, 38,
40, 42, 44, 46, 48, 50, 52, 54, 56
};
#endif
#if (YYDEBUG) || defined YYERROR_VERBOSE
/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
static const char *const yytname[] =
{
"$", "error", "$undefined.", "DIGIT", "LETTER", "';'", "'\\n'", "'='",
"'|'", "'&'", "'~'", "'('", "')'", "list", "stat", "expr", "fctr",
"uexp", "term", "number", 0
};
#endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const short yyr1[] =
{
0, 13, 13, 13, 13, 13, 14, 14, 15, 15,
16, 16, 17, 17, 18, 18, 18, 19, 19
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const short yyr2[] =
{
0, 0, 3, 3, 2, 3, 1, 3, 3, 1,
3, 1, 2, 1, 3, 1, 1, 1, 2
};
/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
doesn't specify something else to do. Zero means the default is an
error. */
static const short yydefact[] =
{
1, 0, 0, 17, 15, 4, 0, 0, 0, 6,
9, 11, 13, 16, 5, 0, 15, 12, 0, 2,
3, 0, 0, 18, 7, 14, 8, 10, 0, 0
};
static const short yydefgoto[] =
{
1, 8, 9, 10, 11, 12, 13
};
static const short yypact[] =
{
-32768, 0, -4,-32768, -2,-32768, 9, 4, 18, 8,
12,-32768,-32768, 16,-32768, 4,-32768,-32768, 10,-32768,
-32768, 4, 4,-32768, 8,-32768, 12,-32768, 25,-32768
};
static const short yypgoto[] =
{
-32768,-32768, 2, 5, 6, 21,-32768
};
#define YYLAST 28
static const short yytable[] =
{
28, 2, 14, 3, 4, 15, 5, 3, 16, 18,
6, 7, 3, 16, 6, 7, 21, 24, 21, 23,
7, 22, 25, 19, 20, 29, 26, 17, 27
};
static const short yycheck[] =
{
0, 1, 6, 3, 4, 7, 6, 3, 4, 7,
10, 11, 3, 4, 10, 11, 8, 15, 8, 3,
11, 9, 12, 5, 6, 0, 21, 6, 22
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/share/bison/bison.simple"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
/* This is the parser code that is written into each bison parser when
the %semantic_parser declaration is not specified in the grammar.
It was written by Richard Stallman by simplifying the hairy parser
used when %semantic_parser is specified. */
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
variables, as they might otherwise be expanded by user macros.
There are some unavoidable exceptions within include files to
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
/* The parser invokes alloca or malloc