Skip to content

Commit

Permalink
documentation update (CVS 224)
Browse files Browse the repository at this point in the history
  • Loading branch information
D. Richard Hipp committed Jun 8, 2001
1 parent d255bf7 commit a7b6158
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
38 changes: 35 additions & 3 deletions doc/lemon.html
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,9 @@ <h3>Special Directives</h3>

<p>Lemon supports the following special directives:
<ul>
<li><tt>%code</tt>
<li><tt>%default_destructor</tt>
<li><tt>%default_type</tt>
<li><tt>%destructor</tt>
<li><tt>%extra_argument</tt>
<li><tt>%include</tt>
Expand All @@ -536,6 +539,35 @@ <h3>Special Directives</h3>
Each of these directives will be described separately in the
following sections:</p>

<h4>The <tt>%code</tt> directive</h4>

<p>The %code directive is used to specify addition C/C++ code that
is added to the end of the main output file. This is similar to
the %include directive except that %include is inserted at the
beginning of the main output file.</p>

<p>%code is typically used to include some action routines or perhaps
a tokenizer as part of the output file.</p>

<h4>The <tt>%default_destructor</tt> directive</h4>

<p>The %default_destructor directive specifies a destructor to
use for non-terminals that do not have their own destructor
specified by a separate %destructor directive. See the documentation
on the %destructor directive below for additional information.</p>

<p>In some grammers, many different non-terminal symbols have the
same datatype and hence the same destructor. This directive is
a convenience way to specify the same destructor for all those
non-terminals using a single statement.</p>

<h4>The <tt>%default_type</tt> directive</h4>

<p>The %default_type directive specifies the datatype of non-terminal
symbols that do no have their own datatype defined using a separate
%type directive. See the documentation on %type below for addition
information.</p>

<h4>The <tt>%destructor</tt> directive</h4>

<p>The %destructor directive is used to specify a destructor for
Expand Down Expand Up @@ -607,9 +639,9 @@ <h4>The <tt>%include</tt> directive</h4>

<p>The %include directive specifies C code that is included at the
top of the generated parser. You can include any text you want --
the Lemon parser generator copies to blindly. If you have multiple
%include directives in your grammar file, their values are concatenated
before being put at the beginning of the generated parser.</p>
the Lemon parser generator copies it blindly. If you have multiple
%include directives in your grammar file the value of the last
%include directive overwrites all the others.</p.

<p>The %include directive is very handy for getting some extra #include
preprocessor statements at the beginning of the generated parser.
Expand Down
2 changes: 1 addition & 1 deletion notes/notes3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Secondary access routines:
int sqlite_table(sqlite*, int *nrow, int *ncolumn, const char ***argv);
void sqlite_busy_handler(sqlite*, int(*)(void*,const char*,int), void*);

Access routines that are implement derived from primary and sec
Access routines that are derived from primary and secondary:

char *sqlite_mprintf(const char *zFormat, ...);
int sqlite_compile_vprintf(sqlite*, const char *zFormat, va_list);
Expand Down

0 comments on commit a7b6158

Please sign in to comment.