⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oaverilogparser.skl

📁 openaccess与verilog互相转化时所用的源代码
💻 SKL
📖 第 1 页 / 共 3 页
字号:
#endif/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */const ]b4_int_type_for([b4_r1])[]b4_parser_namespace[::]b4_parser_class_name[::r1_[] ={  ]b4_r1[};/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */const ]b4_int_type_for([b4_r2])[]b4_parser_namespace[::]b4_parser_class_name[::r2_[] ={  ]b4_r2[};#if YYDEBUG || YYERROR_VERBOSE/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.   First, the terminals, then, starting at YYNTOKENS, nonterminals. */const char*const ]b4_parser_namespace[::]b4_parser_class_name[::name_[] ={  ]b4_tname[};#endif#if YYDEBUG/* YYRHS -- A `-1'-separated list of the rules' RHS. */const ]b4_parser_namespace[::]b4_parser_class_name[::RhsNumberType]b4_parser_namespace[::]b4_parser_class_name[::rhs_[] ={  ]b4_rhs[};/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in   YYRHS.  */const ]b4_int_type_for([b4_prhs])[]b4_parser_namespace[::]b4_parser_class_name[::prhs_[] ={  ]b4_prhs[};/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */const ]b4_int_type_for([b4_rline])[]b4_parser_namespace[::]b4_parser_class_name[::rline_[] ={  ]b4_rline[};/** Print the state stack from its BOTTOM up to its TOP (included).  */void]b4_parser_namespace[::]b4_parser_class_name[::stack_print_ (){  cdebug_ << "state stack now";  for (StateStack::ConstIterator i = state_stack_.begin ();       i != state_stack_.end (); i++)    cdebug_ << ' ' << *i;  cdebug_ << std::endl;}/** Report that the YYRULE is going to be reduced.  */void]b4_parser_namespace[::]b4_parser_class_name[::reduce_print_ (int yyrule){  unsigned int yylno = rline_[yyrule];  /* Print the symbols being reduced, and their result.  */  cdebug_ << "Reducing via rule " << n_ - 1 << " (line " << yylno << "), ";  for (]b4_int_type_for([b4_prhs])[ i = prhs_[n_];       0 <= rhs_[i]; i++)    cdebug_ << name_[rhs_[i]] << ' ';  cdebug_ << "-> " << name_[r1_[n_]] << std::endl;}#endif // YYDEBUG/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */]b4_parser_namespace[::]b4_parser_class_name[::TokenNumberType]b4_parser_namespace[::]b4_parser_class_name[::translate_ (int token){  static  const TokenNumberType  translate_table[] =  {    ]b4_translate[  };  if ((unsigned) token <= user_token_number_max_)    return translate_table[token];  else    return undef_token_;}const int ]b4_parser_namespace[::]b4_parser_class_name[::eof_ = 0;const int ]b4_parser_namespace[::]b4_parser_class_name[::last_ = ]b4_last[;const int ]b4_parser_namespace[::]b4_parser_class_name[::nnts_ = ]b4_nterms_number[;const int ]b4_parser_namespace[::]b4_parser_class_name[::empty_ = -2;const int ]b4_parser_namespace[::]b4_parser_class_name[::final_ = ]b4_final_state_number[;const int ]b4_parser_namespace[::]b4_parser_class_name[::terror_ = 1;const int ]b4_parser_namespace[::]b4_parser_class_name[::errcode_ = 256;const int ]b4_parser_namespace[::]b4_parser_class_name[::ntokens_ = ]b4_tokens_number[;const unsigned ]b4_parser_namespace[::]b4_parser_class_name[::user_token_number_max_ = ]b4_user_token_number_max[;const ]b4_parser_namespace[::]b4_parser_class_name[::TokenNumberType ]b4_parser_namespace[::]b4_parser_class_name[::undef_token_ = ]b4_undef_token_number[;]b4_epiloguednl@output stack.hhb4_copyright([Stack handling for Bison C++ parsers], [2002, 2003])[#ifndef BISON_STACK_HH# define BISON_STACK_HH#include <deque>namespace ]b4_parser_namespace[{  template < class T, class S = std::deque< T > >  class Stack  {  public:    typedef typename S::iterator Iterator;    typedef typename S::const_iterator ConstIterator;    Stack () : seq_ ()    {    }    Stack (unsigned n) : seq_ (n)    {    }    inline    T&    operator [] (unsigned i)    {      return seq_[i];    }    inline    const T&    operator [] (unsigned i) const    {      return seq_[i];    }    inline    void    push (const T& t)    {      seq_.push_front (t);    }    inline    void    pop (unsigned n = 1)    {      for (; n; --n)	seq_.pop_front ();    }    inline    size_t    height () const    {      return seq_.size ();    }    inline ConstIterator begin () const { return seq_.begin (); }    inline ConstIterator end () const { return seq_.end (); }  private:    S seq_;  };  template < class T, class S = Stack< T > >  class Slice  {  public:    Slice (const S& stack,	   unsigned range) : stack_ (stack),			     range_ (range)    {    }    inline    const T&    operator [] (unsigned i) const    {      return stack_[range_ - i];    }  private:    const S& stack_;    unsigned range_;  };}#endif // not BISON_STACK_HH]dnl@output position.hhb4_copyright([Position class for Bison C++ parsers], [2002, 2003])[/** ** \file position.hh ** Define the Location class. */#ifndef BISON_POSITION_HH# define BISON_POSITION_HH# include <iostream># include <string>namespace ]b4_parser_namespace[{  /** \brief Abstract a Position. */  class Position  {  public:    /** \brief Initial column number. */    static const unsigned int initial_column;    /** \brief Initial line number. */    static const unsigned int initial_line;    /** \name Ctor & dtor.     ** \{ */  public:    /** \brief Construct a Position. */    Position () :      filename (),      line (initial_line),      column (initial_column)    {    }    /** \} */    /** \name Line and Column related manipulators     ** \{ */  public:    /** \brief (line related) Advance to the COUNT next lines. */    inline void lines (int count = 1)    {      column = initial_column;      line += count;    }    /** \brief (column related) Advance to the COUNT next columns. */    inline void columns (int count = 1)    {      int leftmost = initial_column;      int current  = column;      if (leftmost <= current + count)	column += count;      else	column = initial_column;    }    /** \} */  public:    /** \brief File name to which this position refers. */    std::string filename;    /** \brief Current line number. */    unsigned int line;    /** \brief Current column number. */    unsigned int column;  };  /** \brief Add and assign a Position. */  inline const Position&  operator+= (Position& res, const int width)  {    res.columns (width);    return res;  }  /** \brief Add two Position objects. */  inline const Position  operator+ (const Position& begin, const int width)  {    Position res = begin;    return res += width;  }  /** \brief Add and assign a Position. */  inline const Position&  operator-= (Position& res, const int width)  {    return res += -width;  }  /** \brief Add two Position objects. */  inline const Position  operator- (const Position& begin, const int width)  {    return begin + -width;  }  /** \brief Intercept output stream redirection.   ** \param ostr the destination output stream   ** \param pos a reference to the Position to redirect   */  inline std::ostream&  operator<< (std::ostream& ostr, const Position& pos)  {    if (!pos.filename.empty ())      ostr << pos.filename << ':';    return ostr << pos.line << '.' << pos.column;  }}#endif // not BISON_POSITION_HH]@output location.hhb4_copyright([Location class for Bison C++ parsers], [2002, 2003])[/** ** \file location.hh ** Define the Location class. */#ifndef BISON_LOCATION_HH# define BISON_LOCATION_HH# include <iostream># include <string># include "position.hh"namespace ]b4_parser_namespace[{  /** \brief Abstract a Location. */  class Location  {    /** \name Ctor & dtor.     ** \{ */  public:    /** \brief Construct a Location. */    Location (void) :      begin (),      end ()    {    }    /** \} */    /** \name Line and Column related manipulators     ** \{ */  public:    /** \brief Reset initial location to final location. */    inline void step (void)    {      begin = end;    }    /** \brief Extend the current location to the COUNT next columns. */    inline void columns (unsigned int count = 1)    {      end += count;    }    /** \brief Extend the current location to the COUNT next lines. */    inline void lines (unsigned int count = 1)    {      end.lines (count);    }    /** \} */  public:    /** \brief Beginning of the located region. */    Position begin;    /** \brief End of the located region. */    Position end;  };  /** \brief Join two Location objects to create a Location. */  inline const Location operator+ (const Location& begin, const Location& end)  {    Location res = begin;    res.end = end.end;    return res;  }  /** \brief Add two Location objects */  inline const Location operator+ (const Location& begin, unsigned width)  {    Location res = begin;    res.columns (width);    return res;  }  /** \brief Add and assign a Location */  inline Location &operator+= (Location& res, unsigned width)  {    res.columns (width);    return res;  }  /** \brief Intercept output stream redirection.   ** \param ostr the destination output stream   ** \param loc a reference to the Location to redirect   **   ** Avoid duplicate information.   */  inline std::ostream& operator<< (std::ostream& ostr, const Location& loc)  {    Position last = loc.end - 1;    ostr << loc.begin;    if (loc.begin.filename != last.filename)      ostr << '-' << last;    else if (loc.begin.line != last.line)      ostr << '-' << last.line  << '.' << last.column;    else if (loc.begin.column != last.column)      ostr << '-' << last.column;    return ostr;  }}#endif // not BISON_LOCATION_HH]

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -