[ADMB Users] ADMB keywords

Arni Magnusson arnima at hafro.is
Tue Apr 20 08:23:23 PDT 2010


The La Jolla report 
(http://admb-project.org/community/admb-meeting-march-29-31/ADMBMeetingReportv3.pdf/at_download/file, 
page 1) mentions a list of commonly used functions and other keywords used 
in ADMB models.

I have just uploaded this list to the ADMB Project website 
(http://admb-project.org/documentation/api/keywords.txt/view), as well as 
the R function used to generate the list 
(http://admb-project.org/documentation/api/getKeywords.R/at_download/file).

The original purpose of this list is to highlight code in Emacs admb-mode, 
and later in ADMB-IDE. Whenever I see a new ADMB model, I open it in Emacs 
and check that functions, variable types, etc. are properly highlighted. 
The same list can serve other purposes:

1. Doxygen documentation 
(http://admb-project.org/documentation/draft-api-documentation) should 
probably focus on these keywords to start with, since they are the most 
likely to be looked up by users.

2. Other documentation (manuals, reference sheets, etc.) should list those 
functions, variable types, etc. They already do in most cases, but not 
all.

3. Other editors can use the same list for highlighting ADMB syntax.

Any feedback on the keyword list and syntax highlighting is appreciated. 
Ian Taylor once mentioned that an XML keyword list would be useful, on 
which all editors could base their syntax highlighting. The combination of 
admb.el and getKeywords.R can probably serve that purpose.

---

That is the top-down approach, based on available ADMB models. The 
bottom-up approach is also worth considering, sifting keywords from 
admb/include/fvar.hpp, admb/include/admodel.h, and the like.

Some users are already following the bottom-up approach. A colleague of 
mine needed a 3d array of integers in his ADMB model the other day, and 
asked me if the i3_array class is intended for users. He also wanted to 
know if it can be declared in the DATA_SECTION, or if it must be declared 
in the GLOBALS_SECTION to make it available to functions. I told him I 
didn't know. The i3_array is mentioned in the MULTIFAN manual, but not in 
the ADMB or AUTODIF manuals.

At any rate, the admb.el keyword list will continue to grow, and may 
benefit from some restructuring, or improving the somewhat arbitrary 
labels and grouping. The goal was to apply colors to improve code 
legibility, rather than analyzing the language. The result is a hodgepodge 
of C, C++, AUTODIF, ADMB, and ADMB-RE, but I avoided getting into compiler 
specifics.

Arni



More information about the Users mailing list