From 3b147b3ebd1faca60a8ee3a06c2afa633195ee10 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Wed, 5 Sep 2007 23:42:00 +0000 Subject: [PATCH] Recovered from cvs revision 2007-09-05 07:02:00 --- ase/awk/Awk.hpp | 57 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/ase/awk/Awk.hpp b/ase/awk/Awk.hpp index 5bcc75de..f0670af7 100644 --- a/ase/awk/Awk.hpp +++ b/ase/awk/Awk.hpp @@ -1,5 +1,5 @@ /* - * $Id: Awk.hpp,v 1.49 2007/08/26 14:33:38 bacon Exp $ + * $Id: Awk.hpp,v 1.50 2007/09/04 08:01:46 bacon Exp $ */ #ifndef _ASE_AWK_AWK_HPP_ @@ -11,7 +11,9 @@ namespace ASE { - + /** + * the awk class + */ class Awk { public: @@ -30,13 +32,20 @@ namespace ASE typedef ase_awk_run_t run_t; typedef ase_awk_t awk_t; + /** + * The source class + * @see openSource + */ class Source { public: + /** + * Indicates the mode of the source code I/O + */ enum Mode { - READ, - WRITE + READ, /**< readable I/O */ + WRITE /**< writable I/O */ }; Source (Mode mode); @@ -50,6 +59,9 @@ namespace ASE void* handle; }; + /** + * Extio class + */ class Extio { protected: @@ -64,6 +76,9 @@ namespace ASE extio_t* extio; }; + /** + * Pipe + */ class Pipe: public Extio { public: @@ -82,6 +97,9 @@ namespace ASE Mode getMode () const; }; + /** + * File + */ class File: public Extio { public: @@ -101,6 +119,9 @@ namespace ASE Mode getMode () const; }; + /** + * Console + */ class Console: public Extio { public: @@ -124,6 +145,9 @@ namespace ASE char_t* filename; }; + /** + * Argument + */ class Argument { protected: @@ -172,6 +196,9 @@ namespace ASE } str; }; + /** + * Return + */ class Return { protected: @@ -205,6 +232,10 @@ namespace ASE } v; }; + /** + * ErrorCode + */ + // generated by generrcode.awk enum ErrorCode { @@ -337,6 +368,10 @@ namespace ASE }; // end of enum ErrorCode + /** + * Option + */ + // generated by genoptcode.awk enum Option { @@ -358,6 +393,9 @@ namespace ASE }; // end of enum Option + /** + * Run + */ class Run { protected: @@ -378,7 +416,6 @@ namespace ASE bool callbackFailed; }; - Awk (); virtual ~Awk (); @@ -427,7 +464,14 @@ namespace ASE virtual int unsetWord (const char_t* ow, ase_size_t owl); virtual int unsetAllWords (); + /** + * parses the source code + */ virtual int parse (); + + /** + * executes the parse tree + */ virtual int run (const char_t* main = ASE_NULL, const char_t** args = ASE_NULL, size_t nargs = 0); @@ -448,6 +492,9 @@ namespace ASE run_t* run, const char_t* name, size_t len); // source code io handlers + /** + * openSource + */ virtual int openSource (Source& io) = 0; virtual int closeSource (Source& io) = 0; virtual ssize_t readSource (Source& io, char_t* buf, size_t len) = 0;