Add AST element for function call expressions

This commit is contained in:
Nick Gasson 2008-06-07 13:29:27 +01:00
parent cdb180e1d4
commit 066a9b7a61
2 changed files with 27 additions and 0 deletions

View File

@ -444,3 +444,10 @@ void vhdl_null_stmt::emit(std::ofstream &of, int level) const
{
of << "null;";
}
void vhdl_fcall::emit(std::ofstream &of, int level) const
{
of << name_;
exprs_.emit(of, level);
}

View File

@ -81,6 +81,7 @@ private:
vhdl_type *type_;
};
/*
* A normal scalar variable reference.
*/
@ -94,6 +95,7 @@ private:
std::string name_;
};
class vhdl_const_string : public vhdl_expr {
public:
vhdl_const_string(const char *value)
@ -104,6 +106,7 @@ private:
std::string value_;
};
class vhdl_expr_list : public vhdl_element {
public:
~vhdl_expr_list();
@ -115,6 +118,23 @@ private:
};
/*
* A function call within an expression.
*/
class vhdl_fcall : public vhdl_expr {
public:
vhdl_fcall(const char *name, vhdl_type *rtype)
: vhdl_expr(rtype), name_(name) {};
~vhdl_fcall() {}
void add_expr(vhdl_expr *e) { exprs_.add_expr(e); }
void emit(std::ofstream &of, int level) const;
private:
std::string name_;
vhdl_expr_list exprs_;
};
/*
* A concurrent statement appears in architecture bodies but not
* processes.