You have new messages

This commit is contained in:
Ludovic Jacomme 2002-04-19 15:40:18 +00:00
parent d7c1096ac5
commit c154225d5d
8 changed files with 150 additions and 315 deletions

View File

@ -49,28 +49,6 @@
| Constants | | Constants |
| | | |
\------------------------------------------------------*/ \------------------------------------------------------*/
/*------------------------------------------------------\
| |
| Ctl Direction |
| |
\------------------------------------------------------*/
# define CTL_DIR_IN 0
# define CTL_DIR_OUT 1
# define CTL_DIR_INOUT 2
# define CTL_MAX_DIR_TYPE 3
/*------------------------------------------------------\
| |
| Ctl Kind |
| |
\------------------------------------------------------*/
# define CTL_KIND_NONE 0
# define CTL_KIND_BUS 1
# define CTL_KIND_REGISTER 2
# define CTL_MAX_KIND_TYPE 3
/*------------------------------------------------------\ /*------------------------------------------------------\
| | | |
| Ctl Declar Type | | Ctl Declar Type |
@ -78,12 +56,9 @@
\------------------------------------------------------*/ \------------------------------------------------------*/
# define CTL_DECLAR_ALL 0 # define CTL_DECLAR_ALL 0
# define CTL_DECLAR_PORT 1 # define CTL_DECLAR_VARIABLE 1
# define CTL_DECLAR_SIGNAL 2 # define CTL_DECLAR_CONSTANT 2
# define CTL_DECLAR_VARIABLE 3 # define CTL_MAX_DECLAR_TYPE 3
# define CTL_DECLAR_DEFINE 4
# define CTL_DECLAR_CONSTANT 5
# define CTL_MAX_DECLAR_TYPE 6
/*------------------------------------------------------\ /*------------------------------------------------------\
| | | |
@ -99,89 +74,15 @@
# define GetCtlSymbol( C ) ((ctlsym *)( (C)->DATA )) # define GetCtlSymbol( C ) ((ctlsym *)( (C)->DATA ))
# define GetCtlDeclar( C ) ((ctldecl_list *)( (C)->DATA )) # define GetCtlDeclar( C ) ((ctldecl_list *)( (C)->DATA ))
/*------------------------------------------------------\
| |
| Ctl Get Arc |
| |
\------------------------------------------------------*/
# define GetCtlArc( C ) \
((ctlarc *)( (C)->DATA ))
# define GetCtlArcTargetPlace( A ) \
((ctlplace_list *)( (ctlarc *)(A)->TARGET ))
# define GetCtlArcSourcePlace( A ) \
((ctlplace_list *)( (ctlarc *)(A)->SOURCE ))
# define GetCtlArcTargetTrans( A ) \
((ctltrans_list *)( (ctlarc *)(A)->TARGET ))
# define GetCtlArcSourceTrans( A ) \
((ctltrans_list *)( (ctlarc *)(A)->SOURCE ))
/*------------------------------------------------------\
| |
| Ctl Add Arc |
| |
\------------------------------------------------------*/
# define addctlarctrans( F, T, P ) \
(addctlarc( (F), (T), (P), CTL_ARC_TRANS_PLACE ))
# define addctlarcplace( F, P, T ) \
(addctlarc( (F), (P), (T), CTL_ARC_PLACE_TRANS ))
/*------------------------------------------------------\
| |
| Ctl Add Action |
| |
\------------------------------------------------------*/
# define addctlactcall( F, T, E ) \
(addctlact( (F), (T), (vexexpr *)0, (E), CTL_ACT_CALL ))
# define addctlactreturn( F, T, E ) \
(addctlact( (F), (T), (vexexpr *)0, (E), CTL_ACT_RETURN ))
# define addctlactcallafter( F, T, P, E ) \
(addctlactafter( (F), (T), (P), (vexexpr *)0, (E), CTL_ACT_CALL ))
# define addctlactreturnafter( F, T, P, E ) \
(addctlactafter( (F), (T), (P), (vexexpr *)0, (E), CTL_ACT_RETURN ))
# define addctlactcallbefore( F, T, P, E ) \
(addctlactbefore( (F), (T), (P), (vexexpr *)0, (E), CTL_ACT_CALL ))
# define addctlactreturnbefore( F, T, P, E ) \
(addctlactafter( (F), (T), (P), (vexexpr *)0, (E), CTL_ACT_RETURN ))
# define addctlactcallfirst( F, T, E ) \
(addctlactfirst( (F), (T), (vexexpr *)0, (E), CTL_ACT_CALL ))
# define addctlactreturnfirst( F, T, E ) \
(addctlactfirst( (F), (T), (vexexpr *)0, (E), CTL_ACT_RETURN ))
/*------------------------------------------------------\ /*------------------------------------------------------\
| | | |
| Ctl Get Number | | Ctl Get Number |
| | | |
\------------------------------------------------------*/ \------------------------------------------------------*/
# define GetCtlNumProc( F ) ((F)->HASH_PROCESS->NUMBER_ELEM)
# define GetCtlNumFunc( F ) ((F)->HASH_FUNCTION->NUMBER_ELEM)
# define GetCtlNumTrans( F ) ((F)->HASH_TRANS->NUMBER_ELEM)
# define GetCtlNumPlace( F ) ((F)->HASH_PLACE->NUMBER_ELEM)
# define GetCtlNumArc( F ) ((F)->HASH_ARC->NUMBER_ELEM)
# define GetCtlNumDecl( F ) ((F)->HASH_DECLAR[ CTL_DECLAR_ALL ]->NUMBER_ELEM) # define GetCtlNumDecl( F ) ((F)->HASH_DECLAR[ CTL_DECLAR_ALL ]->NUMBER_ELEM)
# define GetCtlNumDeclPort( F ) ((F)->HASH_DECLAR[ CTL_DECLAR_PORT ]->NUMBER_ELEM)
# define GetCtlNumDeclSig( F ) ((F)->HASH_DECLAR[ CTL_DECLAR_SIGNAL ]->NUMBER_ELEM)
# define GetCtlNumDeclVar( F ) ((F)->HASH_DECLAR[ CTL_DECLAR_VARIABLE ]->NUMBER_ELEM) # define GetCtlNumDeclVar( F ) ((F)->HASH_DECLAR[ CTL_DECLAR_VARIABLE ]->NUMBER_ELEM)
# define GetCtlNumDeclCst( F ) ((F)->HASH_DECLAR[ CTL_DECLAR_CONSTANT ]->NUMBER_ELEM) # define GetCtlNumDeclCst( F ) ((F)->HASH_DECLAR[ CTL_DECLAR_CONSTANT ]->NUMBER_ELEM)
# define GetCtlNumDeclDef( F ) ((F)->HASH_DECLAR[ CTL_DECLAR_DEFINE ]->NUMBER_ELEM)
# define GetCtlNumDeclArg( F ) ((F)->HASH_DECLAR[ CTL_DECLAR_ARGUMENT ]->NUMBER_ELEM)
/*------------------------------------------------------\ /*------------------------------------------------------\
| | | |
@ -189,20 +90,10 @@
| | | |
\------------------------------------------------------*/ \------------------------------------------------------*/
# define searchctlsymport( F, N, I ) \
(searchctlsym( (F), (N), (I), CTL_DECLAR_PORT ))
# define searchctlsymsig( F, N, I ) \
(searchctlsym( (F), (N), (I), CTL_DECLAR_SIGNAL ))
# define searchctlsymvar( F, N, I ) \ # define searchctlsymvar( F, N, I ) \
(searchctlsym( (F), (N), (I), CTL_DECLAR_VARIABLE )) (searchctlsym( (F), (N), (I), CTL_DECLAR_VARIABLE ))
# define searchctlsymcst( F, N, I ) \ # define searchctlsymcst( F, N, I ) \
(searchctlsym( (F), (N), (I), CTL_DECLAR_CONSTANT )) (searchctlsym( (F), (N), (I), CTL_DECLAR_CONSTANT ))
# define searchctlsymdef( F, N, I ) \
(searchctlsym( (F), (N), (I), CTL_DECLAR_DEFINE ))
# define searchctlsymarg( F, N, I ) \
(searchctlsym( (F), (N) (I), CTL_DECLAR_ARGUMENT ))
# define searchctlsymgen( F, N, I ) \
(searchctlsym( (F), (N), (I), CTL_DECLAR_GENERIC ))
# define searchctlsymall( F, N, I ) \ # define searchctlsymall( F, N, I ) \
(searchctlsym( (F), (N), (I), CTL_DECLAR_ALL )) (searchctlsym( (F), (N), (I), CTL_DECLAR_ALL ))
@ -212,24 +103,13 @@
| | | |
\------------------------------------------------------*/ \------------------------------------------------------*/
# define searchctldeclport( F, N ) \
(searchctldecl( (F), (N), CTL_DECLAR_PORT ))
# define searchctldeclsig( F, N ) \
(searchctldecl( (F), (N), CTL_DECLAR_SIGNAL ))
# define searchctldeclvar( F, N ) \ # define searchctldeclvar( F, N ) \
(searchctldecl( (F), (N), CTL_DECLAR_VARIABLE )) (searchctldecl( (F), (N), CTL_DECLAR_VARIABLE ))
# define searchctldeclcst( F, N ) \ # define searchctldeclcst( F, N ) \
(searchctldecl( (F), (N), CTL_DECLAR_CONSTANT )) (searchctldecl( (F), (N), CTL_DECLAR_CONSTANT ))
# define searchctldecldef( F, N ) \
(searchctldecl( (F), (N), CTL_DECLAR_DEFINE ))
# define searchctldeclarg( F, N ) \
(searchctldecl( (F), (N), CTL_DECLAR_ARGUMENT ))
# define searchctldeclgen( F, N ) \
(searchctldecl( (F), (N), CTL_DECLAR_GENERIC ))
# define searchctldeclall( F, N ) \ # define searchctldeclall( F, N ) \
(searchctldecl( (F), (N), CTL_DECLAR_ALL )) (searchctldecl( (F), (N), CTL_DECLAR_ALL ))
/*------------------------------------------------------\ /*------------------------------------------------------\
| | | |
| Type | | Type |
@ -249,6 +129,24 @@
} ctlline_list; } ctlline_list;
/*------------------------------------------------------\
| |
| Ctl Type |
| |
\------------------------------------------------------*/
typedef struct ctltype_list
{
struct ctltype_list *NEXT;
char *NAME;
unsigned long SIZE;
char **VALUE;
ctlline_list *LINE;
long FLAGS;
void *USER;
} ctltype_list;
/*------------------------------------------------------\ /*------------------------------------------------------\
| | | |
| Ctl Symbol | | Ctl Symbol |
@ -278,10 +176,8 @@
vexexpr *VEX_ATOM; vexexpr *VEX_ATOM;
vexexpr *VEX_INIT; vexexpr *VEX_INIT;
ctlsym *DECL_SYM; ctlsym *DECL_SYM;
unsigned char DIR; ctltype_list *USER_TYPE;
unsigned char TYPE; unsigned char TYPE;
unsigned char KIND;
unsigned char BASE;
ctlline_list *LINE; ctlline_list *LINE;
long FLAGS; long FLAGS;
void *USER; void *USER;
@ -290,7 +186,7 @@
/*------------------------------------------------------\ /*------------------------------------------------------\
| | | |
| Ctl Formulae | | Ctl Formula |
| | | |
\------------------------------------------------------*/ \------------------------------------------------------*/
@ -316,6 +212,7 @@
{ {
struct ctlfig_list *NEXT; struct ctlfig_list *NEXT;
char *NAME; char *NAME;
ctltype_list *TYPE;
ctlform_list *FORM; ctlform_list *FORM;
ctldecl_list *DECLAR[ CTL_MAX_DECLAR_TYPE ]; ctldecl_list *DECLAR[ CTL_MAX_DECLAR_TYPE ];
authtable *HASH_DECLAR[ CTL_MAX_DECLAR_TYPE ]; authtable *HASH_DECLAR[ CTL_MAX_DECLAR_TYPE ];
@ -334,8 +231,6 @@
extern ctlfig_list *HEAD_CTLFIG; extern ctlfig_list *HEAD_CTLFIG;
extern char *CTL_DECLAR_TYPE [ CTL_MAX_DECLAR_TYPE ]; extern char *CTL_DECLAR_TYPE [ CTL_MAX_DECLAR_TYPE ];
extern char *CTL_DIR_TYPE [ CTL_MAX_DIR_TYPE ];
extern char *CTL_KIND_TYPE [ CTL_MAX_KIND_TYPE ];
/*------------------------------------------------------\ /*------------------------------------------------------\
| | | |
@ -358,6 +253,7 @@
extern ctlfig_list *allocctlfig __P(()); extern ctlfig_list *allocctlfig __P(());
extern ctlform_list *allocctlform __P(()); extern ctlform_list *allocctlform __P(());
extern ctltype_list *allocctltype __P(());
extern ctldecl_list *allocctldecl __P(()); extern ctldecl_list *allocctldecl __P(());
extern ctlsym *allocctlsym __P((unsigned int Width)); extern ctlsym *allocctlsym __P((unsigned int Width));
extern ctlline_list *allocctlline __P(()); extern ctlline_list *allocctlline __P(());
@ -382,11 +278,11 @@
extern ctlfig_list *addctlfig __P((char *Name)); extern ctlfig_list *addctlfig __P((char *Name));
extern ctlform_list *addctlform __P((ctlfig_list *Figure, char *Name, vexexpr *Expr)); extern ctlform_list *addctlform __P((ctlfig_list *Figure, char *Name, vexexpr *Expr));
extern ctltype_list *addctltype __P((ctlfig_list *Figure, char *Name));
extern ctldecl_list *addctldecl __P((ctlfig_list *Figure, vexexpr *Atom, unsigned char Type, unsigned char Base)); extern ctldecl_list *addctldecl __P((ctlfig_list *Figure, vexexpr *Atom, unsigned char Type ));
extern ctldecl_list *addctldeclport __P((ctlfig_list *Figure, vexexpr *Atom, unsigned char Base, unsigned char Dir, unsigned char Kind)); extern ctldecl_list *addctldeclvar __P((ctlfig_list *Figure, vexexpr *Atom));
extern ctldecl_list *addctldeclsig __P((ctlfig_list *Figure, vexexpr *Atom, unsigned char Base, unsigned char Kind)); extern ctldecl_list *addctldeclcst __P((ctlfig_list *Figure, vexexpr *Atom));
extern ctldecl_list *addctldeclcst __P((ctlfig_list *Figure, vexexpr *Atom, unsigned char Base));
extern ctlline_list *addctlline __P((ctlfig_list *Figure, ctlline_list **HeadLine, long Line)); extern ctlline_list *addctlline __P((ctlfig_list *Figure, ctlline_list **HeadLine, long Line));
extern ctlline_list *addctlfileline __P((ctlfig_list *Figure, ctlline_list **HeadLine, char *File, long Line)); extern ctlline_list *addctlfileline __P((ctlfig_list *Figure, ctlline_list **HeadLine, char *File, long Line));
@ -408,6 +304,7 @@
extern ctlfig_list *searchctlfig __P((char *Name)); extern ctlfig_list *searchctlfig __P((char *Name));
extern ctlform_list *searchctlform __P((ctlfig_list *Figure, char *Name)); extern ctlform_list *searchctlform __P((ctlfig_list *Figure, char *Name));
extern ctltype_list *searchctltype __P((ctlfig_list *Figure, char *Name));
extern ctlsym *searchctlsym __P((ctlfig_list *Figure, char *Name, short Index, unsigned char Type)); extern ctlsym *searchctlsym __P((ctlfig_list *Figure, char *Name, short Index, unsigned char Type));
extern ctldecl_list *searchctldecl __P((ctlfig_list *Figure, char *Name, unsigned char Type)); extern ctldecl_list *searchctldecl __P((ctlfig_list *Figure, char *Name, unsigned char Type));
@ -431,6 +328,7 @@
extern void viewctlsym __P((ctlsym *Symbol)); extern void viewctlsym __P((ctlsym *Symbol));
extern void viewctldecl __P((ctldecl_list *Decl)); extern void viewctldecl __P((ctldecl_list *Decl));
extern void viewctlform __P((ctlform_list *Form)); extern void viewctlform __P((ctlform_list *Form));
extern void viewctltype __P((ctltype_list *Type));
extern void viewctlline __P((ctlline_list *Line)); extern void viewctlline __P((ctlline_list *Line));
# endif # endif

View File

@ -71,25 +71,10 @@
char *CTL_DECLAR_TYPE[ CTL_MAX_DECLAR_TYPE ] = char *CTL_DECLAR_TYPE[ CTL_MAX_DECLAR_TYPE ] =
{ {
"ALL", "ALL",
"PORT", "VARIABLE",
"SIGNAL",
"CONSTANT" "CONSTANT"
}; };
char *CTL_KIND_TYPE[ CTL_MAX_KIND_TYPE ] =
{
"NONE",
"BUS",
"REGISTER"
};
char *CTL_DIR_TYPE[ CTL_MAX_DIR_TYPE ] =
{
"IN",
"OUT",
"INOUT"
};
/*------------------------------------------------------------\ /*------------------------------------------------------------\
| | | |
| Functions | | Functions |
@ -133,12 +118,11 @@ ctlfig_list *addctlfig( Name )
| | | |
\------------------------------------------------------------*/ \------------------------------------------------------------*/
static ctldecl_list *loc_addctldecl( Figure, Expr, Type, Base ) static ctldecl_list *loc_addctldecl( Figure, Expr, Type )
ctlfig_list *Figure; ctlfig_list *Figure;
vexexpr *Expr; vexexpr *Expr;
unsigned char Type; unsigned char Type;
unsigned char Base;
{ {
ctldecl_list *Decl; ctldecl_list *Decl;
ctldecl_list **PrevDecl; ctldecl_list **PrevDecl;
@ -198,7 +182,6 @@ static ctldecl_list *loc_addctldecl( Figure, Expr, Type, Base )
Decl->VEX_ATOM = Expr; Decl->VEX_ATOM = Expr;
Decl->DECL_SYM = Sym; Decl->DECL_SYM = Sym;
Decl->TYPE = Type; Decl->TYPE = Type;
Decl->BASE = Base;
Decl->PREV = &Figure->DECLAR[ Type ]; Decl->PREV = &Figure->DECLAR[ Type ];
Decl->NEXT = *(Decl->PREV); Decl->NEXT = *(Decl->PREV);
@ -221,12 +204,11 @@ static ctldecl_list *loc_addctldecl( Figure, Expr, Type, Base )
| | | |
\------------------------------------------------------------*/ \------------------------------------------------------------*/
ctldecl_list *addctldecl( Figure, Atom, Type, Base ) ctldecl_list *addctldecl( Figure, Atom, Type )
ctlfig_list *Figure; ctlfig_list *Figure;
vexexpr *Atom; vexexpr *Atom;
unsigned char Type; unsigned char Type;
unsigned char Base;
{ {
ctldecl_list *Decl; ctldecl_list *Decl;
char *Name; char *Name;
@ -241,76 +223,38 @@ ctldecl_list *addctldecl( Figure, Atom, Type, Base )
ctlerror( CTL_DECLAR_EXIST_ERROR, Name, 0 ); ctlerror( CTL_DECLAR_EXIST_ERROR, Name, 0 );
} }
Decl = loc_addctldecl( Figure, Atom, Type, Base ); Decl = loc_addctldecl( Figure, Atom, Type );
return( Decl ); return( Decl );
} }
/*------------------------------------------------------------\ /*------------------------------------------------------------\
| | | |
| Ctl Add Declaration Port | | Ctl Add Declaration Variable |
| | | |
\------------------------------------------------------------*/ \------------------------------------------------------------*/
ctldecl_list *addctldeclport( Figure, Atom, Base, Dir, Kind ) ctldecl_list *addctldeclvar( Figure, Atom )
ctlfig_list *Figure; ctlfig_list *Figure;
vexexpr *Atom; vexexpr *Atom;
unsigned char Base;
unsigned char Dir;
unsigned char Kind;
{ {
ctldecl_list *Port; ctldecl_list *Constant;
char *Name; char *Name;
if ( ! IsVexNodeAtom( Atom ) ) Name = getvexarrayname( Atom ); if ( ! IsVexNodeAtom( Atom ) ) Name = getvexarrayname( Atom );
else Name = GetVexAtomValue( Atom ); else Name = GetVexAtomValue( Atom );
Port = searchctldeclall( Figure, Name ); Constant = searchctldeclall( Figure, Name );
if ( Port != (ctldecl_list *)0 ) if ( Constant != (ctldecl_list *)0 )
{ {
ctlerror( CTL_PORT_EXIST_ERROR, Name, 0 ); ctlerror( CTL_VARIABLE_EXIST_ERROR, Name, 0 );
} }
Port = loc_addctldecl( Figure, Atom, CTL_DECLAR_PORT, Base ); Constant = loc_addctldecl( Figure, Atom, CTL_DECLAR_CONSTANT );
Port->DIR = Dir;
Port->KIND = Kind;
return( Port ); return( Constant );
}
/*------------------------------------------------------------\
| |
| Ctl Add Declaration Signal |
| |
\------------------------------------------------------------*/
ctldecl_list *addctldeclsig( Figure, Atom, Base, Kind )
ctlfig_list *Figure;
vexexpr *Atom;
unsigned char Base;
unsigned char Kind;
{
ctldecl_list *Signal;
char *Name;
if ( ! IsVexNodeAtom( Atom ) ) Name = getvexarrayname( Atom );
else Name = GetVexAtomValue( Atom );
Signal = searchctldeclall( Figure, Name );
if ( Signal != (ctldecl_list *)0 )
{
ctlerror( CTL_SIGNAL_EXIST_ERROR, Name, 0 );
}
Signal = loc_addctldecl( Figure, Atom, CTL_DECLAR_SIGNAL, Base );
Signal->DIR = CTL_DIR_INOUT;
Signal->KIND = Kind;
return( Signal );
} }
/*------------------------------------------------------------\ /*------------------------------------------------------------\
@ -319,11 +263,10 @@ ctldecl_list *addctldeclsig( Figure, Atom, Base, Kind )
| | | |
\------------------------------------------------------------*/ \------------------------------------------------------------*/
ctldecl_list *addctldeclcst( Figure, Atom, Base ) ctldecl_list *addctldeclcst( Figure, Atom )
ctlfig_list *Figure; ctlfig_list *Figure;
vexexpr *Atom; vexexpr *Atom;
unsigned char Base;
{ {
ctldecl_list *Constant; ctldecl_list *Constant;
char *Name; char *Name;
@ -338,8 +281,7 @@ ctldecl_list *addctldeclcst( Figure, Atom, Base )
ctlerror( CTL_CONSTANT_EXIST_ERROR, Name, 0 ); ctlerror( CTL_CONSTANT_EXIST_ERROR, Name, 0 );
} }
Constant = loc_addctldecl( Figure, Atom, CTL_DECLAR_CONSTANT, Base ); Constant = loc_addctldecl( Figure, Atom, CTL_DECLAR_CONSTANT );
Constant->DIR = CTL_DIR_IN;
return( Constant ); return( Constant );
} }
@ -424,3 +366,25 @@ ctlform_list *addctlform( Figure, Name, Expr )
return( Form ); return( Form );
} }
/*------------------------------------------------------------\
| |
| Ctl Add Type |
| |
\------------------------------------------------------------*/
ctltype_list *addctltype( Figure, Name )
ctlfig_list *Figure;
char *Name;
{
ctltype_list *Type;
Type = allocctltype();
Type->NAME = namealloc( Name );;
Type->NEXT = Figure->TYPE;
Figure->TYPE = Type;
return( Type );
}

View File

@ -83,7 +83,7 @@ ctlfig_list *allocctlfig()
/*------------------------------------------------------------\ /*------------------------------------------------------------\
| | | |
| Ctl Alloc Process | | Ctl Alloc Form |
| | | |
\------------------------------------------------------------*/ \------------------------------------------------------------*/
@ -92,6 +92,17 @@ ctlform_list *allocctlform()
return( (ctlform_list *)autallocheap( sizeof( ctlform_list ) ) ); return( (ctlform_list *)autallocheap( sizeof( ctlform_list ) ) );
} }
/*------------------------------------------------------------\
| |
| Ctl Alloc Type |
| |
\------------------------------------------------------------*/
ctltype_list *allocctltype()
{
return( (ctltype_list *)autallocheap( sizeof( ctltype_list ) ) );
}
/*------------------------------------------------------------\ /*------------------------------------------------------------\
| | | |
| Ctl Alloc Symbol | | Ctl Alloc Symbol |

View File

@ -140,6 +140,7 @@ int delctlfig( Name )
ctlfig_list **Previous; ctlfig_list **Previous;
ctlform_list *ScanForm; ctlform_list *ScanForm;
ctldecl_list *ScanDecl; ctldecl_list *ScanDecl;
ctltype_list *ScanType;
void *Delete; void *Delete;
int Type; int Type;
@ -176,6 +177,18 @@ int delctlfig( Name )
freectlform( Delete ); freectlform( Delete );
} }
ScanType = Figure->TYPE;
while ( ScanType != (ctltype_list *)0 )
{
autfreeblock( ScanType->VALUE );
Delete = (void *)( ScanType );
ScanType = ScanType->NEXT;
freectltype( Delete );
}
for ( Type = 0; Type < CTL_MAX_DECLAR_TYPE; Type++ ) for ( Type = 0; Type < CTL_MAX_DECLAR_TYPE; Type++ )
{ {
ScanDecl = Figure->DECLAR[ Type ]; ScanDecl = Figure->DECLAR[ Type ];

View File

@ -94,63 +94,21 @@ void ctl_error( Error, Text1, Text2, File, Line )
switch( Error ) switch( Error )
{ {
case CTL_PROC_EXIST_ERROR :
fprintf( stderr, "process %s exists already\n", Text1 );
break;
case CTL_FUNC_EXIST_ERROR :
fprintf( stderr, "function %s exists already\n", Text1 );
break;
case CTL_PLACE_EXIST_ERROR :
fprintf( stderr, "place %s exists already\n", Text1 );
break;
case CTL_TRANS_EXIST_ERROR :
fprintf( stderr, "transition %s exists already\n", Text1 );
break;
case CTL_PORT_EXIST_ERROR :
fprintf( stderr, "port %s exists already\n", Text1 );
break;
case CTL_ARC_PLACE_EXIST_ERROR :
fprintf( stderr, "arc place %s to %s exists already\n", Text1, Text2 );
break;
case CTL_ARC_TRANS_EXIST_ERROR :
fprintf( stderr, "arc trans %s to %s exists already\n", Text1, Text2 );
break;
case CTL_UNKNOWN_DECLAR_TYPE : case CTL_UNKNOWN_DECLAR_TYPE :
fprintf( stderr, "unknown declar type %ld for %s\n", (long)Text1, Text2 ); fprintf( stderr, "unknown declar type %ld for %s\n", (long)Text1, Text2 );
break; break;
case CTL_SIGNAL_EXIST_ERROR :
fprintf( stderr, "signal %s exists already\n", Text1 );
break;
case CTL_VARIABLE_EXIST_ERROR : case CTL_VARIABLE_EXIST_ERROR :
fprintf( stderr, "variable %s exists already\n", Text1 ); fprintf( stderr, "variable %s exists already\n", Text1 );
break; break;
case CTL_DEFINE_EXIST_ERROR :
fprintf( stderr, "define %s exists already\n", Text1 );
break;
case CTL_ARGUMENT_EXIST_ERROR :
fprintf( stderr, "argument %s exists already\n", Text1 );
break;
case CTL_CONSTANT_EXIST_ERROR : case CTL_CONSTANT_EXIST_ERROR :
fprintf( stderr, "constant %s exists already\n", Text1 ); fprintf( stderr, "constant %s exists already\n", Text1 );
break; break;
case CTL_DEL_ARC_PLACE_ERROR :
fprintf( stderr, "unable to delete arc from place %s\n", Text1 );
break;
case CTL_DEL_ARC_TRANS_ERROR :
fprintf( stderr, "unable to delete arc from trans %s\n", Text1 );
break;
case CTL_TRANS_FATHER_UNKNOWN :
fprintf( stderr, "unknown father type %ld for transition %s\n", (long)Text1, Text2 );
break;
case CTL_DECLAR_EXIST_ERROR : case CTL_DECLAR_EXIST_ERROR :
fprintf( stderr, "symbol %s already declared\n", Text1 ); fprintf( stderr, "symbol %s already declared\n", Text1 );
break; break;
case CTL_BAD_DECLAR_TYPE : case CTL_BAD_DECLAR_TYPE :
fprintf( stderr, "bad declaration type %ld\n", (long)Text1 ); fprintf( stderr, "bad declaration type %ld\n", (long)Text1 );
break; break;
case CTL_BAD_ASSIGN_TYPE :
fprintf( stderr, "bad assign %s, type %ld\n", Text1, (long)Text2 );
break;
case CTL_UNDECLARED_SYMBOL : case CTL_UNDECLARED_SYMBOL :
fprintf( stderr, "undeclared symbol %s\n", Text1 ); fprintf( stderr, "undeclared symbol %s\n", Text1 );
break; break;
@ -160,15 +118,6 @@ void ctl_error( Error, Text1, Text2, File, Line )
case CTL_ILLEGAL_INDEX_ERROR : case CTL_ILLEGAL_INDEX_ERROR :
fprintf( stderr, "illegal index for symbol %s %ld\n", Text1, (long)Text2 ); fprintf( stderr, "illegal index for symbol %s %ld\n", Text1, (long)Text2 );
break; break;
case CTL_MOD_EXIST_ERROR :
fprintf( stderr, "model %s exists already\n", Text1 );
break;
case CTL_INS_EXIST_ERROR :
fprintf( stderr, "instance %s exists already\n", Text1 );
break;
case CTL_GENERIC_EXIST_ERROR :
fprintf( stderr, "generic %s exists already\n", Text1 );
break;
default : default :
fprintf( stderr, "unknown internal error %d !\n", Error ); fprintf( stderr, "unknown internal error %d !\n", Error );

View File

@ -52,31 +52,14 @@
| | | |
\------------------------------------------------------------*/ \------------------------------------------------------------*/
# define CTL_PLACE_EXIST_ERROR 0 # define CTL_VARIABLE_EXIST_ERROR 0
# define CTL_TRANS_EXIST_ERROR 1 # define CTL_CONSTANT_EXIST_ERROR 1
# define CTL_PORT_EXIST_ERROR 2 # define CTL_UNKNOWN_DECLAR_TYPE 2
# define CTL_ARC_PLACE_EXIST_ERROR 3 # define CTL_UNDECLARED_SYMBOL 3
# define CTL_ARC_TRANS_EXIST_ERROR 4 # define CTL_DECLAR_EXIST_ERROR 4
# define CTL_SIGNAL_EXIST_ERROR 6 # define CTL_BAD_DECLAR_TYPE 5
# define CTL_VARIABLE_EXIST_ERROR 7 # define CTL_ILLEGAL_INDEX_ERROR 6
# define CTL_DEFINE_EXIST_ERROR 8 # define CTL_ILLEGAL_POSITION_ERROR 7
# define CTL_CONSTANT_EXIST_ERROR 9
# define CTL_TRANS_FATHER_UNKNOWN 10
# define CTL_PROC_EXIST_ERROR 11
# define CTL_DEL_ARC_PLACE_ERROR 12
# define CTL_DEL_ARC_TRANS_ERROR 13
# define CTL_FUNC_EXIST_ERROR 14
# define CTL_UNKNOWN_DECLAR_TYPE 15
# define CTL_ARGUMENT_EXIST_ERROR 16
# define CTL_UNDECLARED_SYMBOL 17
# define CTL_DECLAR_EXIST_ERROR 18
# define CTL_BAD_DECLAR_TYPE 19
# define CTL_BAD_ASSIGN_TYPE 20
# define CTL_ILLEGAL_INDEX_ERROR 21
# define CTL_ILLEGAL_POSITION_ERROR 22
# define CTL_INS_EXIST_ERROR 23
# define CTL_MOD_EXIST_ERROR 24
# define CTL_GENERIC_EXIST_ERROR 25
/*------------------------------------------------------------\ /*------------------------------------------------------------\
| | | |

View File

@ -103,6 +103,19 @@ void freectlform( Form )
autfreeheap( (char *)Form, sizeof( ctlform_list )); autfreeheap( (char *)Form, sizeof( ctlform_list ));
} }
/*------------------------------------------------------------\
| |
| Ctl Free Type |
| |
\------------------------------------------------------------*/
void freectltype( Type )
ctltype_list *Type;
{
autfreeheap( (char *)Type, sizeof( ctltype_list ));
}
/*------------------------------------------------------------\ /*------------------------------------------------------------\
| | | |
| Ctl Free Symbol | | Ctl Free Symbol |

View File

@ -171,15 +171,6 @@ void viewctldecl( Decl )
viewctlsym( &DeclSym[ Scan ] ); viewctlsym( &DeclSym[ Scan ] );
} }
if ( Decl->DIR >= CTL_MAX_DIR_TYPE )
{
fprintf( stdout, "\n\t\tDIR : %d", (int)Decl->DIR );
}
else
{
fprintf( stdout, "\n\t\tDIR : %s", CTL_DIR_TYPE[ Decl->DIR ] );
}
if ( Decl->TYPE >= CTL_MAX_DECLAR_TYPE ) if ( Decl->TYPE >= CTL_MAX_DECLAR_TYPE )
{ {
fprintf( stdout, "\n\t\tTYPE : %d", Decl->TYPE ); fprintf( stdout, "\n\t\tTYPE : %d", Decl->TYPE );
@ -189,36 +180,39 @@ void viewctldecl( Decl )
fprintf( stdout, "\n\t\tTYPE : %s", CTL_DECLAR_TYPE[ Decl->TYPE ] ); fprintf( stdout, "\n\t\tTYPE : %s", CTL_DECLAR_TYPE[ Decl->TYPE ] );
} }
if ( Decl->BASE >= VEX_MAX_TYPE )
{
fprintf( stdout, "\n\t\tBASE : %d", Decl->BASE );
}
else
{
fprintf( stdout, "\n\t\tBASE : %s", VEX_TYPE_NAME[ Decl->BASE ] );
}
if ( Decl->KIND >= CTL_MAX_KIND_TYPE )
{
fprintf( stdout, "\n\t\tKIND : %d", Decl->KIND );
}
else
{
fprintf( stdout, "\n\t\tKIND : %s", CTL_KIND_TYPE[ Decl->KIND ] );
}
fprintf( stdout, "\n\t\tFLAGS : %lx", Decl->FLAGS ); fprintf( stdout, "\n\t\tFLAGS : %lx", Decl->FLAGS );
fprintf( stdout, "\n\t\tUSER : %lx", (long)Decl->USER ); fprintf( stdout, "\n\t\tUSER : %lx", (long)Decl->USER );
fprintf( stdout, "\n<-- Declaration" ); fprintf( stdout, "\n<-- Declaration" );
} }
/*------------------------------------------------------------\
| |
| Ctl View Type |
| |
\------------------------------------------------------------*/
void viewctltype( Type )
ctltype_list *Type;
{
fprintf( stdout, "\n--> Type" );
viewctlline( Type->LINE );
fprintf( stdout, "\n\t\tNAME : %s", Type->NAME );
fprintf( stdout, "\n\t\tFLAGS : %lx", Type->FLAGS );
fprintf( stdout, "\n\t\tUSER : %lx", (long)Type->USER );
fprintf( stdout, "\n<-- Type" );
}
/*------------------------------------------------------------\ /*------------------------------------------------------------\
| | | |
| Ctl View Form | | Ctl View Form |
| | | |
\------------------------------------------------------------*/ \------------------------------------------------------------*/
void viewctlact( Form ) void viewctlform( Form )
ctlform_list *Form; ctlform_list *Form;
{ {
@ -252,18 +246,28 @@ void viewctlfig( Figure )
ctlfig_list *Figure; ctlfig_list *Figure;
{ {
ctltype_list *Type;
ctlform_list *Form; ctlform_list *Form;
ctldecl_list *Decl; ctldecl_list *Decl;
int Type; int Index;
fprintf( stdout, "\n--> Figure" ); fprintf( stdout, "\n--> Figure" );
fprintf( stdout, "\n\tNAME : %s", Figure->NAME ); fprintf( stdout, "\n\tNAME : %s", Figure->NAME );
for ( Type = 0; Type < CTL_MAX_DECLAR_TYPE; Type++ ) fprintf( stdout, "\n\tTYPE : " );
{
fprintf( stdout, "\n\tDECLARATION %s : ", CTL_DECLAR_TYPE[ Type ] );
for ( Decl = Figure->DECLAR[ Type ]; for ( Type = Figure->TYPE;
Type != (ctltype_list *)0;
Type = Type->NEXT )
{
viewctltype( Type );
}
for ( Index = 0; Index < CTL_MAX_DECLAR_TYPE; Index++ )
{
fprintf( stdout, "\n\tDECLARATION %s : ", CTL_DECLAR_TYPE[ Index ] );
for ( Decl = Figure->DECLAR[ Index ];
Decl != (ctldecl_list *)0; Decl != (ctldecl_list *)0;
Decl = Decl->NEXT ) Decl = Decl->NEXT )
{ {