qse/ase/doc/awk-en.man

66 lines
1.8 KiB
Groff
Raw Normal View History

2007-02-14 09:25:02 +00:00
.title ASEAWK
== ASEAWK ==
2007-02-20 05:40:11 +00:00
ASE provides an embeddable processor of a dialect of the AWK programming language. The language implemented is slightly different from {the version developed by Brian W. Kernighan, http://cm.bell-labs.com/cm/cs/awkbook/index.html} and has been adjusted to the author's preference.
2007-02-14 09:25:02 +00:00
2007-02-20 05:40:11 +00:00
Embedding a processor requires the following basic steps.
2007-02-14 09:25:02 +00:00
2007-02-17 15:00:25 +00:00
[[[
2007-02-20 05:40:11 +00:00
* Create a processor instance
* Parse an AWK script
* Run the script parsed
* Destroy the instance
2007-02-17 15:00:25 +00:00
]]]
2007-02-20 05:40:11 +00:00
The following code fragment illustrates the basic steps.
2007-02-17 15:00:25 +00:00
{{{
2007-02-20 05:40:11 +00:00
1) #include <ase/awk/awk.h>
2) ase_awk_t* awk;
3) awk = ase_awk_open (...);
4) if (ase_awk_parse (awk, ...) == -1)
{
/* parse error */
}
else
{
5) if (ase_awk_run (awk, ...) == -1)
{
/* run-time error */
}
}
6) ase_awk_close (awk);
2007-02-17 15:00:25 +00:00
}}}
2007-02-20 05:40:11 +00:00
(((
* Most of the functions and data types needed are defined in the header file <ase/awk/awk.h>.
2007-02-20 14:09:44 +00:00
* ase_awk_t represents the processor. However, the internal representation is not exposed.
2007-02-20 05:40:11 +00:00
* ase_awk_open creates the processor instance.
* ase_awk_parse parses an AWK script.
* ase_awk_run executes the script parsed.
* ase_awk_close destroys the processor instance.
)))
2007-02-17 15:00:25 +00:00
=== Primitive Functions ===
ase_awk_open requires a set of primitive functions to be passed. This set include pointers to the system primitive functions for system dependent operation such as memory allocation, string formatting, etc.
=== Source IO Handler ===
ase_awk_srcio_t
The source code is read in with the source input handler provided.
The optional source output handler writes the generated source code.
=== External IO Handler ===
ase_awk_extio_t
External IO handlers should be provided to support the AWK's built-in IO facilities.
=== Reference Manual ===
2007-02-14 09:25:02 +00:00
[[[
* {Reference Manual,awk-ref-en.html}
]]]