OpenCores
URL https://opencores.org/ocsvn/theia_gpu/theia_gpu/trunk

Subversion Repositories theia_gpu

[/] [theia_gpu/] [branches/] [beta_2.0/] [compiler/] [src/] [vp_compiler/] [parser.tab.h] - Diff between revs 216 and 230

Only display areas with differences | Details | Blame | View Log

Rev 216 Rev 230
 
 
/* A Bison parser, made by GNU Bison 2.4.1.  */
/* A Bison parser, made by GNU Bison 2.4.1.  */
 
 
/* Skeleton interface for Bison LALR(1) parsers in C++
/* Skeleton interface for Bison LALR(1) parsers in C++
 
 
      Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
      Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
   Foundation, Inc.
   Foundation, Inc.
 
 
   This program is free software: you can redistribute it and/or modify
   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.
   (at your option) any later version.
 
 
   This program is distributed in the hope that it will be useful,
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   GNU General Public License for more details.
 
 
   You should have received a copy of the GNU General Public License
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
/* As a special exception, you may create a larger work that contains
/* As a special exception, you may create a larger work that contains
   part or all of the Bison parser skeleton and distribute that work
   part or all of the Bison parser skeleton and distribute that work
   under terms of your choice, so long as that work isn't itself a
   under terms of your choice, so long as that work isn't itself a
   parser generator using the skeleton or a modified version thereof
   parser generator using the skeleton or a modified version thereof
   as a parser skeleton.  Alternatively, if you modify or redistribute
   as a parser skeleton.  Alternatively, if you modify or redistribute
   the parser skeleton itself, you may (at your option) remove this
   the parser skeleton itself, you may (at your option) remove this
   special exception, which will cause the skeleton and the resulting
   special exception, which will cause the skeleton and the resulting
   Bison output files to be licensed under the GNU General Public
   Bison output files to be licensed under the GNU General Public
   License without this special exception.
   License without this special exception.
 
 
   This special exception was added by the Free Software Foundation in
   This special exception was added by the Free Software Foundation in
   version 2.2 of Bison.  */
   version 2.2 of Bison.  */
 
 
/* C++ LALR(1) parser skeleton written by Akim Demaille.  */
/* C++ LALR(1) parser skeleton written by Akim Demaille.  */
 
 
#ifndef PARSER_HEADER_H
#ifndef PARSER_HEADER_H
# define PARSER_HEADER_H
# define PARSER_HEADER_H
 
 
/* "%code requires" blocks.  */
/* "%code requires" blocks.  */
 
 
/* Line 35 of lalr1.cc  */
/* Line 35 of lalr1.cc  */
#line 36 "parser.y"
#line 36 "parser.y"
 
 
        #include <string>
        #include <string>
        #include <sstream>
        #include <sstream>
        #include <iomanip>
        #include <iomanip>
        #include <bitset>
        #include <bitset>
        #include <map>
        #include <map>
        #include "Instruction.h"
        #include "Instruction.h"
        #include <vector>
        #include <vector>
 
 
 
 
        // We want to return a string
        // We want to return a string
        #define YYSTYPE std::string
        #define YYSTYPE std::string
 
 
 
 
                namespace Theia
                namespace Theia
                {
                {
                        // Forward-declare the Scanner class; the Parser needs to be assigned a 
                        // Forward-declare the Scanner class; the Parser needs to be assigned a 
                        // Scanner, but the Scanner can't be declared without the Parser
                        // Scanner, but the Scanner can't be declared without the Parser
                        class Scanner;
                        class Scanner;
 
 
                        // We use a map to store the INI data
                        // We use a map to store the INI data
                        typedef std::map<std::string, std::map<std::string, std::string> > mapData;
                        typedef std::map<std::string, std::map<std::string, std::string> > mapData;
 
 
 
 
 
 
 
 
 
 
                }
                }
 
 
 
 
 
 
 
 
/* Line 35 of lalr1.cc  */
/* Line 35 of lalr1.cc  */
#line 78 "parser.tab.h"
#line 78 "parser.tab.h"
 
 
 
 
#include <string>
#include <string>
#include <iostream>
#include <iostream>
#include "stack.hh"
#include "stack.hh"
 
 
 
 
/* Line 35 of lalr1.cc  */
/* Line 35 of lalr1.cc  */
#line 28 "parser.y"
#line 28 "parser.y"
namespace Theia {
namespace Theia {
 
 
/* Line 35 of lalr1.cc  */
/* Line 35 of lalr1.cc  */
#line 91 "parser.tab.h"
#line 91 "parser.tab.h"
  class position;
  class position;
  class location;
  class location;
 
 
/* Line 35 of lalr1.cc  */
/* Line 35 of lalr1.cc  */
#line 28 "parser.y"
#line 28 "parser.y"
} // Theia
} // Theia
 
 
/* Line 35 of lalr1.cc  */
/* Line 35 of lalr1.cc  */
#line 100 "parser.tab.h"
#line 100 "parser.tab.h"
 
 
#include "location.hh"
#include "location.hh"
 
 
/* Enabling traces.  */
/* Enabling traces.  */
#ifndef YYDEBUG
#ifndef YYDEBUG
# define YYDEBUG 0
# define YYDEBUG 0
#endif
#endif
 
 
/* Enabling verbose error messages.  */
/* Enabling verbose error messages.  */
#ifdef YYERROR_VERBOSE
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
# define YYERROR_VERBOSE 1
#else
#else
# define YYERROR_VERBOSE 1
# define YYERROR_VERBOSE 1
#endif
#endif
 
 
/* Enabling the token table.  */
/* Enabling the token table.  */
#ifndef YYTOKEN_TABLE
#ifndef YYTOKEN_TABLE
# define YYTOKEN_TABLE 0
# define YYTOKEN_TABLE 0
#endif
#endif
 
 
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
   If N is 0, then set CURRENT to the empty location which ends
   If N is 0, then set CURRENT to the empty location which ends
   the previous symbol: RHS[0] (always defined).  */
   the previous symbol: RHS[0] (always defined).  */
 
 
#ifndef YYLLOC_DEFAULT
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N)                \
# define YYLLOC_DEFAULT(Current, Rhs, N)                \
do {                                                    \
do {                                                    \
  if (N)                                                \
  if (N)                                                \
    {                                                   \
    {                                                   \
      (Current).begin = (Rhs)[1].begin;                 \
      (Current).begin = (Rhs)[1].begin;                 \
      (Current).end   = (Rhs)[N].end;                   \
      (Current).end   = (Rhs)[N].end;                   \
    }                                                   \
    }                                                   \
  else                                                  \
  else                                                  \
    {                                                   \
    {                                                   \
      (Current).begin = (Current).end = (Rhs)[0].end;    \
      (Current).begin = (Current).end = (Rhs)[0].end;    \
    }                                                   \
    }                                                   \
} while (false)
} while (false)
#endif
#endif
 
 
 
 
/* Line 35 of lalr1.cc  */
/* Line 35 of lalr1.cc  */
#line 28 "parser.y"
#line 28 "parser.y"
namespace Theia {
namespace Theia {
 
 
/* Line 35 of lalr1.cc  */
/* Line 35 of lalr1.cc  */
#line 147 "parser.tab.h"
#line 147 "parser.tab.h"
 
 
  /// A Bison parser.
  /// A Bison parser.
  class Parser
  class Parser
  {
  {
  public:
  public:
    /// Symbol semantic values.
    /// Symbol semantic values.
#ifndef YYSTYPE
#ifndef YYSTYPE
    typedef int semantic_type;
    typedef int semantic_type;
#else
#else
    typedef YYSTYPE semantic_type;
    typedef YYSTYPE semantic_type;
#endif
#endif
    /// Symbol locations.
    /// Symbol locations.
    typedef location location_type;
    typedef location location_type;
    /// Tokens.
    /// Tokens.
    struct token
    struct token
    {
    {
      /* Tokens.  */
      /* Tokens.  */
   enum yytokentype {
   enum yytokentype {
     AUTO = 258,
     AUTO = 258,
     RETURN = 259,
     RETURN = 259,
     FUNCTION = 260,
     FUNCTION = 260,
     JMP = 261,
     JMP = 261,
     EXIT = 262,
     EXIT = 262,
     EQUAL = 263,
     EQUAL = 263,
     NOT_EQUAL = 264,
     NOT_EQUAL = 264,
     GREATER_THAN = 265,
     GREATER_THAN = 265,
     LESS_THAN = 266,
     LESS_THAN = 266,
     LESS_OR_EQUAL_THAN = 267,
     LESS_OR_EQUAL_THAN = 267,
     GREATER_OR_EQUAL_THAN = 268,
     GREATER_OR_EQUAL_THAN = 268,
     IF = 269,
     IF = 269,
     ELSE = 270,
     ELSE = 270,
     OPEN_ROUND_BRACE = 271,
     OPEN_ROUND_BRACE = 271,
     CLOSE_ROUND_BRACE = 272,
     CLOSE_ROUND_BRACE = 272,
     OPEN_BRACE = 273,
     OPEN_BRACE = 273,
     CLOSE_BRACE = 274,
     CLOSE_BRACE = 274,
     ASSIGN = 275,
     ASSIGN = 275,
     DIV = 276,
     DIV = 276,
     MUL = 277,
     MUL = 277,
     ADD = 278,
     ADD = 278,
     DECCONST = 279,
     DECCONST = 279,
     HEXCONST = 280,
     HEXCONST = 280,
     BINCONST = 281,
     BINCONST = 281,
     EOS = 282,
     EOS = 282,
     DOT = 283,
     DOT = 283,
     MINUS = 284,
     MINUS = 284,
     TK_X = 285,
     TK_X = 285,
     TK_Y = 286,
     TK_Y = 286,
     TK_Z = 287,
     TK_Z = 287,
     TK_N = 288,
     TK_N = 288,
     REG = 289,
     REG = 289,
     IDENTIFIER = 290,
     IDENTIFIER = 290,
     SQRT = 291,
     SQRT = 291,
     SCALE = 292,
     SCALE = 292,
     UNSCALE = 293,
     UNSCALE = 293,
     USING = 294,
     USING = 294,
     FIXED_POINT = 295,
     FIXED_POINT = 295,
     COMMA = 296,
     COMMA = 296,
     OPEN_SQUARE_BRACE = 297,
     OPEN_SQUARE_BRACE = 297,
     CLOSE_SQUARE_BRACE = 298,
     CLOSE_SQUARE_BRACE = 298,
     WHILE = 299,
     WHILE = 299,
     ADD_EQ = 300,
     ADD_EQ = 300,
     THREAD = 301,
     THREAD = 301,
     START = 302,
     START = 302,
     BITWISE_AND = 303,
     BITWISE_AND = 303,
     BITWISE_OR = 304,
     BITWISE_OR = 304,
     OUT = 305
     OUT = 305,
 
     IN = 306
   };
   };
 
 
    };
    };
    /// Token type.
    /// Token type.
    typedef token::yytokentype token_type;
    typedef token::yytokentype token_type;
 
 
    /// Build a parser object.
    /// Build a parser object.
    Parser (Theia::Scanner &scanner_yyarg, std::map<std::string,unsigned int>  & mSymbolMap_yyarg, std::vector< Instruction > &mInstructions_yyarg, bool &mGenerateFixedPointArithmetic_yyarg);
    Parser (Theia::Scanner &scanner_yyarg, std::map<std::string,unsigned int>  & mSymbolMap_yyarg, std::vector< Instruction > &mInstructions_yyarg, bool &mGenerateFixedPointArithmetic_yyarg);
    virtual ~Parser ();
    virtual ~Parser ();
 
 
    /// Parse.
    /// Parse.
    /// \returns  0 iff parsing succeeded.
    /// \returns  0 iff parsing succeeded.
    virtual int parse ();
    virtual int parse ();
 
 
#if YYDEBUG
#if YYDEBUG
    /// The current debugging stream.
    /// The current debugging stream.
    std::ostream& debug_stream () const;
    std::ostream& debug_stream () const;
    /// Set the current debugging stream.
    /// Set the current debugging stream.
    void set_debug_stream (std::ostream &);
    void set_debug_stream (std::ostream &);
 
 
    /// Type for debugging levels.
    /// Type for debugging levels.
    typedef int debug_level_type;
    typedef int debug_level_type;
    /// The current debugging level.
    /// The current debugging level.
    debug_level_type debug_level () const;
    debug_level_type debug_level () const;
    /// Set the current debugging level.
    /// Set the current debugging level.
    void set_debug_level (debug_level_type l);
    void set_debug_level (debug_level_type l);
#endif
#endif
 
 
  private:
  private:
    /// Report a syntax error.
    /// Report a syntax error.
    /// \param loc    where the syntax error is found.
    /// \param loc    where the syntax error is found.
    /// \param msg    a description of the syntax error.
    /// \param msg    a description of the syntax error.
    virtual void error (const location_type& loc, const std::string& msg);
    virtual void error (const location_type& loc, const std::string& msg);
 
 
    /// Generate an error message.
    /// Generate an error message.
    /// \param state   the state where the error occurred.
    /// \param state   the state where the error occurred.
    /// \param tok     the lookahead token.
    /// \param tok     the lookahead token.
    virtual std::string yysyntax_error_ (int yystate, int tok);
    virtual std::string yysyntax_error_ (int yystate, int tok);
 
 
#if YYDEBUG
#if YYDEBUG
    /// \brief Report a symbol value on the debug stream.
    /// \brief Report a symbol value on the debug stream.
    /// \param yytype       The token type.
    /// \param yytype       The token type.
    /// \param yyvaluep     Its semantic value.
    /// \param yyvaluep     Its semantic value.
    /// \param yylocationp  Its location.
    /// \param yylocationp  Its location.
    virtual void yy_symbol_value_print_ (int yytype,
    virtual void yy_symbol_value_print_ (int yytype,
                                         const semantic_type* yyvaluep,
                                         const semantic_type* yyvaluep,
                                         const location_type* yylocationp);
                                         const location_type* yylocationp);
    /// \brief Report a symbol on the debug stream.
    /// \brief Report a symbol on the debug stream.
    /// \param yytype       The token type.
    /// \param yytype       The token type.
    /// \param yyvaluep     Its semantic value.
    /// \param yyvaluep     Its semantic value.
    /// \param yylocationp  Its location.
    /// \param yylocationp  Its location.
    virtual void yy_symbol_print_ (int yytype,
    virtual void yy_symbol_print_ (int yytype,
                                   const semantic_type* yyvaluep,
                                   const semantic_type* yyvaluep,
                                   const location_type* yylocationp);
                                   const location_type* yylocationp);
#endif
#endif
 
 
 
 
    /// State numbers.
    /// State numbers.
    typedef int state_type;
    typedef int state_type;
    /// State stack type.
    /// State stack type.
    typedef stack<state_type>    state_stack_type;
    typedef stack<state_type>    state_stack_type;
    /// Semantic value stack type.
    /// Semantic value stack type.
    typedef stack<semantic_type> semantic_stack_type;
    typedef stack<semantic_type> semantic_stack_type;
    /// location stack type.
    /// location stack type.
    typedef stack<location_type> location_stack_type;
    typedef stack<location_type> location_stack_type;
 
 
    /// The state stack.
    /// The state stack.
    state_stack_type yystate_stack_;
    state_stack_type yystate_stack_;
    /// The semantic value stack.
    /// The semantic value stack.
    semantic_stack_type yysemantic_stack_;
    semantic_stack_type yysemantic_stack_;
    /// The location stack.
    /// The location stack.
    location_stack_type yylocation_stack_;
    location_stack_type yylocation_stack_;
 
 
    /// Internal symbol numbers.
    /// Internal symbol numbers.
    typedef unsigned char token_number_type;
    typedef unsigned char token_number_type;
    /* Tables.  */
    /* Tables.  */
    /// For a state, the index in \a yytable_ of its portion.
    /// For a state, the index in \a yytable_ of its portion.
    static const short int yypact_[];
    static const short int yypact_[];
    static const signed char yypact_ninf_;
    static const signed char yypact_ninf_;
 
 
    /// For a state, default rule to reduce.
    /// For a state, default rule to reduce.
    /// Unless\a  yytable_ specifies something else to do.
    /// Unless\a  yytable_ specifies something else to do.
    /// Zero means the default is an error.
    /// Zero means the default is an error.
    static const unsigned char yydefact_[];
    static const unsigned char yydefact_[];
 
 
    static const short int yypgoto_[];
    static const short int yypgoto_[];
    static const short int yydefgoto_[];
    static const short int yydefgoto_[];
 
 
    /// What to do in a state.
    /// What to do in a state.
    /// \a yytable_[yypact_[s]]: what to do in state \a s.
    /// \a yytable_[yypact_[s]]: what to do in state \a s.
    /// - if positive, shift that token.
    /// - if positive, shift that token.
    /// - if negative, reduce the rule which number is the opposite.
    /// - if negative, reduce the rule which number is the opposite.
    /// - if zero, do what YYDEFACT says.
    /// - if zero, do what YYDEFACT says.
    static const unsigned char yytable_[];
    static const unsigned char yytable_[];
    static const signed char yytable_ninf_;
    static const signed char yytable_ninf_;
 
 
    static const short int yycheck_[];
    static const short int yycheck_[];
 
 
    /// For a state, its accessing symbol.
    /// For a state, its accessing symbol.
    static const unsigned char yystos_[];
    static const unsigned char yystos_[];
 
 
    /// For a rule, its LHS.
    /// For a rule, its LHS.
    static const unsigned char yyr1_[];
    static const unsigned char yyr1_[];
    /// For a rule, its RHS length.
    /// For a rule, its RHS length.
    static const unsigned char yyr2_[];
    static const unsigned char yyr2_[];
 
 
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
    /// For a symbol, its name in clear.
    /// For a symbol, its name in clear.
    static const char* const yytname_[];
    static const char* const yytname_[];
#endif
#endif
 
 
#if YYERROR_VERBOSE
#if YYERROR_VERBOSE
    /// Convert the symbol name \a n to a form suitable for a diagnostic.
    /// Convert the symbol name \a n to a form suitable for a diagnostic.
    virtual std::string yytnamerr_ (const char *n);
    virtual std::string yytnamerr_ (const char *n);
#endif
#endif
 
 
#if YYDEBUG
#if YYDEBUG
    /// A type to store symbol numbers and -1.
    /// A type to store symbol numbers and -1.
    typedef signed char rhs_number_type;
    typedef signed char rhs_number_type;
    /// A `-1'-separated list of the rules' RHS.
    /// A `-1'-separated list of the rules' RHS.
    static const rhs_number_type yyrhs_[];
    static const rhs_number_type yyrhs_[];
    /// For each rule, the index of the first RHS symbol in \a yyrhs_.
    /// For each rule, the index of the first RHS symbol in \a yyrhs_.
    static const unsigned short int yyprhs_[];
    static const unsigned short int yyprhs_[];
    /// For each rule, its source line number.
    /// For each rule, its source line number.
    static const unsigned short int yyrline_[];
    static const unsigned short int yyrline_[];
    /// For each scanner token number, its symbol number.
    /// For each scanner token number, its symbol number.
    static const unsigned short int yytoken_number_[];
    static const unsigned short int yytoken_number_[];
    /// Report on the debug stream that the rule \a r is going to be reduced.
    /// Report on the debug stream that the rule \a r is going to be reduced.
    virtual void yy_reduce_print_ (int r);
    virtual void yy_reduce_print_ (int r);
    /// Print the state stack on the debug stream.
    /// Print the state stack on the debug stream.
    virtual void yystack_print_ ();
    virtual void yystack_print_ ();
 
 
    /* Debugging.  */
    /* Debugging.  */
    int yydebug_;
    int yydebug_;
    std::ostream* yycdebug_;
    std::ostream* yycdebug_;
#endif
#endif
 
 
    /// Convert a scanner token number \a t to a symbol number.
    /// Convert a scanner token number \a t to a symbol number.
    token_number_type yytranslate_ (int t);
    token_number_type yytranslate_ (int t);
 
 
    /// \brief Reclaim the memory associated to a symbol.
    /// \brief Reclaim the memory associated to a symbol.
    /// \param yymsg        Why this token is reclaimed.
    /// \param yymsg        Why this token is reclaimed.
    /// \param yytype       The symbol type.
    /// \param yytype       The symbol type.
    /// \param yyvaluep     Its semantic value.
    /// \param yyvaluep     Its semantic value.
    /// \param yylocationp  Its location.
    /// \param yylocationp  Its location.
    inline void yydestruct_ (const char* yymsg,
    inline void yydestruct_ (const char* yymsg,
                             int yytype,
                             int yytype,
                             semantic_type* yyvaluep,
                             semantic_type* yyvaluep,
                             location_type* yylocationp);
                             location_type* yylocationp);
 
 
    /// Pop \a n symbols the three stacks.
    /// Pop \a n symbols the three stacks.
    inline void yypop_ (unsigned int n = 1);
    inline void yypop_ (unsigned int n = 1);
 
 
    /* Constants.  */
    /* Constants.  */
    static const int yyeof_;
    static const int yyeof_;
    /* LAST_ -- Last index in TABLE_.  */
    /* LAST_ -- Last index in TABLE_.  */
    static const int yylast_;
    static const int yylast_;
    static const int yynnts_;
    static const int yynnts_;
    static const int yyempty_;
    static const int yyempty_;
    static const int yyfinal_;
    static const int yyfinal_;
    static const int yyterror_;
    static const int yyterror_;
    static const int yyerrcode_;
    static const int yyerrcode_;
    static const int yyntokens_;
    static const int yyntokens_;
    static const unsigned int yyuser_token_number_max_;
    static const unsigned int yyuser_token_number_max_;
    static const token_number_type yyundef_token_;
    static const token_number_type yyundef_token_;
 
 
    /* User arguments.  */
    /* User arguments.  */
    Theia::Scanner &scanner;
    Theia::Scanner &scanner;
    std::map<std::string,unsigned int>  & mSymbolMap;
    std::map<std::string,unsigned int>  & mSymbolMap;
    std::vector< Instruction > &mInstructions;
    std::vector< Instruction > &mInstructions;
    bool &mGenerateFixedPointArithmetic;
    bool &mGenerateFixedPointArithmetic;
  };
  };
 
 
/* Line 35 of lalr1.cc  */
/* Line 35 of lalr1.cc  */
#line 28 "parser.y"
#line 28 "parser.y"
} // Theia
} // Theia
 
 
/* Line 35 of lalr1.cc  */
/* Line 35 of lalr1.cc  */
#line 392 "parser.tab.h"
#line 393 "parser.tab.h"
 
 
 
 
 
 
#endif /* ! defined PARSER_HEADER_H */
#endif /* ! defined PARSER_HEADER_H */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.