source/ergo_input_processor.c File Reference

Parses the input. More...

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "ergo_scripted.h"
#include <stddef.h>

Classes

union  YYSTYPE
union  yyalloc

Defines

#define YYBISON   1
#define YYBISON_VERSION   "3.0.4"
#define YYSKELETON_NAME   "yacc.c"
#define YYPURE   0
#define YYPUSH   0
#define YYPULL   1
#define YYERROR_VERBOSE
#define YY_NULLPTR   0
#define YYERROR_VERBOSE   1
#define YYDEBUG   0
#define NUMBER   258
#define DOT   259
#define SYMBOL   260
#define EQUAL   261
#define STRING   262
#define EOFTAG   263
#define GETEXC   264
#define GETPOL   265
#define K_ALL   266
#define HELP   267
#define MOLTAG   268
#define GHOSTTAG   269
#define MOLDAL   270
#define QUIT   271
#define RUNTAG   272
#define SYSTEM   273
#define GHOST   274
#define ANGSTROM   275
#define PRECISION   276
#define RANGE   277
#define WARRANTY   278
#define LIST_DFT_FUNCS   279
#define IS_CHT_USED   280
#define SET_NTHREADS   281
#define PLUS   282
#define MINUS   283
#define TIMES   284
#define DIVIDE   285
#define POWER   286
#define LEFT_PARENTHESIS   287
#define RIGHT_PARENTHESIS   288
#define EOL   289
#define NEG   290
#define YYSTYPE_IS_TRIVIAL   1
#define YYSTYPE_IS_DECLARED   1
#define YYSIZE_T   size_t
#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)
#define YY_(Msgid)   Msgid
#define YY_ATTRIBUTE(Spec)
#define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
#define YY_ATTRIBUTE_UNUSED   YY_ATTRIBUTE ((__unused__))
#define _Noreturn   YY_ATTRIBUTE ((__noreturn__))
#define YYUSE(E)   ((void) (E))
#define YY_INITIAL_VALUE(Value)   Value
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
#define YYSTACK_ALLOC   YYMALLOC
#define YYSTACK_FREE   YYFREE
#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM
#define YYMALLOC   malloc
#define YYFREE   free
#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)
#define YYSTACK_BYTES(N)
#define YYCOPY_NEEDED   1
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
#define YYCOPY(Dst, Src, Count)
#define YYFINAL   37
#define YYLAST   108
#define YYNTOKENS   36
#define YYNNTS   9
#define YYNRULES   45
#define YYNSTATES   94
#define YYUNDEFTOK   2
#define YYMAXUTOK   290
#define YYTRANSLATE(YYX)   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
#define YYPACT_NINF   -41
#define yypact_value_is_default(Yystate)   (!!((Yystate) == (-41)))
#define YYTABLE_NINF   -6
#define yytable_value_is_error(Yytable_value)   0
#define yyerrok   (yyerrstatus = 0)
#define yyclearin   (yychar = YYEMPTY)
#define YYEMPTY   (-2)
#define YYEOF   0
#define YYACCEPT   goto yyacceptlab
#define YYABORT   goto yyabortlab
#define YYERROR   goto yyerrorlab
#define YYRECOVERING()   (!!yyerrstatus)
#define YYBACKUP(Token, Value)
#define YYTERROR   1
#define YYERRCODE   256
#define YYDPRINTF(Args)
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
#define YY_STACK_PRINT(Bottom, Top)
#define YY_REDUCE_PRINT(Rule)
#define YYINITDEPTH   200
#define YYMAXDEPTH   10000
#define YYCASE_(N, S)
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
#define YYSYNTAX_ERROR

Typedefs

typedef union YYSTYPE YYSTYPE
typedef unsigned char yytype_uint8
typedef signed char yytype_int8
typedef unsigned short int yytype_uint16
typedef short int yytype_int16

Enumerations

enum  yytokentype {
  NUMBER = 258, DOT = 259, SYMBOL = 260, EQUAL = 261,
  STRING = 262, EOFTAG = 263, GETEXC = 264, GETPOL = 265,
  K_ALL = 266, HELP = 267, MOLTAG = 268, GHOSTTAG = 269,
  MOLDAL = 270, QUIT = 271, RUNTAG = 272, SYSTEM = 273,
  GHOST = 274, ANGSTROM = 275, PRECISION = 276, RANGE = 277,
  WARRANTY = 278, LIST_DFT_FUNCS = 279, IS_CHT_USED = 280, SET_NTHREADS = 281,
  PLUS = 282, MINUS = 283, TIMES = 284, DIVIDE = 285,
  POWER = 286, LEFT_PARENTHESIS = 287, RIGHT_PARENTHESIS = 288, EOL = 289,
  NEG = 290, NUMBER = 258, DOT = 259, SYMBOL = 260,
  EQUAL = 261, STRING = 262, EOFTAG = 263, GETEXC = 264,
  GETPOL = 265, K_ALL = 266, HELP = 267, MOLTAG = 268,
  GHOSTTAG = 269, MOLDAL = 270, QUIT = 271, RUNTAG = 272,
  SYSTEM = 273, GHOST = 274, ANGSTROM = 275, PRECISION = 276,
  RANGE = 277, WARRANTY = 278, LIST_DFT_FUNCS = 279, IS_CHT_USED = 280,
  SET_NTHREADS = 281, PLUS = 282, MINUS = 283, TIMES = 284,
  DIVIDE = 285, POWER = 286, LEFT_PARENTHESIS = 287, RIGHT_PARENTHESIS = 288,
  EOL = 289, NEG = 290
}

Functions

int yylex (void)
int yyerror (const char *s)
int yyparse (void)
void * malloc (YYSIZE_T)
void free (void *)
static YYSIZE_T yystrlen (const char *yystr)
static char * yystpcpy (char *yydest, const char *yysrc)
static YYSIZE_T yytnamerr (char *yyres, const char *yystr)
static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken)
static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)

Variables

static const char * last_token = NULL
YYSTYPE yylval
static const yytype_uint8 yytranslate []
static const char *const yytname []
static const yytype_int8 yypact []
static const yytype_uint8 yydefact []
static const yytype_int8 yypgoto []
static const yytype_int8 yydefgoto []
static const yytype_int8 yytable []
static const yytype_uint8 yycheck []
static const yytype_uint8 yystos []
static const yytype_uint8 yyr1 []
static const yytype_uint8 yyr2 []
int yychar
int yynerrs
int ergo_scanner_lineno = 1
int ergo_scanner_reading_stdin = 0

Detailed Description

Parses the input.

Uses bison code generator to generate the parses.


Define Documentation

#define _Noreturn   YY_ATTRIBUTE ((__noreturn__))
#define ANGSTROM   275
#define DIVIDE   285
#define DOT   259
#define EOFTAG   263
#define EOL   289
#define EQUAL   261
#define GETEXC   264
#define GETPOL   265
#define GHOST   274
#define GHOSTTAG   269
#define HELP   267
#define IS_CHT_USED   280
#define K_ALL   266
#define LEFT_PARENTHESIS   287
#define LIST_DFT_FUNCS   279
#define MINUS   283
#define MOLDAL   270
#define MOLTAG   268
#define NEG   290
#define NUMBER   258
#define PLUS   282
#define POWER   286
#define PRECISION   276

Referenced by write_matrix(), and write_vector().

#define QUIT   271
#define RANGE   277
#define RIGHT_PARENTHESIS   288
#define RUNTAG   272
#define SET_NTHREADS   281
#define STRING   262
#define SYMBOL   260
#define SYSTEM   273
#define TIMES   284
#define WARRANTY   278
#define YY_ ( Msgid   )     Msgid

Referenced by yyparse(), and yysyntax_error().

#define YY_ATTRIBUTE ( Spec   ) 
#define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
#define YY_ATTRIBUTE_UNUSED   YY_ATTRIBUTE ((__unused__))
#define YY_IGNORE_MAYBE_UNINITIALIZED_END

Referenced by yydestruct(), and yyparse().

#define YY_INITIAL_VALUE ( Value   )     Value
#define YY_NULLPTR   0

Referenced by yysyntax_error().

#define YY_REDUCE_PRINT ( Rule   ) 

Referenced by yyparse().

#define YY_STACK_PRINT ( Bottom,
Top   ) 

Referenced by yyparse().

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

Referenced by yydestruct(), and yyparse().

#define YYABORT   goto yyabortlab

Referenced by yyparse().

#define YYACCEPT   goto yyacceptlab

Referenced by yyparse().

#define YYBACKUP ( Token,
Value   ) 
Value:
do                                                              \
  if (yychar == YYEMPTY)                                        \
    {                                                           \
      yychar = (Token);                                         \
      yylval = (Value);                                         \
      YYPOPSTACK (yylen);                                       \
      yystate = *yyssp;                                         \
      goto yybackup;                                            \
    }                                                           \
  else                                                          \
    {                                                           \
      yyerror (YY_("syntax error: cannot back up")); \
      YYERROR;                                                  \
    }                                                           \
while (0)
#define YYBISON   1
#define YYBISON_VERSION   "3.0.4"
#define YYCASE_ ( N,
 ) 
Value:
case N:                               \
        yyformat = S;                       \
      break

Referenced by yysyntax_error().

#define yyclearin   (yychar = YYEMPTY)
#define YYCOPY ( Dst,
Src,
Count   ) 
Value:
do                                        \
        {                                       \
          YYSIZE_T yyi;                         \
          for (yyi = 0; yyi < (Count); yyi++)   \
            (Dst)[yyi] = (Src)[yyi];            \
        }                                       \
      while (0)
#define YYCOPY_NEEDED   1
#define YYDEBUG   0
#define YYDPRINTF ( Args   ) 

Referenced by yyparse().

#define YYEMPTY   (-2)

Referenced by yyparse(), and yysyntax_error().

#define YYEOF   0

Referenced by yyparse().

#define YYERRCODE   256
#define yyerrok   (yyerrstatus = 0)
#define YYERROR   goto yyerrorlab

Referenced by yyparse().

#define YYERROR_VERBOSE   1
#define YYERROR_VERBOSE
#define YYFINAL   37

Referenced by yyparse().

#define YYFREE   free
#define YYINITDEPTH   200

Referenced by yyparse().

#define YYLAST   108

Referenced by yyparse(), and yysyntax_error().

#define YYMALLOC   malloc
#define YYMAXDEPTH   10000

Referenced by yyparse().

#define YYMAXUTOK   290
#define YYNNTS   9
#define YYNRULES   45
#define YYNSTATES   94
#define YYNTOKENS   36

Referenced by yyparse(), and yysyntax_error().

#define YYPACT_NINF   -41
#define yypact_value_is_default ( Yystate   )     (!!((Yystate) == (-41)))

Referenced by yyparse(), and yysyntax_error().

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

Referenced by yyparse().

#define YYPULL   1
#define YYPURE   0
#define YYPUSH   0
 
#define YYRECOVERING (  )     (!!yyerrstatus)
#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)
#define YYSIZE_T   size_t
#define YYSKELETON_NAME   "yacc.c"
#define YYSTACK_ALLOC   YYMALLOC

Referenced by yyparse().

#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM

Referenced by yysyntax_error().

#define YYSTACK_BYTES (  ) 
Value:
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
      + YYSTACK_GAP_MAXIMUM)

Referenced by yyparse().

#define YYSTACK_FREE   YYFREE

Referenced by yyparse().

#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)
#define YYSTACK_RELOCATE ( Stack_alloc,
Stack   ) 
Value:
do                                                                  \
      {                                                                 \
        YYSIZE_T yynewbytes;                                            \
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
        Stack = &yyptr->Stack_alloc;                                    \
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
        yyptr += yynewbytes / sizeof (*yyptr);                          \
      }                                                                 \
    while (0)

Referenced by yyparse().

#define YYSTYPE_IS_DECLARED   1
#define YYSTYPE_IS_TRIVIAL   1
#define YYSYNTAX_ERROR
Value:
yysyntax_error (&yymsg_alloc, &yymsg, \
                                        yyssp, yytoken)

Referenced by yyparse().

#define YYTABLE_NINF   -6
#define yytable_value_is_error ( Yytable_value   )     0

Referenced by yyparse(), and yysyntax_error().

#define YYTERROR   1

Referenced by yyparse(), and yysyntax_error().

#define YYTRANSLATE ( YYX   )     ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)

Referenced by yyparse().

#define YYUNDEFTOK   2
#define YYUSE (  )     ((void) (E))

Referenced by yydestruct().


Typedef Documentation

typedef union YYSTYPE YYSTYPE
typedef short int yytype_int16
typedef signed char yytype_int8
typedef unsigned short int yytype_uint16
typedef unsigned char yytype_uint8

Enumeration Type Documentation

Enumerator:
NUMBER 
DOT 
SYMBOL 
EQUAL 
STRING 
EOFTAG 
GETEXC 
GETPOL 
K_ALL 
HELP 
MOLTAG 
GHOSTTAG 
MOLDAL 
QUIT 
RUNTAG 
SYSTEM 
GHOST 
ANGSTROM 
PRECISION 
RANGE 
WARRANTY 
LIST_DFT_FUNCS 
IS_CHT_USED 
SET_NTHREADS 
PLUS 
MINUS 
TIMES 
DIVIDE 
POWER 
LEFT_PARENTHESIS 
RIGHT_PARENTHESIS 
EOL 
NEG 
NUMBER 
DOT 
SYMBOL 
EQUAL 
STRING 
EOFTAG 
GETEXC 
GETPOL 
K_ALL 
HELP 
MOLTAG 
GHOSTTAG 
MOLDAL 
QUIT 
RUNTAG 
SYSTEM 
GHOST 
ANGSTROM 
PRECISION 
RANGE 
WARRANTY 
LIST_DFT_FUNCS 
IS_CHT_USED 
SET_NTHREADS 
PLUS 
MINUS 
TIMES 
DIVIDE 
POWER 
LEFT_PARENTHESIS 
RIGHT_PARENTHESIS 
EOL 
NEG 

Function Documentation

void free ( void *   ) 
void* malloc ( YYSIZE_T   ) 
static void yydestruct ( const char *  yymsg,
int  yytype,
YYSTYPE yyvaluep 
) [static]
int yyerror ( const char *  s  ) 

References last_token.

Referenced by yyparse().

int yylex ( void   ) 

Referenced by yyparse().

int yyparse ( void   ) 
static char* yystpcpy ( char *  yydest,
const char *  yysrc 
) [static]

Referenced by yytnamerr().

static YYSIZE_T yystrlen ( const char *  yystr  )  [static]

References YYSIZE_T.

Referenced by yysyntax_error(), and yytnamerr().

static int yysyntax_error ( YYSIZE_T *  yymsg_alloc,
char **  yymsg,
yytype_int16 yyssp,
int  yytoken 
) [static]
static YYSIZE_T yytnamerr ( char *  yyres,
const char *  yystr 
) [static]

References YYSIZE_T, yystpcpy(), and yystrlen().

Referenced by yysyntax_error().


Variable Documentation

Referenced by ergo_parse_file(), and yyparse().

const char* last_token = NULL [static]

Referenced by yyerror(), and yyparse().

int yychar
const yytype_uint8 yycheck[] [static]
Initial value:
{
      40,     3,     3,     3,    29,     7,     7,    20,    20,     3,
      27,    28,    29,    30,    31,     5,    56,    57,     8,    44,
       7,    34,    34,    48,    49,    19,    28,    28,    28,     7,
      32,    32,    32,     7,    74,    75,    76,    77,    78,     0,
       1,    19,     7,     5,     5,     0,    11,     7,     9,    10,
       7,    12,    13,    14,    15,    16,    17,    18,    34,    32,
      21,    22,    23,    24,    25,    26,     3,    34,    27,    28,
      29,    30,    31,    34,    33,    27,    28,    29,    30,    31,
       4,    33,    29,    30,    31,     4,    34,     6,     3,     7,
       6,     5,     3,     3,     3,     3,    31,    33,     3,     6,
       3,     3,     3,     7,     3,    34,    38,     7,     5
}

Referenced by yyparse(), and yysyntax_error().

const yytype_uint8 yydefact[] [static]
Initial value:
{
       0,     8,    11,     0,     0,    17,     0,     0,     0,    32,
       0,     0,    21,     0,    28,    19,    20,     0,     0,     3,
       6,     0,     7,     0,     0,    18,     0,     0,     0,     0,
      22,     0,    24,    27,     0,     0,     0,     1,     0,     0,
       0,    29,     0,     0,     0,     0,    35,    13,     0,     0,
      15,    23,     0,     0,    38,     0,     0,     0,     0,     4,
      12,    10,     9,    30,    31,    14,     0,    36,    16,     0,
       0,    26,    43,     0,     0,     0,     0,     0,     0,    25,
       0,     0,     0,    45,    39,    40,    41,    42,    44,     0,
      33,     0,    37,    34
}

Referenced by yyparse().

const yytype_int8 yydefgoto[] [static]
Initial value:
{
      -1,    18,    19,    20,    21,    22,    47,    48,    58
}

Referenced by yyparse().

int yynerrs
const yytype_int8 yypact[] [static]
Initial value:
{
      39,   -41,   -41,    13,    26,    38,   -13,   -12,    22,   -41,
      40,    43,   -41,     6,   -41,   -41,   -41,    27,    45,    24,
     -41,    81,   -41,    63,    35,    76,    33,    10,    52,    10,
     -41,    82,   -41,   -41,    84,    85,    -2,   -41,    39,    86,
      -1,   -41,    89,    90,    10,    91,   -41,   -41,    10,    10,
     -41,   -41,    92,    93,   -41,    64,     0,     0,    41,   -41,
     -41,   -41,   -17,   -41,   -41,   -41,    95,   -41,   -41,    97,
      98,   -41,    65,    48,     0,     0,     0,     0,     0,   -41,
      99,    96,   101,   -41,    53,    53,    65,    65,    65,    71,
     -41,   100,   -41,   -41
}

Referenced by yyparse(), and yysyntax_error().

const yytype_int8 yypgoto[] [static]
Initial value:
{
     -41,    68,   -41,   -41,   103,   -41,   -25,   -41,   -40
}

Referenced by yyparse().

const yytype_uint8 yyr1[] [static]
Initial value:
{
       0,    36,    37,    37,    37,    38,    38,    38,    38,    39,
      39,    40,    40,    41,    41,    41,    41,    41,    41,    41,
      41,    41,    41,    41,    41,    41,    41,    41,    41,    41,
      41,    41,    41,    41,    41,    42,    42,    43,    44,    44,
      44,    44,    44,    44,    44,    44
}

Referenced by yyparse().

const yytype_uint8 yyr2[] [static]
Initial value:
{
       0,     2,     0,     1,     3,     0,     1,     1,     1,     3,
       3,     1,     3,     3,     4,     3,     4,     1,     2,     1,
       1,     1,     2,     3,     2,     4,     4,     2,     1,     3,
       4,     4,     1,     6,     7,     1,     2,     5,     1,     3,
       3,     3,     3,     2,     3,     3
}

Referenced by yyparse().

const yytype_uint8 yystos[] [static]
Initial value:
{
       0,     1,     5,     9,    10,    12,    13,    14,    15,    16,
      17,    18,    21,    22,    23,    24,    25,    26,    37,    38,
      39,    40,    41,     7,     7,    40,    20,    34,    20,    34,
       7,    19,     7,     7,     3,    19,    32,     0,    34,     4,
       6,     3,     7,    11,    34,     5,     8,    42,    43,    34,
      42,     7,     6,     3,     3,     7,    28,    32,    44,    37,
       5,     7,    44,     3,     3,    42,     3,    42,    42,     3,
       6,    33,    44,    44,    27,    28,    29,    30,    31,    33,
       3,     3,     3,    33,    44,    44,    44,    44,    44,     3,
       7,     3,    34,     7
}

Referenced by yyparse().

const yytype_int8 yytable[] [static]
Initial value:
{
      62,    54,    54,    54,    50,    55,    61,    26,    28,    34,
      74,    75,    76,    77,    78,    45,    72,    73,    46,    65,
      23,    27,    29,    67,    68,    35,    56,    56,    56,    30,
      57,    57,    57,    24,    84,    85,    86,    87,    88,    -2,
       1,    31,    42,     2,     2,    37,    43,    32,     3,     4,
      33,     5,     6,     7,     8,     9,    10,    11,    38,    36,
      12,    13,    14,    15,    16,    17,    41,    44,    74,    75,
      76,    77,    78,    -5,    79,    74,    75,    76,    77,    78,
      39,    83,    76,    77,    78,    39,    49,    40,    53,    51,
      52,    60,    63,    64,    66,    69,    78,    71,    80,    70,
      81,    82,    89,    90,    91,    92,    59,    93,    25
}

Referenced by yyparse(), and yysyntax_error().

const char* const yytname[] [static]
Initial value:
{
  "$end", "error", "$undefined", "NUMBER", "DOT", "SYMBOL", "EQUAL",
  "STRING", "EOFTAG", "GETEXC", "GETPOL", "K_ALL", "HELP", "MOLTAG",
  "GHOSTTAG", "MOLDAL", "QUIT", "RUNTAG", "SYSTEM", "GHOST", "ANGSTROM",
  "PRECISION", "RANGE", "WARRANTY", "LIST_DFT_FUNCS", "IS_CHT_USED",
  "SET_NTHREADS", "PLUS", "MINUS", "TIMES", "DIVIDE", "POWER",
  "LEFT_PARENTHESIS", "RIGHT_PARENTHESIS", "EOL", "NEG", "$accept",
  "Input", "Line", "Assignment", "Lvalue", "Command", "Molinput",
  "Molline", "Expression", YY_NULLPTR
}

Referenced by yysyntax_error().

const yytype_uint8 yytranslate[] [static]

Generated on 10 Jul 2018 for ergo by  doxygen 1.6.1