#ifndef OPENFPGA_PB_PARSER_H #define OPENFPGA_PB_PARSER_H /******************************************************************** * Include header files that are required by data structure declaration *******************************************************************/ #include #include #include "vtr_geometry.h" #include "openfpga_tokenizer.h" /************************************************************************ * This file includes parsers for pb_type definition in the architecture XML * language. ***********************************************************************/ /* namespace openfpga begins */ namespace openfpga { /************************************************************************ * Class PbParser: pb_type name with full hierarchy parser * Supported pb_type definition: * 1. [].[] ... . * 2. . ... . * where each pb_type may be specified by a mode or use the default mode * (mode name not given) ***********************************************************************/ class PbParser{ public : /* Constructors*/ PbParser (const std::string& data); public : /* Public Accessors */ std::string data() const; std::string leaf() const; std::vector parents() const; std::vector modes() const; public : /* Public Mutators */ void set_data(const std::string& data); private : /* Private Mutators */ void parse(); void set_default_bracket(); void set_default_delim(); private: /* Internal data */ std::string data_; /* Lines to be splited */ vtr::Point bracket_; char delim_; std::vector parents_; std::vector modes_; std::string leaf_; }; } /* namespace openfpga ends */ #endif