Hi,
Andrew Johnson wrote:
> Heinrich du Toit wrote:
>>
>> Is there 'n lexical analyzer for .db files?
>>
>> I guess there must be something in epics BASE somewhere?
>> But is it written in something like flex that can easily be
>> extended/used or is it some custom code nightmare?
>
> The IOC's parser is written in flex and antelope (BSD-licensed versions
> of lex and yacc), the code for which you can find in base/src/dbStatic.
> Note that you need to parse a DBD file (to define the record types,
> fields, menu selections etc.) before you can completely understand a DB
> file.
>
> However rather than directly grabbing and trying to use our lex and yacc
> files I would strongly recommend that you make use of the dbStaticLib
> library API which permits you to load, manipulate and save DBD and DB
> files; if you stick with the dbStatic API (documented in Chapter 14 of
> the EPICS IOC Application Developer's Guide) you're more protected
> against future changes to the syntax of the DB and DBD files.
I agree with Andrew's comment.
>
> It is also relatively easy to write a DB file parser in modern scripting
> languages such as Perl and Python, but it is also easy to omit some
> obscure pieces of the syntax. You should be aware that future major
> releases of Base will probably replace the 'C' dbStatic library with
> tools written in Perl (which will have a similar Perl library for
> manipulating the underlying data).
I wrote a simple SWIG interface module for Python.
It bridges dbStaticLib and Python. And add some python code to access to
the database easier.
You can find it at:
http://www-acc.kek.jp/EPICS_Gr/products.html
>
> HTH,
>
> - Andrew
Regards,
Noboru Yamamoto
J-pARC control group/EPICS group
J-PARC Center/KEK, JAPAN
begin:vcard
fn:Noboru Yamamoto
n:Yamamoto;Noboru
email;internet:[email protected]
tel;work:+81-29-864-1171, ext. 5209
tel;fax:+81-29-879-6130
x-mozilla-html:FALSE
version:2.1
end:vcard
- References:
- lexical analyzer for .db? Heinrich du Toit
- Re: lexical analyzer for .db? Andrew Johnson
- Navigate by Date:
- Prev:
RE: webca compile on win32 Purcell, J. David
- Next:
Re: lexical analyzer for .db? Heinrich du Toit
- Index:
1994
1995
1996
1997
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: lexical analyzer for .db? Andrew Johnson
- Next:
Re: lexical analyzer for .db? Heinrich du Toit
- Index:
1994
1995
1996
1997
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
|