iverilog/vhdlpp/architec.h

87 lines
2.3 KiB
C
Raw Normal View History

#ifndef __architec_H
#define __architec_H
/*
* Copyright (c) 2011Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
# include "StringHeap.h"
# include "LineInfo.h"
# include <list>
class Expression;
/*
* The Architecture class carries the contents (name, statements,
* etc.) of a parsed VHDL architecture. These objects are ultimately
* put into entities.
*/
class Architecture : public LineInfo {
public:
// Architectures contain concurrent statements, that are
// derived from this nested class.
class Statement : public LineInfo {
public:
Statement();
virtual ~Statement() =0;
virtual void dump(ostream&out) const;
private:
private: // Not implemented
};
public:
// Create an architecture from its name and its statements.
// NOTE: The statement list passed in is emptied.
Architecture(perm_string name, std::list<Architecture::Statement*>&s);
~Architecture();
perm_string get_name() const { return name_; }
void dump(ostream&out, perm_string of_entity) const;
private:
perm_string name_;
std::list<Architecture::Statement*> statements_;
private: // Not implemented
};
/*
* The SignalAssignment class represents the
* concurrent_signal_assignment that is placed in an architecture.
*/
class SignalAssignment : public Architecture::Statement {
public:
SignalAssignment(perm_string target_name, std::list<Expression*>&rval);
~SignalAssignment();
virtual void dump(ostream&out) const;
private:
perm_string target_name_;
std::list<Expression*> rval_;
};
#endif