k-dot-p 0.1

structspec_parser.c++ File Reference

#include <stdio.h>
#include <glib.h>
#include <unistd.h>
#include <stdlib.h>
#include <math.h>
#include <libmodelxx/grid.h++>
#include <libmodelxx/continuous_structure.h++>
#include "lexer_parser_enums.h++"
Include dependency graph for structspec_parser.c++:

Go to the source code of this file.

Classes

union  YYSTYPE
struct  YYLTYPE
union  yyalloc

Defines

#define YYBISON   1
#define YYBISON_VERSION   "2.4.1"
#define YYSKELETON_NAME   "yacc.c"
#define YYPURE   0
#define YYPUSH   0
#define YYPULL   1
#define YYLSP_NEEDED   1
#define YYDEBUG   1
#define YYERROR_VERBOSE   0
#define YYTOKEN_TABLE   0
#define YYTOKENTYPE
#define TOK_IDENTIFIER   258
#define TOK_STRING   259
#define TOK_ENERGY   260
#define TOK_LENGTH   261
#define TOK_FLOAT   262
#define TOK_INT   263
#define TOK_VECTOR   264
#define TOK_GRID_TYPE   265
#define TOK_STRUCTURE   266
#define TO_STRUCTURE   267
#define TOK_GRID   268
#define TOK_REGION   269
#define TOK_SHAPE   270
#define TOK_CONST   271
#define TOK_POTENTIAL   272
#define TOK_DOPING   273
#define UMINUS   274
#define YYSTYPE_IS_TRIVIAL   1
#define yystype   YYSTYPE
#define YYSTYPE_IS_DECLARED   1
#define yyltype   YYLTYPE
#define YYLTYPE_IS_DECLARED   1
#define YYLTYPE_IS_TRIVIAL   1
#define YYSIZE_T   unsigned int
#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)
#define YY_(msgid)   msgid
#define YYUSE(e)   ((void) (e))
#define YYID(n)   (n)
#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(To, From, Count)
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
#define YYFINAL   5
#define YYLAST   162
#define YYNTOKENS   41
#define YYNNTS   28
#define YYNRULES   74
#define YYNSTATES   144
#define YYUNDEFTOK   2
#define YYMAXUTOK   274
#define YYTRANSLATE(YYX)   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
#define YYPACT_NINF   -92
#define YYTABLE_NINF   -1
#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 YYFAIL   goto yyerrlab
#define YYRECOVERING()   (!!yyerrstatus)
#define YYBACKUP(Token, Value)
#define YYTERROR   1
#define YYERRCODE   256
#define YYRHSLOC(Rhs, K)   ((Rhs)[K])
#define YYLLOC_DEFAULT(Current, Rhs, N)
#define YY_LOCATION_PRINT(File, Loc)   ((void) 0)
#define YYLEX   yylex ()
#define YYFPRINTF   fprintf
#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 YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))

Typedefs

typedef union YYSTYPE YYSTYPE
typedef struct YYLTYPE YYLTYPE
typedef unsigned char yytype_uint8
typedef short int yytype_int8
typedef unsigned short int yytype_uint16
typedef short int yytype_int16

Enumerations

enum  yytokentype {
  TOK_IDENTIFIER = 258, TOK_STRING = 259, TOK_ENERGY = 260, TOK_LENGTH = 261,
  TOK_FLOAT = 262, TOK_INT = 263, TOK_VECTOR = 264, TOK_GRID_TYPE = 265,
  TOK_STRUCTURE = 266, TO_STRUCTURE = 267, TOK_GRID = 268, TOK_REGION = 269,
  TOK_SHAPE = 270, TOK_CONST = 271, TOK_POTENTIAL = 272, TOK_DOPING = 273,
  UMINUS = 274, TOK_IDENTIFIER = 258, TOK_STRING = 259, TOK_ENERGY = 260,
  TOK_LENGTH = 261, TOK_FLOAT = 262, TOK_INT = 263, TOK_VECTOR = 264,
  TOK_GRID_TYPE = 265, TOK_STRUCTURE = 266, TO_STRUCTURE = 267, TOK_GRID = 268,
  TOK_REGION = 269, TOK_SHAPE = 270, TOK_CONST = 271, TOK_POTENTIAL = 272,
  TOK_DOPING = 273, UMINUS = 274
}

Functions

int yylex (void)
void yyerror (const char *s)
double * new_double (double x)
int * new_int (int x)
struct function_expnew_fx (enum function_op op, struct function_exp *l, struct function_exp *r)
struct function_expnew_fx_const (int t, GList *values)
struct function_expnew_fx_func (const char *func, struct function_exp *arg)
struct function_expnew_fx_const_ints (int t, GList *int_values)
struct function_expnew_fx_const_single (double value)
struct function_expnew_fx_symbol (char *symbol)
static void yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp) FILE *yyoutput
static void yydestruct (yymsg, yytype, yyvaluep, yylocationp) const char *yymsg
int yyparse ()

Variables

int region_sequence_number = 0
struct key_valuekv
struct gridg = NULL
struct continuous_structurethe_structure = NULL
static const yytype_uint8 yytranslate []
static const yytype_uint8 yyprhs []
static const yytype_int8 yyrhs []
static const yytype_uint16 yyrline []
static const char *const yytname []
static const yytype_uint8 yyr1 []
static const yytype_uint8 yyr2 []
static const yytype_uint8 yydefact []
static const yytype_int8 yydefgoto []
static const yytype_int16 yypact []
static const yytype_int8 yypgoto []
static const yytype_uint8 yytable []
static const yytype_int16 yycheck []
static const yytype_uint8 yystos []
int yytype
YYSTYPE const *const yyvaluep
YYLTYPE const *const yylocationp
yytype_int16yytop
YYLTYPEyylsp
int yyrule
int yychar
YYSTYPE yylval
YYLTYPE yylloc
int yynerrs

Define Documentation

#define TO_STRUCTURE   267

Definition at line 265 of file structspec_parser.c++.

#define TOK_CONST   271

Definition at line 269 of file structspec_parser.c++.

Referenced by while().

#define TOK_DOPING   273

Definition at line 271 of file structspec_parser.c++.

Referenced by while().

#define TOK_ENERGY   260

Definition at line 258 of file structspec_parser.c++.

Referenced by while().

#define TOK_FLOAT   262

Definition at line 260 of file structspec_parser.c++.

Referenced by while().

#define TOK_GRID   268

Definition at line 266 of file structspec_parser.c++.

Referenced by while().

#define TOK_GRID_TYPE   265

Definition at line 263 of file structspec_parser.c++.

Referenced by while().

#define TOK_IDENTIFIER   258

Definition at line 256 of file structspec_parser.c++.

Referenced by while().

#define TOK_INT   263

Definition at line 261 of file structspec_parser.c++.

Referenced by while().

#define TOK_LENGTH   261

Definition at line 259 of file structspec_parser.c++.

Referenced by while().

#define TOK_POTENTIAL   272

Definition at line 270 of file structspec_parser.c++.

Referenced by while().

#define TOK_REGION   269

Definition at line 267 of file structspec_parser.c++.

Referenced by while().

#define TOK_SHAPE   270

Definition at line 268 of file structspec_parser.c++.

Referenced by while().

#define TOK_STRING   259

Definition at line 257 of file structspec_parser.c++.

Referenced by while().

#define TOK_STRUCTURE   266

Definition at line 264 of file structspec_parser.c++.

Referenced by while().

#define TOK_VECTOR   264

Definition at line 262 of file structspec_parser.c++.

#define UMINUS   274

Definition at line 272 of file structspec_parser.c++.

#define YY_ (   msgid)    msgid

Definition at line 386 of file structspec_parser.c++.

Referenced by yyparse().

#define YY_LOCATION_PRINT (   File,
  Loc 
)    ((void) 0)

Definition at line 920 of file structspec_parser.c++.

#define YY_REDUCE_PRINT (   Rule)
Value:
do {          \
  if (yydebug)        \
    yy_reduce_print (yyvsp, yylsp, Rule); \
} while (YYID (0))

Referenced by yyparse().

#define YY_STACK_PRINT (   Bottom,
  Top 
)
Value:
do {                \
  if (yydebug)              \
    yy_stack_print ((Bottom), (Top));       \
} while (YYID (0))

Referenced by yyparse().

#define YY_SYMBOL_PRINT (   Title,
  Type,
  Value,
  Location 
)
Value:
do {                    \
  if (yydebug)                  \
    {                   \
      YYFPRINTF (stderr, "%s ", Title);           \
      yy_symbol_print (stderr,              \
      Type, Value, Location); \
      YYFPRINTF (stderr, "\n");             \
    }                   \
} while (YYID (0))

Definition at line 947 of file structspec_parser.c++.

Referenced by yyparse().

#define YYABORT   goto yyabortlab

Definition at line 849 of file structspec_parser.c++.

Referenced by yyparse().

#define YYACCEPT   goto yyacceptlab

Definition at line 848 of file structspec_parser.c++.

Referenced by yyparse().

#define YYBACKUP (   Token,
  Value 
)
Value:
do                \
  if (yychar == YYEMPTY && yylen == 1)        \
    {               \
      yychar = (Token);           \
      yylval = (Value);           \
      yytoken = YYTRANSLATE (yychar);       \
      YYPOPSTACK (1);           \
      goto yybackup;            \
    }               \
  else                \
    {               \
      yyerror (YY_("syntax error: cannot back up")); \
      YYERROR;              \
    }               \
while (YYID (0))

Definition at line 861 of file structspec_parser.c++.

#define YYBISON   1

Definition at line 46 of file structspec_parser.c++.

#define YYBISON_VERSION   "2.4.1"

Definition at line 49 of file structspec_parser.c++.

#define yyclearin   (yychar = YYEMPTY)

Definition at line 844 of file structspec_parser.c++.

#define YYCOPY (   To,
  From,
  Count 
)
Value:
do          \
  {         \
    YYSIZE_T yyi;       \
    for (yyi = 0; yyi < (Count); yyi++) \
      (To)[yyi] = (From)[yyi];    \
  }         \
      while (YYID (0))

Definition at line 514 of file structspec_parser.c++.

#define YYDEBUG   1

Definition at line 101 of file structspec_parser.c++.

#define YYDPRINTF (   Args)
Value:
do {            \
  if (yydebug)          \
    YYFPRINTF Args;       \
} while (YYID (0))

Definition at line 941 of file structspec_parser.c++.

Referenced by yyparse().

#define YYEMPTY   (-2)

Definition at line 845 of file structspec_parser.c++.

Referenced by yyparse().

#define YYEOF   0

Definition at line 846 of file structspec_parser.c++.

Referenced by yyparse().

#define YYERRCODE   256

Definition at line 880 of file structspec_parser.c++.

#define yyerrok   (yyerrstatus = 0)

Definition at line 843 of file structspec_parser.c++.

#define YYERROR   goto yyerrorlab

Definition at line 850 of file structspec_parser.c++.

#define YYERROR_VERBOSE   0

Definition at line 221 of file structspec_parser.c++.

#define YYFAIL   goto yyerrlab

Definition at line 857 of file structspec_parser.c++.

#define YYFINAL   5

Definition at line 544 of file structspec_parser.c++.

Referenced by yyparse().

#define YYFPRINTF   fprintf

Definition at line 938 of file structspec_parser.c++.

#define YYFREE   free

Definition at line 475 of file structspec_parser.c++.

#define YYID (   n)    (n)

Definition at line 399 of file structspec_parser.c++.

Referenced by yyparse().

#define YYINITDEPTH   200

Definition at line 1105 of file structspec_parser.c++.

Referenced by yyparse().

#define YYLAST   162

Definition at line 546 of file structspec_parser.c++.

Referenced by yyparse().

#define YYLEX   yylex ()

Definition at line 930 of file structspec_parser.c++.

Referenced by yyparse().

#define YYLLOC_DEFAULT (   Current,
  Rhs,
 
)
Value:
do                  \
      if (YYID (N))                                                    \
  {               \
    (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;  \
    (Current).first_column = YYRHSLOC (Rhs, 1).first_column;  \
    (Current).last_line    = YYRHSLOC (Rhs, N).last_line;   \
    (Current).last_column  = YYRHSLOC (Rhs, N).last_column; \
  }               \
      else                \
  {               \
    (Current).first_line   = (Current).last_line   =    \
      YYRHSLOC (Rhs, 0).last_line;        \
    (Current).first_column = (Current).last_column =    \
      YYRHSLOC (Rhs, 0).last_column;        \
  }               \
    while (YYID (0))

Definition at line 889 of file structspec_parser.c++.

Referenced by yyparse().

#define YYLSP_NEEDED   1

Definition at line 64 of file structspec_parser.c++.

#define yyltype   YYLTYPE

Definition at line 319 of file structspec_parser.c++.

#define YYLTYPE_IS_DECLARED   1

Definition at line 320 of file structspec_parser.c++.

#define YYLTYPE_IS_TRIVIAL   1

Definition at line 321 of file structspec_parser.c++.

#define YYMALLOC   malloc

Definition at line 468 of file structspec_parser.c++.

#define YYMAXDEPTH   10000

Definition at line 1116 of file structspec_parser.c++.

Referenced by yyparse().

#define YYMAXUTOK   274

Definition at line 559 of file structspec_parser.c++.

#define YYNNTS   28

Definition at line 551 of file structspec_parser.c++.

#define YYNRULES   74

Definition at line 553 of file structspec_parser.c++.

#define YYNSTATES   144

Definition at line 555 of file structspec_parser.c++.

#define YYNTOKENS   41

Definition at line 549 of file structspec_parser.c++.

Referenced by yyparse().

#define YYPACT_NINF   -92

Definition at line 747 of file structspec_parser.c++.

Referenced by yyparse().

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

Referenced by yyparse().

#define YYPULL   1

Definition at line 61 of file structspec_parser.c++.

#define YYPURE   0

Definition at line 55 of file structspec_parser.c++.

#define YYPUSH   0

Definition at line 58 of file structspec_parser.c++.

#define YYRECOVERING ( )    (!!yyerrstatus)

Definition at line 859 of file structspec_parser.c++.

#define YYRHSLOC (   Rhs,
 
)    ((Rhs)[K])

Definition at line 887 of file structspec_parser.c++.

#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)

Definition at line 376 of file structspec_parser.c++.

#define YYSIZE_T   unsigned int

Definition at line 372 of file structspec_parser.c++.

Referenced by yyparse().

#define YYSKELETON_NAME   "yacc.c"

Definition at line 52 of file structspec_parser.c++.

#define YYSTACK_ALLOC   YYMALLOC

Definition at line 454 of file structspec_parser.c++.

Referenced by yyparse().

#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM

Definition at line 457 of file structspec_parser.c++.

Referenced by yyparse().

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

Definition at line 503 of file structspec_parser.c++.

Referenced by yyparse().

#define YYSTACK_FREE   YYFREE

Definition at line 455 of file structspec_parser.c++.

Referenced by yyparse().

#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)

Definition at line 499 of file structspec_parser.c++.

#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 (YYID (0))

Definition at line 530 of file structspec_parser.c++.

Referenced by yyparse().

#define yystype   YYSTYPE

Definition at line 307 of file structspec_parser.c++.

#define YYSTYPE_IS_DECLARED   1

Definition at line 308 of file structspec_parser.c++.

#define YYSTYPE_IS_TRIVIAL   1

Definition at line 306 of file structspec_parser.c++.

#define YYTABLE_NINF   -1

Definition at line 779 of file structspec_parser.c++.

Referenced by yyparse().

#define YYTERROR   1

Definition at line 879 of file structspec_parser.c++.

Referenced by yyparse().

#define YYTOKEN_TABLE   0

Definition at line 226 of file structspec_parser.c++.

#define YYTOKENTYPE

Definition at line 232 of file structspec_parser.c++.

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

Definition at line 561 of file structspec_parser.c++.

Referenced by yyparse().

#define YYUNDEFTOK   2

Definition at line 558 of file structspec_parser.c++.

#define YYUSE (   e)    ((void) (e))

Definition at line 392 of file structspec_parser.c++.


Typedef Documentation

typedef struct YYLTYPE YYLTYPE
typedef union YYSTYPE YYSTYPE
typedef short int yytype_int16

Definition at line 359 of file structspec_parser.c++.

typedef short int yytype_int8

Definition at line 347 of file structspec_parser.c++.

typedef unsigned short int yytype_uint16

Definition at line 353 of file structspec_parser.c++.

typedef unsigned char yytype_uint8

Definition at line 338 of file structspec_parser.c++.


Enumeration Type Documentation

Enumerator:
TOK_IDENTIFIER 
TOK_STRING 
TOK_ENERGY 
TOK_LENGTH 
TOK_FLOAT 
TOK_INT 
TOK_VECTOR 
TOK_GRID_TYPE 
TOK_STRUCTURE 
TO_STRUCTURE 
TOK_GRID 
TOK_REGION 
TOK_SHAPE 
TOK_CONST 
TOK_POTENTIAL 
TOK_DOPING 
UMINUS 
TOK_IDENTIFIER 
TOK_STRING 
TOK_ENERGY 
TOK_LENGTH 
TOK_FLOAT 
TOK_INT 
TOK_VECTOR 
TOK_GRID_TYPE 
TOK_STRUCTURE 
TO_STRUCTURE 
TOK_GRID 
TOK_REGION 
TOK_SHAPE 
TOK_CONST 
TOK_POTENTIAL 
TOK_DOPING 
UMINUS 

Definition at line 235 of file structspec_parser.c++.

                    {
     TOK_IDENTIFIER = 258,
     TOK_STRING = 259,
     TOK_ENERGY = 260,
     TOK_LENGTH = 261,
     TOK_FLOAT = 262,
     TOK_INT = 263,
     TOK_VECTOR = 264,
     TOK_GRID_TYPE = 265,
     TOK_STRUCTURE = 266,
     TO_STRUCTURE = 267,
     TOK_GRID = 268,
     TOK_REGION = 269,
     TOK_SHAPE = 270,
     TOK_CONST = 271,
     TOK_POTENTIAL = 272,
     TOK_DOPING = 273,
     UMINUS = 274
   };

Function Documentation

double* new_double ( double  x)

Definition at line 114 of file structspec_parser.c++.

Referenced by new_fx_const_ints(), new_fx_const_single(), and yyparse().

{double* d = (double*)malloc(sizeof(double)); *d = x; return d;}

Here is the caller graph for this function:

struct function_exp* new_fx ( enum function_op  op,
struct function_exp l,
struct function_exp r 
) [read]

Set up a function expression AST node.

Definition at line 119 of file structspec_parser.c++.

References kdotp::libmodelxx::postprocessing::function_exp::l, kdotp::libmodelxx::postprocessing::function_exp::op, and kdotp::libmodelxx::postprocessing::function_exp::r.

Referenced by new_fx_func(), and yyparse().

                                                                                                 {
  struct function_exp* f = (struct function_exp*)malloc(sizeof(struct function_exp));
  g_assert(f != NULL);
  f->op = op;
  f->l = l;
  f->r = r;
  return f;
}

Here is the caller graph for this function:

struct function_exp* new_fx_const ( int  t,
GList *  values 
) [read]

Convenience function for building functin_expression AST.

Note:
that the doubles pointed to by values will NOT be linked into the new list. Rather, they'll be copied.

Definition at line 131 of file structspec_parser.c++.

References kdotp::libmodelxx::postprocessing::BINARY, kdotp::libmodelxx::postprocessing::CONST, kdotp::libmodelxx::grid::INVALID, kdotp::libmodelxx::postprocessing::function_const::op, kdotp::libmodelxx::postprocessing::SCALAR, kdotp::libmodelxx::postprocessing::function_const::t, kdotp::libmodelxx::postprocessing::function_const::value, kdotp::libmodelxx::postprocessing::VECTOR2, and kdotp::libmodelxx::postprocessing::VECTOR3.

Referenced by new_fx_const_ints(), and yyparse().

                                                        {
  struct function_const* f = (struct function_const*)malloc(sizeof(struct function_const));
  g_assert(f != NULL);
  f->op = kdotp::libmodelxx::postprocessing::CONST;
  switch(t) {
  case 0:
    f->t = kdotp::libmodelxx::postprocessing::BINARY;
    break;
  case 1:
    f->t = kdotp::libmodelxx::postprocessing::SCALAR;
    break;
  case 2:
    f->t = kdotp::libmodelxx::postprocessing::VECTOR2;
    break;
  case 3:
    f->t = kdotp::libmodelxx::postprocessing::VECTOR3;
    break;
  default:
    f->t = kdotp::libmodelxx::postprocessing::INVALID;
  }
  int len=g_list_length(values);
  double* vals = (double*)malloc(len*sizeof(double));
  g_assert(vals != NULL);
  f->value = vals;
  int i;
  GList *l;
  for(l = values, i=0; l!=NULL; l=l->next, i++) vals[i] = *(double*)(l->data);
  return (struct function_exp*)f;
}

Here is the caller graph for this function:

struct function_exp* new_fx_const_ints ( int  t,
GList *  int_values 
) [read]

Convenient from of new_fx_const for a GList* of integers.

Definition at line 172 of file structspec_parser.c++.

References new_double(), and new_fx_const().

                                                                 {
  GList *l = NULL;
  /*Basically, use implicit conversion from int to double with the *values* in the int_values list.*/
  /*Throw the result in the new list l*/
  for(GList *ll = int_values; ll!=NULL; ll=ll->next) l = g_list_append(l, new_double(*(int*)(l->data)));
  struct function_exp* f = new_fx_const(t, l);
  /*Free the values in the list and then the list.*/
  for(GList *ll = l; ll!=NULL; ll=ll->next) free(l->data);
  g_list_free(l);
  return f;
}

Here is the call graph for this function:

struct function_exp* new_fx_const_single ( double  value) [read]

More convenient form of new_fx_const for a single double or integer value.

Definition at line 185 of file structspec_parser.c++.

References kdotp::libmodelxx::postprocessing::CONST, new_double(), kdotp::libmodelxx::postprocessing::function_const::op, kdotp::libmodelxx::postprocessing::SCALAR, kdotp::libmodelxx::postprocessing::function_const::t, and kdotp::libmodelxx::postprocessing::function_const::value.

Referenced by yyparse().

                                                       {
  struct function_const* f = (struct function_const*)malloc(sizeof(struct function_const));
  g_assert(f != NULL);
  f->op = kdotp::libmodelxx::postprocessing::CONST;
  f->t = kdotp::libmodelxx::postprocessing::SCALAR;
  f->value = new_double(value);
  return (struct function_exp*)f;
}

Here is the call graph for this function:

Here is the caller graph for this function:

struct function_exp* new_fx_func ( const char *  func,
struct function_exp arg 
) [read]

Set up a function

Definition at line 162 of file structspec_parser.c++.

References kdotp::libmodelxx::postprocessing::function_get_op_for_builtin_function(), new_fx(), and kdotp::libmodelxx::postprocessing::NOT.

Referenced by yyparse().

                                                                             {
  enum function_op op = function_get_op_for_builtin_function(func);
  if(op ==  kdotp::libmodelxx::postprocessing::NOT) {
    fprintf(stderr, "ERROR: couldn't determine function (%s)\n", func);
    exit(1);
  }
  return new_fx(op, NULL, arg);
}

Here is the call graph for this function:

Here is the caller graph for this function:

struct function_exp* new_fx_symbol ( char *  symbol) [read]

Definition at line 193 of file structspec_parser.c++.

References kdotp::libmodelxx::postprocessing::function_symbol::op, kdotp::libmodelxx::postprocessing::function_symbol::symbol, and kdotp::libmodelxx::postprocessing::SYMBOL.

Referenced by yyparse().

                                                 {
  struct function_symbol* f = (struct function_symbol*)malloc(sizeof(struct function_symbol));
  g_assert(f != NULL);
  f->op = kdotp::libmodelxx::postprocessing::SYMBOL;
  GString *s = g_string_new(symbol);
  f->symbol = s->str;
  g_string_free(s, FALSE);
  return (struct function_exp*)f;
}

Here is the caller graph for this function:

int* new_int ( int  x)

Definition at line 115 of file structspec_parser.c++.

Referenced by yyparse().

{int* d = (int*)malloc(sizeof(int)); *d = x; return d;}

Here is the caller graph for this function:

static void yy_symbol_value_print ( yyoutput  ,
yytype  ,
yyvaluep  ,
yylocationp   
) [static]
static void yydestruct ( yymsg  ,
yytype  ,
yyvaluep  ,
yylocationp   
) const [static]

Referenced by yyparse().

Here is the caller graph for this function:

void yyerror ( const char *  s)

Definition at line 2565 of file structspec_parser.c++.

Referenced by yyparse().

                            {
  fprintf(stderr, "parser error: %s\n", s);
}

Here is the caller graph for this function:

int yylex ( void  )
int yyparse ( )

Definition at line 1416 of file structspec_parser.c++.

References kdotp::libmodelxx::grid::AND, kdotp::libmodelxx::grid::grid::box_size, kdp::constants::c, kdotp::libmodelxx::postprocessing::CONST, kdotp::libmodelxx::continuous_structure::convert_energy_to_hartree(), kdotp::libmodelxx::continuous_structure::convert_length_to_nm(), kdotp::libmodelxx::postprocessing::CROSS, kdotp::libmodelxx::grid::value::d, kdotp::libmodelxx::grid::shape::descriptor, kdotp::libmodelxx::grid::grid::dimensions, kdotp::libmodelxx::postprocessing::DIV, YYSTYPE::doping, kdotp::libmodelxx::continuous_structure::continuous_structure::dopings, kdotp::libmodelxx::postprocessing::DOT, kdotp::libmodelxx::continuous_structure::potential::E, YYSTYPE::energy, kdotp::libmodelxx::continuous_structure::potential::Evec, YYSTYPE::exp, kdotp::libmodelxx::continuous_structure::doping::f, kdotp::libmodelxx::continuous_structure::region::f, YYLTYPE::first_column, YYLTYPE::first_line, kdotp::libmodelxx::grid::FLOAT, kdotp::libmodelxx::continuous_structure::potential::function, kdotp::libmodelxx::postprocessing::function_print_tree(), YYSTYPE::fval, kdotp::libmodelxx::continuous_structure::continuous_structure::g, YYSTYPE::g, g, kdotp::libmodelxx::grid::shape::generic, kdotp::libmodelxx::grid::get_shape_from_identifier(), kdotp::libmodelxx::grid::get_string_from_shape_type(), kdotp::libmodelxx::grid::GLOBAL, YYSTYPE::gt, kdotp::libmodelxx::grid::INVALID, YYSTYPE::ival, kdotp::libmodelxx::grid::key_value::key, kdotp::libmodelxx::continuous_structure::doping::key_values, kdotp::libmodelxx::continuous_structure::continuous_structure::key_values, kdotp::libmodelxx::grid::grid::key_values, kv, YYSTYPE::kvu, kdotp::libmodelxx::grid::shape_tree::l, kdotp::libmodelxx::grid::value::l, YYLTYPE::last_column, YYLTYPE::last_line, kdotp::libmodelxx::grid::LEAF, YYSTYPE::len, YYSTYPE::list, kdotp::libmodelxx::continuous_structure::region::mat1, kdotp::libmodelxx::continuous_structure::region::mat2, kdotp::libmodelxx::postprocessing::MINUS, kdotp::libmodelxx::postprocessing::MUL, kdotp::libmodelxx::postprocessing::NEG, new_double(), new_fx(), new_fx_const(), new_fx_const_single(), new_fx_func(), new_fx_symbol(), new_int(), kdotp::libmodelxx::grid::NOT, kdotp::libmodelxx::grid::shape::op, kdotp::libmodelxx::grid::shape_tree::op, kdotp::libmodelxx::grid::OR, kdotp::libmodelxx::postprocessing::PLUS, YYSTYPE::potential, kdotp::libmodelxx::continuous_structure::continuous_structure::potential, kdotp::libmodelxx::grid::shape_tree::r, YYSTYPE::region, kdotp::libmodelxx::continuous_structure::continuous_structure::regions, kdotp::libmodelxx::grid::value::s, YYSTYPE::s, kdotp::libmodelxx::grid::grid::site_length, kdotp::libmodelxx::continuous_structure::doping::st, str, YYSTYPE::str, YYSTYPE::stree, kdotp::libmodelxx::grid::STRING, kdotp::libmodelxx::grid::key_value::t, kdotp::libmodelxx::grid::grid::t, the_structure, kdotp::libmodelxx::grid::shape::type, kdotp::libmodelxx::grid::key_value::value, kdotp::libmodelxx::grid::VECTOR, kdotp::libmodelxx::grid::VECTOR_SET, kdotp::libmodelxx::continuous_structure::region::x, kdotp::libmodelxx::grid::XOR, YY_, YY_REDUCE_PRINT, YY_STACK_PRINT, YY_SYMBOL_PRINT, YYABORT, YYACCEPT, yyalloc(), yycheck, yydefact, yydefgoto, yydestruct(), YYDPRINTF, YYEMPTY, YYEOF, yyerror(), YYFINAL, YYID, YYINITDEPTH, YYLAST, YYLEX, yylloc, YYLLOC_DEFAULT, yyalloc::yyls_alloc, yylsp, yylval, YYMAXDEPTH, yynerrs, YYNTOKENS, yypact, YYPACT_NINF, yypgoto, YYPOPSTACK, yyr1, yyr2, YYSIZE_T, yyalloc::yyss_alloc, YYSTACK_ALLOC, YYSTACK_ALLOC_MAXIMUM, YYSTACK_BYTES, YYSTACK_FREE, YYSTACK_RELOCATE, yystos, yytable, YYTABLE_NINF, YYTERROR, YYTRANSLATE, and yyalloc::yyvs_alloc.

Referenced by main().

{


    int yystate;
    /* Number of tokens to shift before error messages enabled.  */
    int yyerrstatus;

    /* The stacks and their tools:
       `yyss': related to states.
       `yyvs': related to semantic values.
       `yyls': related to locations.

       Refer to the stacks thru separate pointers, to allow yyoverflow
       to reallocate them elsewhere.  */

    /* The state stack.  */
    yytype_int16 yyssa[YYINITDEPTH];
    yytype_int16 *yyss;
    yytype_int16 *yyssp;

    /* The semantic value stack.  */
    YYSTYPE yyvsa[YYINITDEPTH];
    YYSTYPE *yyvs;
    YYSTYPE *yyvsp;

    /* The location stack.  */
    YYLTYPE yylsa[YYINITDEPTH];
    YYLTYPE *yyls;
    YYLTYPE *yylsp;

    /* The locations where the error started and ended.  */
    YYLTYPE yyerror_range[2];

    YYSIZE_T yystacksize;

  int yyn;
  int yyresult;
  /* Lookahead token as an internal (translated) token number.  */
  int yytoken;
  /* The variables used to return semantic value and location from the
     action routines.  */
  YYSTYPE yyval;
  YYLTYPE yyloc;

#if YYERROR_VERBOSE
  /* Buffer for error messages, and its allocated size.  */
  char yymsgbuf[128];
  char *yymsg = yymsgbuf;
  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif

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

  /* The number of symbols on the RHS of the reduced rule.
     Keep to zero when no symbol should be popped.  */
  int yylen = 0;

  yytoken = 0;
  yyss = yyssa;
  yyvs = yyvsa;
  yyls = yylsa;
  yystacksize = YYINITDEPTH;

  YYDPRINTF ((stderr, "Starting parse\n"));

  yystate = 0;
  yyerrstatus = 0;
  yynerrs = 0;
  yychar = YYEMPTY; /* Cause a token to be read.  */

  /* Initialize stack pointers.
     Waste one element of value and location stack
     so that they stay on the same level as the state stack.
     The wasted elements are never initialized.  */
  yyssp = yyss;
  yyvsp = yyvs;
  yylsp = yyls;

#if YYLTYPE_IS_TRIVIAL
  /* Initialize the default location before parsing starts.  */
  yylloc.first_line   = yylloc.last_line   = 1;
  yylloc.first_column = yylloc.last_column = 1;
#endif

  goto yysetstate;

/*------------------------------------------------------------.
| yynewstate -- Push a new state, which is found in yystate.  |
`------------------------------------------------------------*/
 yynewstate:
  /* In all cases, when you get here, the value and location stacks
     have just been pushed.  So pushing a state here evens the stacks.  */
  yyssp++;

 yysetstate:
  *yyssp = yystate;

  if (yyss + yystacksize - 1 <= yyssp)
    {
      /* Get the current used size of the three stacks, in elements.  */
      YYSIZE_T yysize = yyssp - yyss + 1;

#ifdef yyoverflow
      {
  /* Give user a chance to reallocate the stack.  Use copies of
     these so that the &'s don't force the real ones into
     memory.  */
  YYSTYPE *yyvs1 = yyvs;
  yytype_int16 *yyss1 = yyss;
  YYLTYPE *yyls1 = yyls;

  /* Each stack pointer address is followed by the size of the
     data in use in that stack, in bytes.  This used to be a
     conditional around just the two extra args, but that might
     be undefined if yyoverflow is a macro.  */
  yyoverflow (YY_("memory exhausted"),
        &yyss1, yysize * sizeof (*yyssp),
        &yyvs1, yysize * sizeof (*yyvsp),
        &yyls1, yysize * sizeof (*yylsp),
        &yystacksize);

  yyls = yyls1;
  yyss = yyss1;
  yyvs = yyvs1;
      }
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
      goto yyexhaustedlab;
# else
      /* Extend the stack our own way.  */
      if (YYMAXDEPTH <= yystacksize)
  goto yyexhaustedlab;
      yystacksize *= 2;
      if (YYMAXDEPTH < yystacksize)
  yystacksize = YYMAXDEPTH;

      {
  yytype_int16 *yyss1 = yyss;
  union yyalloc *yyptr =
    (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
  if (! yyptr)
    goto yyexhaustedlab;
  YYSTACK_RELOCATE (yyss_alloc, yyss);
  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
  YYSTACK_RELOCATE (yyls_alloc, yyls);
#  undef YYSTACK_RELOCATE
  if (yyss1 != yyssa)
    YYSTACK_FREE (yyss1);
      }
# endif
#endif /* no yyoverflow */

      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;
      yylsp = yyls + yysize - 1;

      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
      (unsigned long int) yystacksize));

      if (yyss + yystacksize - 1 <= yyssp)
  YYABORT;
    }

  YYDPRINTF ((stderr, "Entering state %d\n", yystate));

  if (yystate == YYFINAL)
    YYACCEPT;

  goto yybackup;

/*-----------.
| yybackup.  |
`-----------*/
yybackup:

  /* Do appropriate processing given the current state.  Read a
     lookahead token if we need one and don't already have one.  */

  /* First try to decide what to do without reference to lookahead token.  */
  yyn = yypact[yystate];
  if (yyn == YYPACT_NINF)
    goto yydefault;

  /* Not known => get a lookahead token if don't already have one.  */

  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
  if (yychar == YYEMPTY)
    {
      YYDPRINTF ((stderr, "Reading a token: "));
      yychar = YYLEX;
    }

  if (yychar <= YYEOF)
    {
      yychar = yytoken = YYEOF;
      YYDPRINTF ((stderr, "Now at end of input.\n"));
    }
  else
    {
      yytoken = YYTRANSLATE (yychar);
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
    }

  /* If the proper action on seeing token YYTOKEN is to reduce or to
     detect an error, take that action.  */
  yyn += yytoken;
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
    goto yydefault;
  yyn = yytable[yyn];
  if (yyn <= 0)
    {
      if (yyn == 0 || yyn == YYTABLE_NINF)
  goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }

  /* Count tokens shifted since error; after three, turn off error
     status.  */
  if (yyerrstatus)
    yyerrstatus--;

  /* Shift the lookahead token.  */
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);

  /* Discard the shifted token.  */
  yychar = YYEMPTY;

  yystate = yyn;
  *++yyvsp = yylval;
  *++yylsp = yylloc;
  goto yynewstate;


/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state.  |
`-----------------------------------------------------------*/
yydefault:
  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;
  goto yyreduce;


/*-----------------------------.
| yyreduce -- Do a reduction.  |
`-----------------------------*/
yyreduce:
  /* yyn is the number of a rule to reduce with.  */
  yylen = yyr2[yyn];

  /* If YYLEN is nonzero, implement the default value of the action:
     `$$ = $1'.

     Otherwise, the following line sets YYVAL to garbage.
     This behavior is undocumented and Bison
     users should not rely upon it.  Assigning to YYVAL
     unconditionally makes the parser a bit smaller, and it avoids a
     GCC warning that YYVAL may be used uninitialized.  */
  yyval = yyvsp[1-yylen];

  /* Default location.  */
  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
  YY_REDUCE_PRINT (yyn);
  switch (yyn)
    {
        case 2:

/* Line 1455 of yacc.c  */
#line 184 "structspec_parser.y++"
    {
  /*Note that grid info was stored in the structure when it was all read in*/
  the_structure = (yyvsp[(2) - (2)].s);
}
    break;

  case 3:

/* Line 1455 of yacc.c  */
#line 189 "structspec_parser.y++"
    {
  g = (struct grid*)malloc(sizeof(struct grid));
  g->t = (yyvsp[(3) - (13)].gt);
  g->dimensions = (yyvsp[(5) - (13)].ival);
  g->box_size = (yyvsp[(7) - (13)].list);
  g->site_length = (yyvsp[(9) - (13)].list);
  g->key_values = (yyvsp[(12) - (13)].list); 
  (yyval.g) = g;
}
    break;

  case 4:

/* Line 1455 of yacc.c  */
#line 199 "structspec_parser.y++"
    {
  struct continuous_structure *s = (struct continuous_structure*)malloc(sizeof(struct continuous_structure));
  s->key_values = (yyvsp[(3) - (7)].list);
  s->regions = (yyvsp[(4) - (7)].list);
  s->dopings = (yyvsp[(5) - (7)].list);
  s->potential = (yyvsp[(6) - (7)].list);
  s->g = g;
  (yyval.s) = s;
}
    break;

  case 5:

/* Line 1455 of yacc.c  */
#line 209 "structspec_parser.y++"
    {(yyval.list) = NULL;}
    break;

  case 6:

/* Line 1455 of yacc.c  */
#line 210 "structspec_parser.y++"
    {
  (yyval.list) = g_list_append((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].potential));
}
    break;

  case 7:

/* Line 1455 of yacc.c  */
#line 214 "structspec_parser.y++"
    {(yyval.list) = NULL;}
    break;

  case 8:

/* Line 1455 of yacc.c  */
#line 215 "structspec_parser.y++"
    {
  (yyval.list) = g_list_append((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].doping));
}
    break;

  case 9:

/* Line 1455 of yacc.c  */
#line 219 "structspec_parser.y++"
    {
  ((yyvsp[(3) - (9)].doping))->key_values = (yyvsp[(8) - (9)].list);
  ((yyvsp[(3) - (9)].doping))->st = (yyvsp[(5) - (9)].stree);
  (yyval.doping) = (yyvsp[(3) - (9)].doping);
}
    break;

  case 10:

/* Line 1455 of yacc.c  */
#line 225 "structspec_parser.y++"
    {(yyval.list) = NULL;}
    break;

  case 11:

/* Line 1455 of yacc.c  */
#line 226 "structspec_parser.y++"
    {
  (yyval.list) = g_list_append((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].region));
}
    break;

  case 12:

/* Line 1455 of yacc.c  */
#line 230 "structspec_parser.y++"
    {
  ((yyvsp[(3) - (9)].region))->key_values = (yyvsp[(8) - (9)].list);
  ((yyvsp[(3) - (9)].region))->st = (yyvsp[(5) - (9)].stree);
  (yyval.region) = (yyvsp[(3) - (9)].region);
}
    break;

  case 13:

/* Line 1455 of yacc.c  */
#line 237 "structspec_parser.y++"
    {
  struct region *r = (struct region*)malloc(sizeof(struct region));
  r->mat1 = (yyvsp[(1) - (1)].str);
  r->mat2 = NULL;
  r->x = 1.0;
  r->f = NULL;
  (yyval.region) = r;
}
    break;

  case 14:

/* Line 1455 of yacc.c  */
#line 245 "structspec_parser.y++"
    {
  struct region *r = (struct region*)malloc(sizeof(struct region));
  r->mat1 = (yyvsp[(1) - (5)].str);
  r->mat2 = (yyvsp[(5) - (5)].str);
  r->f = (yyvsp[(3) - (5)].exp);
  /*Check if this is just a const; if it is, do it instead of a full-on function evaluation (much faster).*/
  if((yyvsp[(3) - (5)].exp)->op == kdotp::libmodelxx::postprocessing::CONST) {
    /*Make sure this is a scalar.*/
    if(((struct function_const*)r->f)->t == 1) {
      r->x = ((struct function_const*)r->f)->value[0];
    free(r->f);
    /*Flag this as not being in use.*/
    r->f = NULL;
    if(((r->x) < 0.0) || ((r->x) > 1.0)) {fprintf(stderr, "ERROR: material specification %s(%f)%s is invalid; %f is not in range [0,1]\n", (yyvsp[(1) - (5)].str), r->x, (yyvsp[(5) - (5)].str), r->x);}
    }
  }
  (yyval.region) = r;
}
    break;

  case 15:

/* Line 1455 of yacc.c  */
#line 280 "structspec_parser.y++"
    {(yyval.list) = NULL;}
    break;

  case 16:

/* Line 1455 of yacc.c  */
#line 281 "structspec_parser.y++"
    {(yyval.list) = g_list_append((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].kvu));}
    break;

  case 17:

/* Line 1455 of yacc.c  */
#line 290 "structspec_parser.y++"
    {(yyval.list) = NULL;}
    break;

  case 18:

/* Line 1455 of yacc.c  */
#line 291 "structspec_parser.y++"
    {(yyval.list) = (yyvsp[(1) - (1)].list);}
    break;

  case 19:

/* Line 1455 of yacc.c  */
#line 293 "structspec_parser.y++"
    {
    (yyval.list) = g_list_append((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].exp));
    GString *s = g_string_new("");
    function_print_tree((yyvsp[(3) - (3)].exp), &s, 1);
    fprintf(stderr, "***appending to fx_list: \n%s***\n", s->str);
    g_string_free(s, TRUE);
}
    break;

  case 20:

/* Line 1455 of yacc.c  */
#line 300 "structspec_parser.y++"
    {
  (yyval.list) = g_list_append(NULL, (yyvsp[(1) - (1)].exp));
  GString *s = g_string_new("");
  function_print_tree((yyvsp[(1) - (1)].exp), &s, 1);
  fprintf(stderr, "***creating new fx_list: \n%s***\n", s->str);
  g_string_free(s, TRUE);
}
    break;

  case 21:

/* Line 1455 of yacc.c  */
#line 308 "structspec_parser.y++"
    {((yyvsp[(3) - (4)].kvu))->key = ((yyvsp[(1) - (4)].str)); (yyval.kvu)=(yyvsp[(3) - (4)].kvu);}
    break;

  case 22:

/* Line 1455 of yacc.c  */
#line 309 "structspec_parser.y++"
    {kv=(struct key_value*)malloc(sizeof(struct key_value)); kv->key = NULL; kv->value.s = (yyvsp[(1) - (1)].str);  kv->t = STRING; (yyval.kvu)=kv;}
    break;

  case 23:

/* Line 1455 of yacc.c  */
#line 310 "structspec_parser.y++"
    {kv=(struct key_value*)malloc(sizeof(struct key_value)); kv->key = NULL; kv->value.s = (yyvsp[(1) - (1)].str); kv->t = STRING; (yyval.kvu)=kv;}
    break;

  case 24:

/* Line 1455 of yacc.c  */
#line 311 "structspec_parser.y++"
    {kv=(struct key_value*)malloc(sizeof(struct key_value)); kv->key =NULL; kv->value.d = (yyvsp[(1) - (1)].fval);  kv->t = FLOAT; (yyval.kvu)=kv;}
    break;

  case 25:

/* Line 1455 of yacc.c  */
#line 312 "structspec_parser.y++"
    {kv=(struct key_value*)malloc(sizeof(struct key_value)); kv->key = NULL; kv->value.l = (yyvsp[(1) - (1)].list);  kv->t = VECTOR; (yyval.kvu)=kv;}
    break;

  case 26:

/* Line 1455 of yacc.c  */
#line 313 "structspec_parser.y++"
    {kv=(struct key_value*)malloc(sizeof(struct key_value)); kv->key = NULL; kv->value.l = (yyvsp[(1) - (1)].list);  kv->t = VECTOR_SET; (yyval.kvu)=kv;}
    break;

  case 27:

/* Line 1455 of yacc.c  */
#line 315 "structspec_parser.y++"
    {
  struct shape_tree *st = (struct shape_tree*) malloc(sizeof(struct shape_tree));
  st->l = (yyvsp[(1) - (3)].stree);
  st->r = (yyvsp[(3) - (3)].stree);
  st->op = ::kdotp::libmodelxx::grid::AND;
  (yyval.stree) = st;
}
    break;

  case 28:

/* Line 1455 of yacc.c  */
#line 322 "structspec_parser.y++"
    {
  struct shape_tree* st = (struct shape_tree*) malloc(sizeof(struct shape_tree));
  st->l = (yyvsp[(1) - (3)].stree);
  st->r = (yyvsp[(3) - (3)].stree);
  st->op = ::kdotp::libmodelxx::grid::OR;
  (yyval.stree) = st;
}
    break;

  case 29:

/* Line 1455 of yacc.c  */
#line 329 "structspec_parser.y++"
    {
  struct shape_tree* st = (struct shape_tree*) malloc(sizeof(struct shape_tree));
  st->l = (yyvsp[(2) - (2)].stree);
  st->r = NULL;
  st->op = ::kdotp::libmodelxx::grid::NOT;
  (yyval.stree) = st;
}
    break;

  case 30:

/* Line 1455 of yacc.c  */
#line 336 "structspec_parser.y++"
    {
  struct shape_tree* st = (struct shape_tree*) malloc(sizeof(struct shape_tree));
  st->l = (yyvsp[(1) - (3)].stree);
  st->r = (yyvsp[(3) - (3)].stree);
  st->op = ::kdotp::libmodelxx::grid::XOR;
  (yyval.stree) = st;
}
    break;

  case 31:

/* Line 1455 of yacc.c  */
#line 343 "structspec_parser.y++"
    {(yyval.stree) = (yyvsp[(2) - (3)].stree);}
    break;

  case 32:

/* Line 1455 of yacc.c  */
#line 344 "structspec_parser.y++"
    {
  struct shape *s = (struct shape*)malloc(sizeof(struct shape));
  s->type = get_shape_from_identifier((yyvsp[(1) - (4)].str));
  s->op = kdotp::libmodelxx::grid::LEAF;
  if(s->type == ::kdotp::libmodelxx::grid::INVALID) {
    fprintf(stderr, "ERROR: shape identifier (%s) is invalid!\n", ((yyvsp[(1) - (4)].str)));
    exit(5);
  }        
  char* c = NULL;
  get_string_from_shape_type(&c, s->type);
  fprintf(stderr, "A: Got shape type %s\n", c);
  g_free(c);
  s->descriptor = (yyvsp[(3) - (4)].list);
  s->generic = true;
  (yyval.stree) = (struct shape_tree*)s;
}
    break;

  case 33:

/* Line 1455 of yacc.c  */
#line 360 "structspec_parser.y++"
    {
  struct shape *s = (struct shape*)malloc(sizeof(struct shape));
  s->op = kdotp::libmodelxx::grid::LEAF;
  s->type = get_shape_from_identifier((yyvsp[(1) - (1)].str));
  if(s->type == ::kdotp::libmodelxx::grid::INVALID) {
    fprintf(stderr, "ERROR: shape identifier (%s) is invalid!\n", ((yyvsp[(1) - (1)].str)));
    exit(5);
  }        
  if(s->type != ::kdotp::libmodelxx::grid::GLOBAL) {
    fprintf(stderr, "ERROR: shape (%s) is invalid (only the global shape does not need an argument)\n", ((yyvsp[(1) - (1)].str)));
    exit(5);
  }        
  char* c = NULL;
  get_string_from_shape_type(&c, s->type);
  fprintf(stderr, "B: Got shape type %s\n", c);
  g_free(c);
  s->descriptor = NULL; 
  s->generic = true;
  (yyval.stree) = (struct shape_tree*)s;
}
    break;

  case 34:

/* Line 1455 of yacc.c  */
#line 380 "structspec_parser.y++"
    {(yyval.list) = (yyvsp[(2) - (3)].list);}
    break;

  case 35:

/* Line 1455 of yacc.c  */
#line 382 "structspec_parser.y++"
    {(yyval.list) = g_list_append((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list));}
    break;

  case 36:

/* Line 1455 of yacc.c  */
#line 383 "structspec_parser.y++"
    {(yyval.list) = g_list_append(NULL, (yyvsp[(1) - (1)].list));}
    break;

  case 37:

/* Line 1455 of yacc.c  */
#line 385 "structspec_parser.y++"
    {(yyval.list) = (yyvsp[(2) - (3)].list);}
    break;

  case 38:

/* Line 1455 of yacc.c  */
#line 387 "structspec_parser.y++"
    {(yyval.list) = NULL;}
    break;

  case 39:

/* Line 1455 of yacc.c  */
#line 388 "structspec_parser.y++"
    {(yyval.list) = g_list_append((yyvsp[(1) - (3)].list), new_double((yyvsp[(3) - (3)].fval)));}
    break;

  case 40:

/* Line 1455 of yacc.c  */
#line 389 "structspec_parser.y++"
    {(yyval.list) = g_list_append(NULL, new_double((yyvsp[(1) - (1)].fval)));}
    break;

  case 41:

/* Line 1455 of yacc.c  */
#line 391 "structspec_parser.y++"
    {
  (yyval.list) = (yyvsp[(2) - (3)].list);
}
    break;

  case 42:

/* Line 1455 of yacc.c  */
#line 395 "structspec_parser.y++"
    {(yyval.list) = NULL;}
    break;

  case 43:

/* Line 1455 of yacc.c  */
#line 396 "structspec_parser.y++"
    {(yyval.list) = g_list_append((yyvsp[(1) - (3)].list), new_int((yyvsp[(3) - (3)].ival)));}
    break;

  case 44:

/* Line 1455 of yacc.c  */
#line 397 "structspec_parser.y++"
    {(yyval.list) = g_list_append(NULL, new_int((yyvsp[(1) - (1)].ival)));}
    break;

  case 45:

/* Line 1455 of yacc.c  */
#line 399 "structspec_parser.y++"
    {(yyval.fval) = convert_length_to_nm((yyvsp[(1) - (2)].fval), (yyvsp[(2) - (2)].len));}
    break;

  case 46:

/* Line 1455 of yacc.c  */
#line 400 "structspec_parser.y++"
    {(yyval.fval) = convert_energy_to_hartree((yyvsp[(1) - (2)].fval), (yyvsp[(2) - (2)].energy));}
    break;

  case 47:

/* Line 1455 of yacc.c  */
#line 401 "structspec_parser.y++"
    {fprintf(stderr, "structspec PARSER WARNING: float %g presented without units where a float with units is expected; you should specify your units!\n", (yyvsp[(1) - (1)].fval)); (yyval.fval) = (yyvsp[(1) - (1)].fval);}
    break;

  case 48:

/* Line 1455 of yacc.c  */
#line 402 "structspec_parser.y++"
    {(yyval.fval) = convert_length_to_nm((double)(yyvsp[(1) - (2)].ival), (yyvsp[(2) - (2)].len));}
    break;

  case 49:

/* Line 1455 of yacc.c  */
#line 403 "structspec_parser.y++"
    {(yyval.fval) = convert_energy_to_hartree((double)(yyvsp[(1) - (2)].ival), (yyvsp[(2) - (2)].energy));}
    break;

  case 50:

/* Line 1455 of yacc.c  */
#line 404 "structspec_parser.y++"
    {fprintf(stderr, "structspec PARSER WARNING: integer %d presented without units where a float with units is expected; you should specify your units!\n", (yyvsp[(1) - (1)].ival)); (yyval.fval) = (double)(yyvsp[(1) - (1)].ival);}
    break;

  case 51:

/* Line 1455 of yacc.c  */
#line 406 "structspec_parser.y++"
    {
  struct doping* doping = (struct doping*)malloc(sizeof(struct doping));
  g_assert(doping != NULL);
  doping->f = (yyvsp[(1) - (1)].exp);
  doping->st = NULL;
  doping->key_values = NULL;
  (yyval.doping) = doping;
}
    break;

  case 52:

/* Line 1455 of yacc.c  */
#line 415 "structspec_parser.y++"
    {(yyval.potential) = NULL;}
    break;

  case 53:

/* Line 1455 of yacc.c  */
#line 416 "structspec_parser.y++"
    {
  struct potential *pot = (struct potential*)malloc(sizeof(struct potential));
  g_assert(pot != NULL);
  pot->Evec = (yyvsp[(2) - (2)].list);
  pot->E = NULL;
  pot->function = NULL;
  (yyval.potential) = pot;
}
    break;

  case 54:

/* Line 1455 of yacc.c  */
#line 425 "structspec_parser.y++"
    {(yyval.exp) = new_fx_const_single((yyvsp[(1) - (1)].fval));}
    break;

  case 55:

/* Line 1455 of yacc.c  */
#line 426 "structspec_parser.y++"
    {(yyval.exp) = new_fx_const_single((yyvsp[(2) - (2)].fval));}
    break;

  case 56:

/* Line 1455 of yacc.c  */
#line 428 "structspec_parser.y++"
    {(yyval.exp) = new_fx_const_single((yyvsp[(1) - (1)].ival));}
    break;

  case 57:

/* Line 1455 of yacc.c  */
#line 429 "structspec_parser.y++"
    {(yyval.exp) = new_fx_const_single((yyvsp[(2) - (2)].ival));}
    break;

  case 58:

/* Line 1455 of yacc.c  */
#line 431 "structspec_parser.y++"
    {(yyval.exp) = new_fx_const(g_list_length((yyvsp[(1) - (1)].list)), (yyvsp[(1) - (1)].list));}
    break;

  case 59:

/* Line 1455 of yacc.c  */
#line 432 "structspec_parser.y++"
    {(yyval.exp) = new_fx(kdotp::libmodelxx::postprocessing::PLUS, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));}
    break;

  case 60:

/* Line 1455 of yacc.c  */
#line 433 "structspec_parser.y++"
    {(yyval.exp) = new_fx(kdotp::libmodelxx::postprocessing::MINUS, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));}
    break;

  case 61:

/* Line 1455 of yacc.c  */
#line 434 "structspec_parser.y++"
    {(yyval.exp) = new_fx(kdotp::libmodelxx::postprocessing::MUL, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));}
    break;

  case 62:

/* Line 1455 of yacc.c  */
#line 435 "structspec_parser.y++"
    {(yyval.exp) = new_fx(kdotp::libmodelxx::postprocessing::DIV, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));}
    break;

  case 63:

/* Line 1455 of yacc.c  */
#line 436 "structspec_parser.y++"
    {(yyval.exp) = new_fx(kdotp::libmodelxx::postprocessing::CROSS, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));}
    break;

  case 64:

/* Line 1455 of yacc.c  */
#line 437 "structspec_parser.y++"
    {(yyval.exp) = new_fx(kdotp::libmodelxx::postprocessing::DOT, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));}
    break;

  case 65:

/* Line 1455 of yacc.c  */
#line 438 "structspec_parser.y++"
    {(yyval.exp) = (yyvsp[(2) - (3)].exp);}
    break;

  case 66:

/* Line 1455 of yacc.c  */
#line 439 "structspec_parser.y++"
    {(yyval.exp) = new_fx(kdotp::libmodelxx::postprocessing::NEG, NULL, (yyvsp[(2) - (2)].exp));}
    break;

  case 67:

/* Line 1455 of yacc.c  */
#line 440 "structspec_parser.y++"
    {(yyval.exp) = new_fx_func((yyvsp[(1) - (4)].str), (yyvsp[(3) - (4)].exp));}
    break;

  case 68:

/* Line 1455 of yacc.c  */
#line 441 "structspec_parser.y++"
    {(yyval.exp) = new_fx_symbol((yyvsp[(1) - (1)].str));}
    break;

  case 69:

/* Line 1455 of yacc.c  */
#line 443 "structspec_parser.y++"
    {(yyval.fval) = (yyvsp[(1) - (1)].fval);}
    break;

  case 70:

/* Line 1455 of yacc.c  */
#line 444 "structspec_parser.y++"
    {(yyval.fval) = -(yyvsp[(2) - (2)].fval);}
    break;

  case 71:

/* Line 1455 of yacc.c  */
#line 445 "structspec_parser.y++"
    {(yyval.fval) = (yyvsp[(2) - (2)].fval);}
    break;

  case 72:

/* Line 1455 of yacc.c  */
#line 447 "structspec_parser.y++"
    {(yyval.ival) = (yyvsp[(1) - (1)].ival);}
    break;

  case 73:

/* Line 1455 of yacc.c  */
#line 448 "structspec_parser.y++"
    {(yyval.ival) = -(yyvsp[(2) - (2)].ival);}
    break;

  case 74:

/* Line 1455 of yacc.c  */
#line 449 "structspec_parser.y++"
    {(yyval.ival) = (yyvsp[(2) - (2)].ival);}
    break;



/* Line 1455 of yacc.c  */
#line 2344 "kdotp/structspec_parser.c++"
      default: break;
    }
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);

  YYPOPSTACK (yylen);
  yylen = 0;
  YY_STACK_PRINT (yyss, yyssp);

  *++yyvsp = yyval;
  *++yylsp = yyloc;

  /* Now `shift' the result of the reduction.  Determine what state
     that goes to, based on the state we popped back to and the rule
     number reduced by.  */

  yyn = yyr1[yyn];

  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
    yystate = yytable[yystate];
  else
    yystate = yydefgoto[yyn - YYNTOKENS];

  goto yynewstate;


/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
  /* If not already recovering from an error, report this error.  */
  if (!yyerrstatus)
    {
      ++yynerrs;
#if ! YYERROR_VERBOSE
      yyerror (YY_("syntax error"));
#else
      {
  YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
  if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
    {
      YYSIZE_T yyalloc = 2 * yysize;
      if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
        yyalloc = YYSTACK_ALLOC_MAXIMUM;
      if (yymsg != yymsgbuf)
        YYSTACK_FREE (yymsg);
      yymsg = (char *) YYSTACK_ALLOC (yyalloc);
      if (yymsg)
        yymsg_alloc = yyalloc;
      else
        {
    yymsg = yymsgbuf;
    yymsg_alloc = sizeof yymsgbuf;
        }
    }

  if (0 < yysize && yysize <= yymsg_alloc)
    {
      (void) yysyntax_error (yymsg, yystate, yychar);
      yyerror (yymsg);
    }
  else
    {
      yyerror (YY_("syntax error"));
      if (yysize != 0)
        goto yyexhaustedlab;
    }
      }
#endif
    }

  yyerror_range[0] = yylloc;

  if (yyerrstatus == 3)
    {
      /* If just tried and failed to reuse lookahead token after an
   error, discard it.  */

      if (yychar <= YYEOF)
  {
    /* Return failure if at end of input.  */
    if (yychar == YYEOF)
      YYABORT;
  }
      else
  {
    yydestruct ("Error: discarding",
          yytoken, &yylval, &yylloc);
    yychar = YYEMPTY;
  }
    }

  /* Else will try to reuse lookahead token after shifting the error
     token.  */
  goto yyerrlab1;


/*---------------------------------------------------.
| yyerrorlab -- error raised explicitly by YYERROR.  |
`---------------------------------------------------*/
yyerrorlab:

  /* Pacify compilers like GCC when the user code never invokes
     YYERROR and the label yyerrorlab therefore never appears in user
     code.  */
  if (/*CONSTCOND*/ 0)
     goto yyerrorlab;

  yyerror_range[0] = yylsp[1-yylen];
  /* Do not reclaim the symbols of the rule which action triggered
     this YYERROR.  */
  YYPOPSTACK (yylen);
  yylen = 0;
  YY_STACK_PRINT (yyss, yyssp);
  yystate = *yyssp;
  goto yyerrlab1;


/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
`-------------------------------------------------------------*/
yyerrlab1:
  yyerrstatus = 3;  /* Each real token shifted decrements this.  */

  for (;;)
    {
      yyn = yypact[yystate];
      if (yyn != YYPACT_NINF)
  {
    yyn += YYTERROR;
    if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
      {
        yyn = yytable[yyn];
        if (0 < yyn)
    break;
      }
  }

      /* Pop the current state because it cannot handle the error token.  */
      if (yyssp == yyss)
  YYABORT;

      yyerror_range[0] = *yylsp;
      yydestruct ("Error: popping",
      yystos[yystate], yyvsp, yylsp);
      YYPOPSTACK (1);
      yystate = *yyssp;
      YY_STACK_PRINT (yyss, yyssp);
    }

  *++yyvsp = yylval;

  yyerror_range[1] = yylloc;
  /* Using YYLLOC is tempting, but would change the location of
     the lookahead.  YYLOC is available though.  */
  YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
  *++yylsp = yyloc;

  /* Shift the error token.  */
  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);

  yystate = yyn;
  goto yynewstate;


/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here.  |
`-------------------------------------*/
yyacceptlab:
  yyresult = 0;
  goto yyreturn;

/*-----------------------------------.
| yyabortlab -- YYABORT comes here.  |
`-----------------------------------*/
yyabortlab:
  yyresult = 1;
  goto yyreturn;

#if !defined(yyoverflow) || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here.  |
`-------------------------------------------------*/
yyexhaustedlab:
  yyerror (YY_("memory exhausted"));
  yyresult = 2;
  /* Fall through.  */
#endif

yyreturn:
  if (yychar != YYEMPTY)
     yydestruct ("Cleanup: discarding lookahead",
     yytoken, &yylval, &yylloc);
  /* Do not reclaim the symbols of the rule which action triggered
     this YYABORT or YYACCEPT.  */
  YYPOPSTACK (yylen);
  YY_STACK_PRINT (yyss, yyssp);
  while (yyssp != yyss)
    {
      yydestruct ("Cleanup: popping",
      yystos[*yyssp], yyvsp, yylsp);
      YYPOPSTACK (1);
    }
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
#endif
#if YYERROR_VERBOSE
  if (yymsg != yymsgbuf)
    YYSTACK_FREE (yymsg);
#endif
  /* Make sure YYID is used.  */
  return YYID (yyresult);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

struct key_value* kv

Definition at line 112 of file structspec_parser.c++.

Referenced by yyparse().

Definition at line 110 of file structspec_parser.c++.

Definition at line 205 of file structspec_parser.c++.

Referenced by main(), and yyparse().

int yychar

Definition at line 1376 of file structspec_parser.c++.

const yytype_int16 yycheck[] [static]
Initial value:
{
      72,    17,    21,    13,     3,    17,    78,    79,     3,     4,
      17,     3,     7,     8,   105,     3,     7,     8,    32,     5,
       6,    93,    29,    35,    19,    20,    40,    99,   100,   101,
     102,   103,   104,    31,     3,   107,    35,    44,     7,     8,
       0,   132,    37,    35,     7,     8,    65,    35,   139,     3,
      19,    20,     8,    11,    70,    62,    19,    20,    90,    91,
      10,    68,    31,    19,    20,   137,    98,    32,    37,     8,
      32,     7,     8,    38,    37,    29,    38,    31,   110,   111,
     112,    19,    20,    21,    22,    23,    24,    19,    20,    21,
      22,    23,    24,     7,     8,    33,     7,     8,     5,     6,
      34,    33,    19,    20,    21,    22,    23,    24,    19,    20,
      25,    26,    27,    25,    26,    27,    33,     3,    33,    32,
      28,    33,    25,    26,    27,    21,    22,    23,    24,    14,
      33,    19,    20,    21,    22,    23,    24,    32,    39,    31,
      18,    32,    36,     3,    31,     8,     8,    37,    31,    33,
      32,    31,     3,    32,    -1,    31,    -1,    34,    32,    34,
      33,    -1,    34
}

Definition at line 801 of file structspec_parser.c++.

Referenced by yyparse().

const yytype_uint8 yydefact[] [static]
Initial value:
{
       0,     0,     0,     0,     0,     1,     0,     2,     0,    15,
       0,    10,     0,     0,     7,    16,     0,     0,     0,     5,
      11,    42,     0,    22,    23,    69,    72,     0,     0,    38,
       0,    26,    25,    24,    47,    50,     0,     0,     0,     8,
       0,     0,     0,    44,     0,    71,    74,    70,    73,    38,
       0,    36,     0,    40,    21,    46,    45,    49,    48,    13,
       0,     0,     0,     4,     6,     0,    41,     0,     0,    34,
       0,    37,     0,     0,    68,    54,    56,     0,     0,     0,
      58,     0,    51,    53,    43,     0,    35,    39,     0,    33,
       0,     0,     0,     0,    55,    57,    66,     0,     0,     0,
       0,     0,     0,     0,     0,    15,     0,    17,    29,     0,
       0,     0,     0,     0,     0,    65,     0,    59,    60,    61,
      62,    64,    63,     0,    14,     0,    18,    20,    31,    27,
      28,    30,    15,    67,     0,     3,    32,     0,     0,    15,
      19,    12,     0,     9
}

Definition at line 718 of file structspec_parser.c++.

Referenced by yyparse().

const yytype_int8 yydefgoto[] [static]
Initial value:
{
      -1,     2,     3,     7,    38,    19,    39,    14,    20,    60,
      11,   125,   126,    15,    30,    92,    31,    50,    80,    52,
      22,    42,    53,    81,    64,    82,    34,    35
}

Definition at line 738 of file structspec_parser.c++.

Referenced by yyparse().

Definition at line 1388 of file structspec_parser.c++.

Referenced by yyparse().

Definition at line 974 of file structspec_parser.c++.

Definition at line 1065 of file structspec_parser.c++.

Referenced by yyparse().

Definition at line 1385 of file structspec_parser.c++.

Referenced by while(), and yyparse().

int yynerrs

Definition at line 1391 of file structspec_parser.c++.

Referenced by yyparse().

const yytype_int16 yypact[] [static]
Initial value:
{
     -10,     2,    40,    42,    50,   -92,    66,   -92,    87,   -92,
      61,   114,   105,    92,   115,   -92,    99,     5,   108,   122,
     -92,    44,   109,   -92,   -92,   -92,   -92,     9,    64,    37,
     106,   -92,   -92,   -92,    14,    93,   140,   113,   -12,   -92,
     137,   138,   -14,   -92,   110,   -92,   -92,   -92,   -92,    89,
      35,   -92,    38,   -92,   -92,   -92,   -92,   -92,   -92,   117,
     118,    31,   110,   -92,   -92,    44,   -92,   116,   110,   -92,
      89,   -92,    31,    46,   120,   -92,   -92,    86,    31,    31,
     -92,   121,   112,   -92,   -92,   123,   -92,   -92,    62,   124,
      46,    46,    85,    31,   -92,   -92,   -92,    68,    46,    31,
      31,    31,    31,    31,    31,   -92,   149,    31,   -92,    88,
      46,    46,    46,   125,    83,   -92,    97,   104,   104,   -92,
     -92,   -92,   -92,     1,   -92,   127,   126,   112,   -92,   -92,
     -92,   -92,   -92,   -92,   128,   -92,   -92,    31,     8,   -92,
     112,   -92,    12,   -92
}

Definition at line 748 of file structspec_parser.c++.

Referenced by yyparse().

const yytype_int8 yypgoto[] [static]
Initial value:
{
     -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,
     -91,   -92,   -92,   -92,   -92,   -32,   -92,   -92,    -7,   -92,
     -92,   -92,   -16,   -92,   -92,   -72,   -92,   -19
}

Definition at line 768 of file structspec_parser.c++.

Referenced by yyparse().

const yytype_uint8 yyprhs[] [static]
Initial value:
{
       0,     0,     3,     6,    20,    28,    29,    32,    33,    36,
      46,    47,    50,    60,    62,    68,    69,    72,    73,    75,
      79,    81,    86,    88,    90,    92,    94,    96,   100,   104,
     107,   111,   115,   120,   122,   126,   130,   132,   136,   137,
     141,   143,   147,   148,   152,   154,   157,   160,   162,   165,
     168,   170,   172,   173,   176,   178,   181,   183,   186,   188,
     192,   196,   200,   204,   208,   212,   216,   219,   224,   226,
     228,   231,   234,   236,   239
}

Definition at line 600 of file structspec_parser.c++.

const yytype_uint8 yyr1[] [static]
Initial value:
{
       0,    41,    42,    43,    44,    45,    45,    46,    46,    47,
      48,    48,    49,    50,    50,    51,    51,    52,    52,    53,
      53,    54,    55,    55,    55,    55,    55,    56,    56,    56,
      56,    56,    56,    56,    57,    58,    58,    59,    60,    60,
      60,    61,    62,    62,    62,    63,    63,    63,    63,    63,
      63,    64,    65,    65,    66,    66,    66,    66,    66,    66,
      66,    66,    66,    66,    66,    66,    66,    66,    66,    67,
      67,    67,    68,    68,    68
}

Definition at line 690 of file structspec_parser.c++.

Referenced by yyparse().

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

Definition at line 703 of file structspec_parser.c++.

Referenced by yyparse().

const yytype_int8 yyrhs[] [static]
Initial value:
{
      42,     0,    -1,    43,    44,    -1,    13,    31,    10,    32,
       8,    32,    61,    32,    59,    33,    34,    51,    35,    -1,
      11,    34,    51,    48,    46,    45,    35,    -1,    -1,    45,
      65,    -1,    -1,    46,    47,    -1,    18,    31,    64,    32,
      56,    33,    34,    51,    35,    -1,    -1,    48,    49,    -1,
      14,    31,    50,    32,    56,    33,    34,    51,    35,    -1,
       3,    -1,     3,    31,    66,    33,     3,    -1,    -1,    51,
      54,    -1,    -1,    53,    -1,    53,    32,    66,    -1,    66,
      -1,     3,    28,    55,    36,    -1,     3,    -1,     4,    -1,
      63,    -1,    59,    -1,    57,    -1,    56,    25,    56,    -1,
      56,    26,    56,    -1,    29,    56,    -1,    56,    27,    56,
      -1,    31,    56,    33,    -1,     3,    31,    52,    33,    -1,
       3,    -1,    37,    58,    38,    -1,    58,    32,    59,    -1,
      59,    -1,    37,    60,    38,    -1,    -1,    60,    32,    63,
      -1,    63,    -1,    39,    62,    40,    -1,    -1,    62,    32,
      68,    -1,    68,    -1,    67,     6,    -1,    67,     5,    -1,
      67,    -1,    68,     6,    -1,    68,     5,    -1,    68,    -1,
      66,    -1,    -1,    17,    59,    -1,     7,    -1,    19,     7,
      -1,     8,    -1,    19,     8,    -1,    59,    -1,    66,    19,
      66,    -1,    66,    20,    66,    -1,    66,    21,    66,    -1,
      66,    22,    66,    -1,    66,    24,    66,    -1,    66,    23,
      66,    -1,    31,    66,    33,    -1,    20,    66,    -1,     3,
      31,    66,    33,    -1,     3,    -1,     7,    -1,    20,     7,
      -1,    19,     7,    -1,     8,    -1,    20,     8,    -1,    19,
       8,    -1
}

Definition at line 613 of file structspec_parser.c++.

const yytype_uint16 yyrline[] [static]
Initial value:
{
       0,   184,   184,   189,   199,   209,   210,   214,   215,   219,
     225,   226,   230,   237,   245,   280,   281,   290,   291,   293,
     300,   308,   309,   310,   311,   312,   313,   315,   322,   329,
     336,   343,   344,   360,   380,   382,   383,   385,   387,   388,
     389,   391,   395,   396,   397,   399,   400,   401,   402,   403,
     404,   406,   415,   416,   425,   426,   428,   429,   431,   432,
     433,   434,   435,   436,   437,   438,   439,   440,   441,   443,
     444,   445,   447,   448,   449
}

Definition at line 643 of file structspec_parser.c++.

int yyrule

Definition at line 1067 of file structspec_parser.c++.

const yytype_uint8 yystos[] [static]
Initial value:
{
       0,    13,    42,    43,    31,     0,    11,    44,    10,    34,
      32,    51,     8,     3,    48,    54,    32,    28,    14,    46,
      49,    39,    61,     3,     4,     7,     8,    19,    20,    37,
      55,    57,    59,    63,    67,    68,    31,    18,    45,    47,
      19,    20,    62,    68,    32,     7,     8,     7,     8,    37,
      58,    59,    60,    63,    36,     5,     6,     5,     6,     3,
      50,    31,    17,    35,    65,    32,    40,    59,    32,    38,
      32,    38,    31,    32,     3,     7,     8,    19,    20,    31,
      59,    64,    66,    59,    68,    33,    59,    63,    66,     3,
      29,    31,    56,    31,     7,     8,    66,    66,    32,    19,
      20,    21,    22,    23,    24,    34,    33,    31,    56,    56,
      25,    26,    27,    33,    66,    33,    56,    66,    66,    66,
      66,    66,    66,    51,     3,    52,    53,    66,    33,    56,
      56,    56,    34,    33,    33,    35,    33,    32,    51,    34,
      66,    35,    51,    35
}

Definition at line 824 of file structspec_parser.c++.

Referenced by yyparse().

const yytype_uint8 yytable[] [static]
Initial value:
{
      88,    33,    43,     1,    13,    62,    96,    97,    23,    24,
      32,    13,    25,    26,   123,    13,    45,    46,    65,    55,
      56,   114,    51,    63,    27,    28,    66,   117,   118,   119,
     120,   121,   122,     4,    74,   127,   135,    67,    75,    76,
       5,   138,    29,   141,    25,    26,    84,   143,   142,    89,
      77,    78,    26,     6,    87,    83,    27,    28,   108,   109,
       8,    86,    79,    40,    41,   140,   116,    68,    49,    12,
      70,    47,    48,    69,    49,    90,    71,    91,   129,   130,
     131,    99,   100,   101,   102,   103,   104,    99,   100,   101,
     102,   103,   104,    94,    95,   106,    25,    26,    57,    58,
       9,   115,    99,   100,   101,   102,   103,   104,    27,    28,
     110,   111,   112,   110,   111,   112,   133,    13,   113,    10,
      17,   128,   110,   111,   112,   101,   102,   103,   104,    18,
     134,    99,   100,   101,   102,   103,   104,    16,    21,    36,
      37,    44,    54,    59,    61,    46,    48,    49,    72,    85,
      73,    93,   124,    98,     0,   107,     0,   105,   137,   132,
     136,     0,   139
}

Definition at line 780 of file structspec_parser.c++.

Referenced by yyparse().

const char* const yytname[] [static]
Initial value:
{
  "$end", "error", "$undefined", "TOK_IDENTIFIER", "TOK_STRING",
  "TOK_ENERGY", "TOK_LENGTH", "TOK_FLOAT", "TOK_INT", "TOK_VECTOR",
  "TOK_GRID_TYPE", "TOK_STRUCTURE", "TO_STRUCTURE", "TOK_GRID",
  "TOK_REGION", "TOK_SHAPE", "TOK_CONST", "TOK_POTENTIAL", "TOK_DOPING",
  "'+'", "'-'", "'*'", "'/'", "'.'", "'x'", "'&'", "'|'", "'^'", "'='",
  "'!'", "UMINUS", "'('", "','", "')'", "'{'", "'}'", "';'", "'<'", "'>'",
  "'['", "']'", "$accept", "start", "gridspec", "structure",
  "potential_list", "doping_list", "doping", "region_list", "region",
  "material_spec", "key_value_list", "fx_list", "fx_list_", "key_value",
  "value", "shape_description", "vector_set", "vector_list", "vector",
  "float_list", "int_vector", "int_list", "float_with_units",
  "doping_spec", "potential_spec", "fx", "float", "int", 0
}

Definition at line 659 of file structspec_parser.c++.

Definition at line 1034 of file structspec_parser.c++.

const yytype_uint8 yytranslate[] [static]

Definition at line 565 of file structspec_parser.c++.

int yytype

Definition at line 972 of file structspec_parser.c++.

Definition at line 973 of file structspec_parser.c++.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines