Recovered from cvs revision 2007-09-05 07:02:00

This commit is contained in:
hyung-hwan 2007-09-05 23:42:00 +00:00
parent c5a9522b59
commit 3b147b3ebd

View File

@ -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_ #ifndef _ASE_AWK_AWK_HPP_
@ -11,7 +11,9 @@
namespace ASE namespace ASE
{ {
/**
* the awk class
*/
class Awk class Awk
{ {
public: public:
@ -30,13 +32,20 @@ namespace ASE
typedef ase_awk_run_t run_t; typedef ase_awk_run_t run_t;
typedef ase_awk_t awk_t; typedef ase_awk_t awk_t;
/**
* The source class
* @see openSource
*/
class Source class Source
{ {
public: public:
/**
* Indicates the mode of the source code I/O
*/
enum Mode enum Mode
{ {
READ, READ, /**< readable I/O */
WRITE WRITE /**< writable I/O */
}; };
Source (Mode mode); Source (Mode mode);
@ -50,6 +59,9 @@ namespace ASE
void* handle; void* handle;
}; };
/**
* Extio class
*/
class Extio class Extio
{ {
protected: protected:
@ -64,6 +76,9 @@ namespace ASE
extio_t* extio; extio_t* extio;
}; };
/**
* Pipe
*/
class Pipe: public Extio class Pipe: public Extio
{ {
public: public:
@ -82,6 +97,9 @@ namespace ASE
Mode getMode () const; Mode getMode () const;
}; };
/**
* File
*/
class File: public Extio class File: public Extio
{ {
public: public:
@ -101,6 +119,9 @@ namespace ASE
Mode getMode () const; Mode getMode () const;
}; };
/**
* Console
*/
class Console: public Extio class Console: public Extio
{ {
public: public:
@ -124,6 +145,9 @@ namespace ASE
char_t* filename; char_t* filename;
}; };
/**
* Argument
*/
class Argument class Argument
{ {
protected: protected:
@ -172,6 +196,9 @@ namespace ASE
} str; } str;
}; };
/**
* Return
*/
class Return class Return
{ {
protected: protected:
@ -205,6 +232,10 @@ namespace ASE
} v; } v;
}; };
/**
* ErrorCode
*/
// generated by generrcode.awk // generated by generrcode.awk
enum ErrorCode enum ErrorCode
{ {
@ -337,6 +368,10 @@ namespace ASE
}; };
// end of enum ErrorCode // end of enum ErrorCode
/**
* Option
*/
// generated by genoptcode.awk // generated by genoptcode.awk
enum Option enum Option
{ {
@ -358,6 +393,9 @@ namespace ASE
}; };
// end of enum Option // end of enum Option
/**
* Run
*/
class Run class Run
{ {
protected: protected:
@ -378,7 +416,6 @@ namespace ASE
bool callbackFailed; bool callbackFailed;
}; };
Awk (); Awk ();
virtual ~Awk (); virtual ~Awk ();
@ -427,7 +464,14 @@ namespace ASE
virtual int unsetWord (const char_t* ow, ase_size_t owl); virtual int unsetWord (const char_t* ow, ase_size_t owl);
virtual int unsetAllWords (); virtual int unsetAllWords ();
/**
* parses the source code
*/
virtual int parse (); virtual int parse ();
/**
* executes the parse tree
*/
virtual int run (const char_t* main = ASE_NULL, virtual int run (const char_t* main = ASE_NULL,
const char_t** args = ASE_NULL, size_t nargs = 0); 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); run_t* run, const char_t* name, size_t len);
// source code io handlers // source code io handlers
/**
* openSource
*/
virtual int openSource (Source& io) = 0; virtual int openSource (Source& io) = 0;
virtual int closeSource (Source& io) = 0; virtual int closeSource (Source& io) = 0;
virtual ssize_t readSource (Source& io, char_t* buf, size_t len) = 0; virtual ssize_t readSource (Source& io, char_t* buf, size_t len) = 0;