Support the scope expression node.

This commit is contained in:
steve 2001-04-02 00:28:35 +00:00
parent 141808b787
commit e6c36597eb
4 changed files with 42 additions and 4 deletions

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: ivl_target.h,v 1.43 2001/04/01 06:52:27 steve Exp $"
#ident "$Id: ivl_target.h,v 1.44 2001/04/02 00:28:35 steve Exp $"
#endif
#ifdef __cplusplus
@ -155,6 +155,7 @@ typedef enum ivl_expr_type_e {
IVL_EX_BINARY,
IVL_EX_CONCAT,
IVL_EX_NUMBER,
IVL_EX_SCOPE,
IVL_EX_SFUNC,
IVL_EX_SIGNAL,
IVL_EX_STRING,
@ -372,6 +373,8 @@ extern ivl_expr_t ivl_expr_parm(ivl_expr_t net, unsigned idx);
extern unsigned ivl_expr_parms(ivl_expr_t net);
/* IVL_EX_CONCAT */
extern unsigned ivl_expr_repeat(ivl_expr_t net);
/* IVL_EX_SCOPE */
extern ivl_scope_t ivl_expr_scope(ivl_expr_t net);
/* any expression */
extern int ivl_expr_signed(ivl_expr_t net);
/* IVL_EX_STRING */
@ -722,6 +725,9 @@ _END_DECL
/*
* $Log: ivl_target.h,v $
* Revision 1.44 2001/04/02 00:28:35 steve
* Support the scope expression node.
*
* Revision 1.43 2001/04/01 06:52:27 steve
* support the NetWhile statement.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: t-dll-api.cc,v 1.30 2001/04/01 06:52:27 steve Exp $"
#ident "$Id: t-dll-api.cc,v 1.31 2001/04/02 00:28:35 steve Exp $"
#endif
# include "t-dll.h"
@ -247,6 +247,13 @@ extern "C" unsigned ivl_expr_repeat(ivl_expr_t net)
return net->u_.concat_.rept;
}
extern "C" ivl_scope_t ivl_expr_scope(ivl_expr_t net)
{
assert(net);
assert(net->type_ == IVL_EX_SCOPE);
return net->u_.scope_.scope;
}
extern "C" int ivl_expr_signed(ivl_expr_t net)
{
assert(net);
@ -805,6 +812,9 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net)
/*
* $Log: t-dll-api.cc,v $
* Revision 1.31 2001/04/02 00:28:35 steve
* Support the scope expression node.
*
* Revision 1.30 2001/04/01 06:52:27 steve
* support the NetWhile statement.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) & !defined(macintosh)
#ident "$Id: t-dll-expr.cc,v 1.8 2001/03/29 02:52:39 steve Exp $"
#ident "$Id: t-dll-expr.cc,v 1.9 2001/04/02 00:28:35 steve Exp $"
#endif
# include "t-dll.h"
@ -120,6 +120,17 @@ void dll_target::expr_const(const NetEConst*net)
}
}
void dll_target::expr_scope(const NetEScope*net)
{
assert(expr_ == 0);
expr_ = (ivl_expr_t)calloc(1, sizeof(struct ivl_expr_s));
assert(expr_);
expr_->type_ = IVL_EX_SCOPE;
expr_->u_.scope_.scope = lookup_scope_(net->scope());
}
void dll_target::expr_sfunc(const NetESFunc*net)
{
assert(expr_ == 0);
@ -162,6 +173,9 @@ void dll_target::expr_unary(const NetEUnary*net)
/*
* $Log: t-dll-expr.cc,v $
* Revision 1.9 2001/04/02 00:28:35 steve
* Support the scope expression node.
*
* Revision 1.8 2001/03/29 02:52:39 steve
* Add unary ~ operator to tgt-vvp.
*

10
t-dll.h
View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: t-dll.h,v 1.30 2001/04/01 06:52:28 steve Exp $"
#ident "$Id: t-dll.h,v 1.31 2001/04/02 00:28:35 steve Exp $"
#endif
# include "target.h"
@ -91,6 +91,7 @@ struct dll_target : public target_t, public expr_scan_t {
void expr_binary(const NetEBinary*);
void expr_concat(const NetEConcat*);
void expr_const(const NetEConst*);
void expr_scope(const NetEScope*);
void expr_sfunc(const NetESFunc*);
void expr_unary(const NetEUnary*);
void expr_signal(const NetESignal*);
@ -138,6 +139,10 @@ struct ivl_expr_s {
char*bits_;
} number_;
struct {
ivl_scope_t scope;
} scope_;
struct {
char*name_;
} sfunc_;
@ -394,6 +399,9 @@ struct ivl_statement_s {
/*
* $Log: t-dll.h,v $
* Revision 1.31 2001/04/02 00:28:35 steve
* Support the scope expression node.
*
* Revision 1.30 2001/04/01 06:52:28 steve
* support the NetWhile statement.
*