Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

parser.c File Reference

#include "parser.h"
#include <stdio.h>

Classes

union  YYSTYPE
union  yyalloc

Defines

#define YYBISON   1
#define YYSKELETON_NAME   "yacc.c"
#define YYPURE   0
#define YYLSP_NEEDED   0
#define NUM   258
#define VAR   259
#define FNCT   260
#define NEG   261
#define YYDEBUG   1
#define YYERROR_VERBOSE   0
#define yystype   YYSTYPE
#define YYSTYPE_IS_DECLARED   1
#define YYSTYPE_IS_TRIVIAL   1
#define YYSTACK_ALLOC   malloc
#define YYSTACK_FREE   free
#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)
#define YYSTACK_BYTES(N)
#define YYCOPY(To, From, Count)
#define YYSTACK_RELOCATE(Stack)
#define YYFINAL   2
#define YYLAST   114
#define YYNTOKENS   17
#define YYNNTS   4
#define YYNRULES   21
#define YYNSTATES   42
#define YYUNDEFTOK   2
#define YYMAXUTOK   261
#define YYTRANSLATE(YYX)   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
#define YYPACT_NINF   -13
#define YYTABLE_NINF   -1
#define YYSIZE_T   unsigned int
#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 yyerrlab1
#define YYFAIL   goto yyerrlab
#define YYRECOVERING()   (!!yyerrstatus)
#define YYBACKUP(Token, Value)
#define YYTERROR   1
#define YYERRCODE   256
#define YYLLOC_DEFAULT(Current, Rhs, N)
#define YYLEX   yylex ()
#define YYFPRINTF   fprintf
#define YYDPRINTF(Args)
#define YYDSYMPRINT(Args)
#define YYDSYMPRINTF(Title, Token, Value, Location)
#define YY_STACK_PRINT(Bottom, Top)
#define YY_REDUCE_PRINT(Rule)
#define YYINITDEPTH   200
#define YYMAXDEPTH   10000
#define YYPOPSTACK   (yyvsp--, yyssp--)

Typedefs

typedef YYSTYPE YYSTYPE
typedef short yysigned_char

Enumerations

enum  yytokentype { NUM = 258, VAR = 259, FNCT = 260, NEG = 261 }

Functions

static void yy_stack_print (short *bottom, short *top)
static void yy_reduce_print (int yyrule)
static void yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
static void yydestruct (int yytype, YYSTYPE *yyvaluep)
int yyparse ()
double parse (char *str)
int parse_errors ()
int yyerror (const char *s)
void init_table (void)
void delete_table (void)
symrecputsym (const char *sym_name, int sym_type)
symrecgetsym (const char *sym_name)
symrecassign_variable (const char *symb_name, double value)
static int getcharstr (void)
static void ungetcstr (void)
int yylex (void)

Variables

static const unsigned char yytranslate []
static const unsigned char yyprhs []
static const yysigned_char yyrhs []
static const unsigned char yyrline []
static const char *const yytname []
static const unsigned char yyr1 []
static const unsigned char yyr2 []
static const unsigned char yydefact []
static const yysigned_char yydefgoto []
static const yysigned_char yypact []
static const yysigned_char yypgoto []
static const unsigned char yytable []
static const yysigned_char yycheck []
static const unsigned char yystos []
int yydebug
int yychar
YYSTYPE yylval
int yynerrs
symrecsym_table = (symrec *) 0

Define Documentation

#define FNCT   260
 

#define NEG   261
 

#define NUM   258
 

#define VAR   259
 

#define YY_REDUCE_PRINT Rule   ) 
 

Value:

do {                                    \
  if (yydebug)                          \
    yy_reduce_print (Rule);             \
} while (0)

#define YY_STACK_PRINT Bottom,
Top   ) 
 

Value:

do {                                                            \
  if (yydebug)                                                  \
    yy_stack_print ((Bottom), (Top));                           \
} while (0)

#define YYABORT   goto yyabortlab
 

#define YYACCEPT   goto yyacceptlab
 

#define YYBACKUP Token,
Value   ) 
 

Value:

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

#define YYBISON   1
 

#define yyclearin   (yychar = YYEMPTY)
 

#define YYCOPY To,
From,
Count   ) 
 

Value:

do                                      \
        {                                       \
          register YYSIZE_T yyi;                \
          for (yyi = 0; yyi < (Count); yyi++)   \
            (To)[yyi] = (From)[yyi];            \
        }                                       \
      while (0)

#define YYDEBUG   1
 

#define YYDPRINTF Args   ) 
 

Value:

do {                                            \
  if (yydebug)                                  \
    YYFPRINTF Args;                             \
} while (0)

#define YYDSYMPRINT Args   ) 
 

Value:

do {                                            \
  if (yydebug)                                  \
    yysymprint Args;                            \
} while (0)

#define YYDSYMPRINTF Title,
Token,
Value,
Location   ) 
 

Value:

do {                                                            \
  if (yydebug)                                                  \
    {                                                           \
      YYFPRINTF (stderr, "%s ", Title);                         \
      yysymprint (stderr,                                       \
                  Token, Value);        \
      YYFPRINTF (stderr, "\n");                                 \
    }                                                           \
} while (0)

#define YYEMPTY   (-2)
 

#define YYEOF   0
 

#define YYERRCODE   256
 

#define yyerrok   (yyerrstatus = 0)
 

#define YYERROR   goto yyerrlab1
 

#define YYERROR_VERBOSE   0
 

#define YYFAIL   goto yyerrlab
 

#define YYFINAL   2
 

#define YYFPRINTF   fprintf
 

#define YYINITDEPTH   200
 

#define YYLAST   114
 

#define YYLEX   yylex ()
 

#define YYLLOC_DEFAULT Current,
Rhs,
 ) 
 

Value:

Current.first_line   = Rhs[1].first_line;      \
  Current.first_column = Rhs[1].first_column;    \
  Current.last_line    = Rhs[N].last_line;       \
  Current.last_column  = Rhs[N].last_column;

#define YYLSP_NEEDED   0
 

#define YYMAXDEPTH   10000
 

#define YYMAXUTOK   261
 

#define YYNNTS   4
 

#define YYNRULES   21
 

#define YYNSTATES   42
 

#define YYNTOKENS   17
 

#define YYPACT_NINF   -13
 

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

#define YYPURE   0
 

 
#define YYRECOVERING  )     (!!yyerrstatus)
 

#define YYSIZE_T   unsigned int
 

#define YYSKELETON_NAME   "yacc.c"
 

#define YYSTACK_ALLOC   malloc
 

#define YYSTACK_BYTES  ) 
 

Value:

((N) * (sizeof (short) + sizeof (YYSTYPE))                              \
      + YYSTACK_GAP_MAXIMUM)

#define YYSTACK_FREE   free
 

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

#define YYSTACK_RELOCATE Stack   ) 
 

Value:

do                                                                      \
      {                                                                 \
        YYSIZE_T yynewbytes;                                            \
        YYCOPY (&yyptr->Stack, Stack, yysize);                          \
        Stack = &yyptr->Stack;                                          \
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
        yyptr += yynewbytes / sizeof (*yyptr);                          \
      }                                                                 \
    while (0)

#define yystype   YYSTYPE
 

#define YYSTYPE_IS_DECLARED   1
 

#define YYSTYPE_IS_TRIVIAL   1
 

#define YYTABLE_NINF   -1
 

#define YYTERROR   1
 

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

#define YYUNDEFTOK   2
 


Typedef Documentation

typedef short yysigned_char
 

typedef union YYSTYPE YYSTYPE
 


Enumeration Type Documentation

enum yytokentype
 

Enumerator:
NUM 
VAR 
FNCT 
NEG 


Function Documentation

symrec* assign_variable const char *  symb_name,
double  value
 

void delete_table void   ) 
 

static int getcharstr void   )  [static]
 

symrec* getsym const char *  sym_name  ) 
 

void init_table void   ) 
 

double parse char *  str  ) 
 

int parse_errors  ) 
 

symrec* putsym const char *  sym_name,
int  sym_type
 

static void ungetcstr void   )  [static]
 

static void yy_reduce_print int  yyrule  )  [static]
 

static void yy_stack_print short *  bottom,
short *  top
[static]
 

static void yydestruct int  yytype,
YYSTYPE yyvaluep
[static]
 

int yyerror const char *  s  ) 
 

int yylex void   ) 
 

int yyparse  ) 
 

static void yysymprint FILE *  yyoutput,
int  yytype,
YYSTYPE yyvaluep
[static]
 


Variable Documentation

symrec* sym_table = (symrec *) 0
 

int yychar
 

const yysigned_char yycheck[] [static]
 

Initial value:

{
       7,    13,     9,     6,    14,    -1,    13,    14,    12,    -1,
      17,    18,    19,    20,    21,    -1,    -1,     0,     1,    -1,
       3,     4,     5,    -1,     7,    -1,    33,    -1,    -1,    36,
      13,    14,    39,     3,     4,     5,    -1,     7,     3,     4,
       5,    -1,     7,    -1,    14,    15,    -1,    -1,    -1,    14,
       7,     8,     9,    10,    -1,    12,    -1,    -1,    15,    16,
       7,     8,     9,    10,    -1,    12,    -1,    -1,    15,    16,
       7,     8,     9,    10,    -1,    12,    -1,    -1,    15,    16,
       7,     8,     9,    10,    -1,    12,    -1,    -1,    15,     7,
       8,     9,    10,    -1,    12,    -1,    -1,    15,     7,     8,
       9,    10,    -1,    12,    13,     7,     8,     9,    10,    -1,
      12,     9,    10,    -1,    12
}

int yydebug
 

const unsigned char yydefact[] [static]
 

Initial value:

{
       2,     0,     1,     0,     7,     8,     0,     0,     4,     0,
       3,     0,     6,     0,     0,    19,     0,     0,     0,     0,
       0,     0,     5,     9,    10,     0,    21,    16,    15,    17,
      18,    20,    11,     0,     0,    12,     0,     0,    13,     0,
       0,    14
}

const yysigned_char yydefgoto[] [static]
 

Initial value:

{
      -1,     1,    10,    11
}

YYSTYPE yylval
 

int yynerrs
 

const yysigned_char yypact[] [static]
 

Initial value:

{
     -13,    17,   -13,   -12,   -13,    -3,   -10,    35,   -13,    35,
     -13,    91,   -13,    35,    30,    -4,    73,    35,    35,    35,
      35,    35,   -13,    98,   -13,    43,   -13,   102,   102,    -4,
      -4,    -4,   -13,    35,    53,   -13,    35,    63,   -13,    35,
      82,   -13
}

const yysigned_char yypgoto[] [static]
 

Initial value:

{
     -13,   -13,   -13,    -7
}

const unsigned char yyprhs[] [static]
 

Initial value:

{
       0,     0,     3,     4,     7,     9,    12,    15,    17,    19,
      23,    27,    32,    39,    48,    59,    63,    67,    71,    75,
      78,    82
}

const unsigned char yyr1[] [static]
 

Initial value:

{
       0,    17,    18,    18,    19,    19,    19,    20,    20,    20,
      20,    20,    20,    20,    20,    20,    20,    20,    20,    20,
      20,    20
}

const unsigned char yyr2[] [static]
 

Initial value:

{
       0,     2,     0,     2,     1,     2,     2,     1,     1,     3,
       3,     4,     6,     8,    10,     3,     3,     3,     3,     2,
       3,     3
}

const yysigned_char yyrhs[] [static]
 

Initial value:

{
      18,     0,    -1,    -1,    18,    19,    -1,    13,    -1,    20,
      13,    -1,     1,    13,    -1,     3,    -1,     4,    -1,     4,
       6,    20,    -1,     5,    14,    15,    -1,     5,    14,    20,
      15,    -1,     5,    14,    20,    16,    20,    15,    -1,     5,
      14,    20,    16,    20,    16,    20,    15,    -1,     5,    14,
      20,    16,    20,    16,    20,    16,    20,    15,    -1,    20,
       8,    20,    -1,    20,     7,    20,    -1,    20,     9,    20,
      -1,    20,    10,    20,    -1,     7,    20,    -1,    20,    12,
      20,    -1,    14,    20,    15,    -1
}

const unsigned char yyrline[] [static]
 

Initial value:

{
       0,    23,    23,    24,    27,    28,    29,    32,    33,    34,
      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
      45,    46
}

const unsigned char yystos[] [static]
 

Initial value:

{
       0,    18,     0,     1,     3,     4,     5,     7,    13,    14,
      19,    20,    13,     6,    14,    20,    20,     7,     8,     9,
      10,    12,    13,    20,    15,    20,    15,    20,    20,    20,
      20,    20,    15,    16,    20,    15,    16,    20,    15,    16,
      20,    15
}

const unsigned char yytable[] [static]
 

Initial value:

{
      15,    12,    16,    13,    14,     0,    23,    25,    21,     0,
      27,    28,    29,    30,    31,     0,     0,     2,     3,     0,
       4,     5,     6,     0,     7,     0,    34,     0,     0,    37,
       8,     9,    40,     4,     5,     6,     0,     7,     4,     5,
       6,     0,     7,     0,     9,    24,     0,     0,     0,     9,
      17,    18,    19,    20,     0,    21,     0,     0,    32,    33,
      17,    18,    19,    20,     0,    21,     0,     0,    35,    36,
      17,    18,    19,    20,     0,    21,     0,     0,    38,    39,
      17,    18,    19,    20,     0,    21,     0,     0,    26,    17,
      18,    19,    20,     0,    21,     0,     0,    41,    17,    18,
      19,    20,     0,    21,    22,    17,    18,    19,    20,     0,
      21,    19,    20,     0,    21
}

const char* const yytname[] [static]
 

Initial value:

{
  "$end", "error", "$undefined", "NUM", "VAR", "FNCT", "'='", "'-'", "'+'", 
  "'*'", "'/'", "NEG", "'^'", "'\\n'", "'('", "')'", "','", "$accept", 
  "input", "line", "expr", 0
}

const unsigned char yytranslate[] [static]
 

Initial value:

{
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
      13,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
      14,    15,     9,     8,    16,     7,     2,    10,     2,     2,
       2,     2,     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,     2,
       2,     2,     2,     2,    12,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
       5,    11
}


Generated on Sun Apr 2 02:05:09 2006 for LabPlot by  doxygen 1.4.4