Add AST element for function call expressions
This commit is contained in:
parent
cdb180e1d4
commit
066a9b7a61
|
|
@ -444,3 +444,10 @@ void vhdl_null_stmt::emit(std::ofstream &of, int level) const
|
||||||
{
|
{
|
||||||
of << "null;";
|
of << "null;";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void vhdl_fcall::emit(std::ofstream &of, int level) const
|
||||||
|
{
|
||||||
|
of << name_;
|
||||||
|
exprs_.emit(of, level);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,7 @@ private:
|
||||||
vhdl_type *type_;
|
vhdl_type *type_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A normal scalar variable reference.
|
* A normal scalar variable reference.
|
||||||
*/
|
*/
|
||||||
|
|
@ -94,6 +95,7 @@ private:
|
||||||
std::string name_;
|
std::string name_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class vhdl_const_string : public vhdl_expr {
|
class vhdl_const_string : public vhdl_expr {
|
||||||
public:
|
public:
|
||||||
vhdl_const_string(const char *value)
|
vhdl_const_string(const char *value)
|
||||||
|
|
@ -104,6 +106,7 @@ private:
|
||||||
std::string value_;
|
std::string value_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class vhdl_expr_list : public vhdl_element {
|
class vhdl_expr_list : public vhdl_element {
|
||||||
public:
|
public:
|
||||||
~vhdl_expr_list();
|
~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
|
* A concurrent statement appears in architecture bodies but not
|
||||||
* processes.
|
* processes.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue