[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.5 Invoking getdefs

If no input argument is provided or is set to simply "-", and if stdin is not a tty, then the list of input files will be read from stdin. This program extracts AutoGen definitions from a list of source files. Definitions are delimited by `/*=<entry-type> <entry-name>\n' and `=*/\n'. From that, this program creates a definition of the following form:

 
    #line nnn "source-file-name"
    entry_type = {
        name = entry_name;
        ...
    };

The ellipsis "..." is filled in by text found between the two delimiters, using the following rules:

  1. Each entry is located by the pattern "\n[^*\n]*\\*[ \t]*([a-z][a-z0-9_]*):". Fundamentally, it finds a line that, after the first asterisk on the line, contains whitespace then a name and is immediately followed by a colon. The name becomes the name of the attribute and what follows, up to the next attribute, is its value.
  2. If the first character of the value is either a single or double quote, then you are responsible for quoting the text as it gets inserted into the output definitions.
  3. All the leading text on a line is stripped from the value. The leading text is everything before the first asterisk, the asterisk and all the whitespace characters that immediately follow it. If you want whitespace at the beginnings of the lines of text, you must do something like this:

     
     * mumble:
     * "  this is some\n"
     * "  indented text."
    

  4. If the `<entry-name>' is followed by a comma, the word `ifdef' (or 'ifndef') and a name `if_name', then the above entry will appear as:

     
    #ifdef if_name
    #line nnn "source-file-name"
    entry_type = {
        name = entry_name;
        ...
    };
    #endif
    

  5. If you use of the subblock option, you can specify a nested value, See section 8.5.6 subblock option. That is, this text:

     
     * arg:  int, this, what-it-is
    

    with the `--subblock=arg=type,name,doc' option would yield:

     
    arg = { type = int; name = this; doc = what-it-is; };
    

This section was generated by AutoGen, the aginfo template and the option descriptions for the getdefs program. It documents the getdefs usage text and option meanings.

This software is released under the GNU General Public License.

8.5.1 getdefs usage help  
8.5.17 agarg option  
8.5.9 assign option  
8.5.15 autogen option  
8.5.18 base-name option  
8.5.10 common-assign option  
8.5.11 copy option  
8.5.2 defs-to-get option  
8.5.8 filelist option  
8.5.4 first-index option  
8.5.5 input option  
8.5.13 linenum option  
8.5.7 listattr option  
8.5.3 ordering option  
8.5.14 output option  
8.5.12 srcfile option  
8.5.6 subblock option  
8.5.16 template option  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Bruce Korb on June 4, 2003 using texi2html

Viewable With Any Browser   AutoGen Home