EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  <19961997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  <19961997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: macro substitution (forwarded from Marty)
From: [email protected] (William Lupton)
To: [email protected]
Date: Tue, 13 Feb 96 08:15:12 HST
----- Begin Included Message -----

>From [email protected] Tue Feb 13 04:23:21 1996
From: [email protected] (Marty Kraimer)
To: [email protected]
Subject: Re: macro substitution
Content-Md5: xK+VFpXLUHFBcY+p5koSMQ==
X-Status: 
Status: O

> 
> c) long macRead ( MAC_HANDLE  handle, char *name, long maxlen, char *value );
> 

This is picky but I think the maxlen argument should follow value.

> 
> d) long macWrite( MAC_HANDLE  handle, char *name, char *value );
> 

This is a general comment.
What are rules for allocating storage?
How does macClose know what it can free?
As an example should maxWrite alloc and copy value or just copy
pointer value? If it just copies pointer value who frees storage for value?

> 
> g) long macSubst( MAC_HANDLE handle, char *src, long maxlen, char *dest );

Again I suggest maxlen should follow dest.


> 2. Macro substitution tool
> --------------------------


>    I also favor going with make syntax rather than shell syntax. I would
>    also imagine that supporting $(fred:%=%.o) type pattern operators might
>    be useful in the future, and these can be modeled on make too. Similarly
>    other built-in macros.


Why are we defining this tool? For what will it be used?
If such a tool is defined I would vote for shell rather than make syntax.
I think we made a mistake using $() instead of ${} for macros (too late now).
I am very wary about such a tool for use on vxWorks.


Jim and I had a discussion about how dbLoadDatabase (new version
of dbLoadAscii), dbLoadRecords, and dbLoadTemplates should be
combined. Our aim is to avoid multiple parsers (lex/yacc) that
do very similar things. This means that dbLoadDatabase and dbLoadRecords
should be combined. dbLoadTempates has a completely different syntax
thus it should remain separate.

Another issue is performance on vxWorks. dbLoadRecords and dbLoadTemplates
are used to load thousands of records into a single ioc. In addition
dbLoadTemplates is used to instantiate hundreds of instances of a
template.


A last point. dbLoadDatabase supports a path statement consisting
of a list of colon separated directory names. Thus for macro substitution
it wants to be in change of file I/O. What I want to be able to do is:

1) read a new line
2) have optional macro substitution be performed on the line
3) pass the line to lex/yacc


I think that the proposed macLib facility will satisfy this requirement


Then dbLoadRecords, dbLoadDatabase will be replaced by the
set of routines something like the following

dbLoadDatabase(char *filename,char *substitution)
dbLoadDatabaseFP(FILE *fp,char *substitution)
dbLoadDatabaseFPpairs(FILE *fp,char *pairs[],int npairs);

Only the last routine will be the actual lex/yacc parser.

With this arrangement dbLoadTemplates can call either 
dbLoaddatabaseFP or dbLoadDatabaseFPpairs.

Still needs thought.

Marty Kraimer

----- End Included Message -----


Navigate by Date:
Prev: PACT -> SDIS Ian Smith
Next: Re: macro substitution William Lupton
Index: 1994  1995  <19961997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: PACT -> SDIS Tim Mooney
Next: Allen Bradley Driver Marty Kraimer
Index: 1994  1995  <19961997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·