2007-05-17 00:14:00 +00:00
|
|
|
/*
|
2007-09-07 23:14:00 +00:00
|
|
|
* $Id: Awk.hpp,v 1.21 2007/09/06 08:44:42 bacon Exp $
|
2007-05-17 00:14:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <ase/awk/Awk.hpp>
|
2007-08-20 23:27:00 +00:00
|
|
|
#include <vcclr.h>
|
2007-05-17 00:14:00 +00:00
|
|
|
|
|
|
|
namespace ASE
|
|
|
|
{
|
2007-08-20 23:27:00 +00:00
|
|
|
class MojoAwk;
|
|
|
|
|
2007-07-16 20:16:00 +00:00
|
|
|
namespace Net
|
2007-05-17 00:14:00 +00:00
|
|
|
{
|
|
|
|
public ref class Awk abstract
|
|
|
|
{
|
|
|
|
public:
|
2007-08-20 23:27:00 +00:00
|
|
|
typedef ASE::Awk::long_t long_t;
|
|
|
|
typedef ASE::Awk::real_t real_t;
|
|
|
|
typedef ASE::Awk::char_t char_t;
|
|
|
|
typedef ASE::Awk::size_t size_t;
|
2007-08-22 22:56:00 +00:00
|
|
|
typedef ASE::Awk::ssize_t ssize_t;
|
|
|
|
typedef ASE::Awk::cint_t cint_t;
|
|
|
|
typedef ASE::Awk::bool_t bool_t;
|
2007-08-20 23:27:00 +00:00
|
|
|
|
|
|
|
ref class Argument
|
|
|
|
{
|
|
|
|
public protected:
|
2007-08-21 23:24:00 +00:00
|
|
|
Argument (const ASE::Awk::Argument& arg): arg(arg)
|
2007-08-20 23:27:00 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2007-08-21 23:24:00 +00:00
|
|
|
property long_t LongValue
|
|
|
|
{
|
|
|
|
long_t get () { return arg.toInt(); }
|
|
|
|
}
|
|
|
|
|
|
|
|
property real_t RealValue
|
|
|
|
{
|
|
|
|
real_t get () { return arg.toReal(); }
|
|
|
|
}
|
|
|
|
|
|
|
|
property System::String^ StringValue
|
|
|
|
{
|
|
|
|
System::String^ get ()
|
|
|
|
{
|
|
|
|
size_t len;
|
|
|
|
const char_t* s = arg.toStr(&len);
|
|
|
|
return gcnew System::String (s, 0, len);
|
|
|
|
}
|
|
|
|
}
|
2007-08-20 23:27:00 +00:00
|
|
|
|
|
|
|
protected:
|
2007-08-21 23:24:00 +00:00
|
|
|
const ASE::Awk::Argument& arg;
|
2007-08-20 23:27:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
ref class Return
|
|
|
|
{
|
|
|
|
public protected:
|
|
|
|
Return (ASE::Awk::Return& ret): ret (ret)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-08-21 23:24:00 +00:00
|
|
|
public:
|
|
|
|
property System::String^ StringValue
|
2007-08-20 23:27:00 +00:00
|
|
|
{
|
|
|
|
void set (System::String^ v)
|
|
|
|
{
|
|
|
|
cli::pin_ptr<const char_t> nptr = PtrToStringChars(v);
|
|
|
|
ret.set (nptr, v->Length);
|
|
|
|
}
|
2007-08-21 23:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
property long_t LongValue
|
|
|
|
{
|
|
|
|
void set (long_t v)
|
|
|
|
{
|
|
|
|
ret.set (v);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
property real_t RealValue
|
|
|
|
{
|
|
|
|
void set (real_t v)
|
|
|
|
{
|
|
|
|
ret.set (v);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
property System::Single^ SingleValue
|
|
|
|
{
|
2007-08-20 23:27:00 +00:00
|
|
|
void set (System::Single^ v)
|
|
|
|
{
|
|
|
|
ret.set ((real_t)(float)v);
|
|
|
|
}
|
2007-08-21 23:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
property System::Double^ DoubleValue
|
|
|
|
{
|
2007-08-20 23:27:00 +00:00
|
|
|
void set (System::Double^ v)
|
|
|
|
{
|
|
|
|
ret.set ((real_t)(double)v);
|
|
|
|
}
|
|
|
|
}
|
2007-08-21 23:24:00 +00:00
|
|
|
|
|
|
|
property System::SByte^ SByteValue
|
|
|
|
{
|
|
|
|
void set (System::SByte^ v)
|
|
|
|
{
|
|
|
|
ret.set ((long_t)(__int8)v);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
property System::Int16^ Int16Value
|
|
|
|
{
|
|
|
|
void set (System::Int16^ v)
|
|
|
|
{
|
|
|
|
ret.set ((long_t)(__int16)v);
|
|
|
|
}
|
|
|
|
}
|
2007-08-20 23:27:00 +00:00
|
|
|
|
2007-08-21 23:24:00 +00:00
|
|
|
property System::Int32^ Int32Value
|
|
|
|
{
|
|
|
|
void set (System::Int32^ v)
|
|
|
|
{
|
|
|
|
ret.set ((long_t)(__int32)v);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
property System::Int64^ Int64Value
|
|
|
|
{
|
|
|
|
void set (System::Int64^ v)
|
|
|
|
{
|
|
|
|
ret.set ((long_t)(__int64)v);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
property System::Byte^ ByteValue
|
|
|
|
{
|
|
|
|
void set (System::Byte^ v)
|
|
|
|
{
|
|
|
|
ret.set ((long_t)(unsigned __int8)v);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
property System::UInt16^ UInt16Value
|
|
|
|
{
|
|
|
|
void set (System::UInt16^ v)
|
|
|
|
{
|
|
|
|
ret.set ((long_t)(unsigned __int16)v);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
property System::UInt32^ UInt32Value
|
|
|
|
{
|
|
|
|
void set (System::UInt32^ v)
|
|
|
|
{
|
|
|
|
ret.set ((long_t)(unsigned __int32)v);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
property System::UInt64^ UInt64Value
|
|
|
|
{
|
|
|
|
void set (System::UInt64^ v)
|
|
|
|
{
|
|
|
|
ret.set ((long_t)(unsigned __int64)v);
|
|
|
|
}
|
|
|
|
}
|
2007-08-20 23:27:00 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
ASE::Awk::Return& ret;
|
|
|
|
};
|
|
|
|
|
2007-05-17 00:14:00 +00:00
|
|
|
ref class Source
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum class MODE
|
|
|
|
{
|
|
|
|
READ = ASE::Awk::Source::READ,
|
|
|
|
WRITE = ASE::Awk::Source::WRITE
|
|
|
|
};
|
|
|
|
|
2007-08-04 00:58:00 +00:00
|
|
|
Source (MODE^ mode): handle (nullptr)
|
|
|
|
{
|
|
|
|
this->mode = mode;
|
|
|
|
}
|
|
|
|
|
|
|
|
property Object^ Handle
|
|
|
|
{
|
|
|
|
Object^ get () { return this->handle; }
|
|
|
|
void set (Object^ handle) { this->handle = handle; }
|
|
|
|
}
|
|
|
|
|
2007-05-17 00:14:00 +00:00
|
|
|
property MODE^ Mode
|
|
|
|
{
|
|
|
|
MODE^ get () { return this->mode; }
|
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
|
|
|
MODE^ mode;
|
2007-08-04 00:58:00 +00:00
|
|
|
Object^ handle;
|
|
|
|
};
|
2007-05-17 00:14:00 +00:00
|
|
|
|
|
|
|
ref class Extio
|
|
|
|
{
|
2007-07-18 20:12:00 +00:00
|
|
|
public:
|
2007-07-21 01:21:00 +00:00
|
|
|
Extio (System::String^ name): handle (nullptr)
|
2007-07-18 20:12:00 +00:00
|
|
|
{
|
2007-07-21 01:21:00 +00:00
|
|
|
this->name = name;
|
2007-07-18 20:12:00 +00:00
|
|
|
}
|
2007-05-17 00:14:00 +00:00
|
|
|
|
2007-07-18 20:12:00 +00:00
|
|
|
property Object^ Handle
|
|
|
|
{
|
|
|
|
Object^ get () { return this->handle; }
|
|
|
|
void set (Object^ handle) { this->handle = handle; }
|
|
|
|
}
|
|
|
|
|
2007-07-21 01:21:00 +00:00
|
|
|
property System::String^ Name
|
|
|
|
{
|
|
|
|
System::String^ get () { return this->name; }
|
|
|
|
};
|
|
|
|
|
2007-07-18 20:12:00 +00:00
|
|
|
private:
|
|
|
|
Object^ handle;
|
2007-07-21 01:21:00 +00:00
|
|
|
System::String^ name;
|
2007-05-17 00:14:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
ref class Pipe: public Extio
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum class MODE
|
|
|
|
{
|
|
|
|
READ = ASE::Awk::Pipe::READ,
|
|
|
|
WRITE = ASE::Awk::Pipe::WRITE
|
|
|
|
};
|
|
|
|
|
|
|
|
property MODE^ Mode
|
|
|
|
{
|
|
|
|
MODE^ get () { return this->mode; }
|
|
|
|
};
|
|
|
|
|
2007-07-21 01:21:00 +00:00
|
|
|
Pipe (System::String^ name, MODE^ mode): Extio (name)
|
|
|
|
{
|
|
|
|
this->mode = mode;
|
|
|
|
}
|
|
|
|
|
2007-05-17 00:14:00 +00:00
|
|
|
private:
|
|
|
|
MODE^ mode;
|
|
|
|
};
|
|
|
|
|
|
|
|
ref class File: public Extio
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum class MODE
|
|
|
|
{
|
|
|
|
READ = ASE::Awk::File::READ,
|
|
|
|
WRITE = ASE::Awk::File::WRITE,
|
|
|
|
APPEND = ASE::Awk::File::APPEND
|
|
|
|
};
|
|
|
|
|
|
|
|
property MODE^ Mode
|
|
|
|
{
|
|
|
|
MODE^ get () { return this->mode; }
|
|
|
|
};
|
|
|
|
|
2007-07-21 01:21:00 +00:00
|
|
|
File (System::String^ name, MODE^ mode): Extio (name)
|
|
|
|
{
|
|
|
|
this->mode = mode;
|
|
|
|
}
|
|
|
|
|
2007-05-17 00:14:00 +00:00
|
|
|
private:
|
|
|
|
MODE^ mode;
|
|
|
|
};
|
|
|
|
|
|
|
|
ref class Console: public Extio
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum class MODE
|
|
|
|
{
|
|
|
|
READ = ASE::Awk::Console::READ,
|
|
|
|
WRITE = ASE::Awk::Console::WRITE
|
|
|
|
};
|
|
|
|
|
|
|
|
property MODE^ Mode
|
|
|
|
{
|
|
|
|
MODE^ get () { return this->mode; }
|
|
|
|
};
|
|
|
|
|
2007-07-21 01:21:00 +00:00
|
|
|
Console (System::String^ name, MODE^ mode): Extio (name)
|
|
|
|
{
|
|
|
|
this->mode = mode;
|
|
|
|
}
|
|
|
|
|
2007-05-17 00:14:00 +00:00
|
|
|
private:
|
|
|
|
MODE^ mode;
|
|
|
|
};
|
2007-08-26 23:33:00 +00:00
|
|
|
|
2007-08-22 22:56:00 +00:00
|
|
|
[System::Flags] enum class OPTION: int
|
2007-08-16 00:25:00 +00:00
|
|
|
{
|
|
|
|
NONE = 0,
|
|
|
|
IMPLICIT = ASE::Awk::OPT_IMPLICIT,
|
|
|
|
EXPLICIT = ASE::Awk::OPT_EXPLICIT,
|
|
|
|
UNIQUEFN = ASE::Awk::OPT_UNIQUEFN,
|
|
|
|
SHADING = ASE::Awk::OPT_SHADING,
|
|
|
|
SHIFT = ASE::Awk::OPT_SHIFT,
|
|
|
|
IDIV = ASE::Awk::OPT_IDIV,
|
|
|
|
STRCONCAT = ASE::Awk::OPT_STRCONCAT,
|
|
|
|
EXTIO = ASE::Awk::OPT_EXTIO,
|
|
|
|
COPROC = ASE::Awk::OPT_COPROC,
|
|
|
|
BLOCKLESS = ASE::Awk::OPT_BLOCKLESS,
|
2007-09-02 00:43:00 +00:00
|
|
|
STRBASEONE = ASE::Awk::OPT_BASEONE,
|
2007-08-16 00:25:00 +00:00
|
|
|
STRIPSPACES = ASE::Awk::OPT_STRIPSPACES,
|
|
|
|
NEXTOFILE = ASE::Awk::OPT_NEXTOFILE,
|
|
|
|
CRLF = ASE::Awk::OPT_CRLF,
|
|
|
|
ARGSTOMAIN = ASE::Awk::OPT_ARGSTOMAIN
|
|
|
|
};
|
|
|
|
|
2007-08-22 22:56:00 +00:00
|
|
|
enum class DEPTH: int
|
|
|
|
{
|
|
|
|
BLOCK_PARSE = ASE::Awk::DEPTH_BLOCK_PARSE,
|
|
|
|
BLOCK_RUN = ASE::Awk::DEPTH_BLOCK_RUN,
|
|
|
|
EXPR_PARSE = ASE::Awk::DEPTH_EXPR_PARSE,
|
|
|
|
EXPR_RUN = ASE::Awk::DEPTH_EXPR_RUN,
|
|
|
|
REX_BUILD = ASE::Awk::DEPTH_REX_BUILD,
|
|
|
|
REX_MATCH = ASE::Awk::DEPTH_REX_MATCH
|
|
|
|
};
|
|
|
|
|
2007-08-25 01:06:00 +00:00
|
|
|
// generated by generrcode-net.awk
|
|
|
|
enum class ERROR: int
|
|
|
|
{
|
|
|
|
NOERR = ASE::Awk::ERR_NOERR,
|
|
|
|
INVAL = ASE::Awk::ERR_INVAL,
|
|
|
|
NOMEM = ASE::Awk::ERR_NOMEM,
|
|
|
|
NOSUP = ASE::Awk::ERR_NOSUP,
|
|
|
|
NOPER = ASE::Awk::ERR_NOPER,
|
|
|
|
NODEV = ASE::Awk::ERR_NODEV,
|
|
|
|
NOSPC = ASE::Awk::ERR_NOSPC,
|
|
|
|
MFILE = ASE::Awk::ERR_MFILE,
|
|
|
|
MLINK = ASE::Awk::ERR_MLINK,
|
|
|
|
AGAIN = ASE::Awk::ERR_AGAIN,
|
|
|
|
NOENT = ASE::Awk::ERR_NOENT,
|
|
|
|
EXIST = ASE::Awk::ERR_EXIST,
|
|
|
|
FTBIG = ASE::Awk::ERR_FTBIG,
|
|
|
|
TBUSY = ASE::Awk::ERR_TBUSY,
|
|
|
|
ISDIR = ASE::Awk::ERR_ISDIR,
|
|
|
|
IOERR = ASE::Awk::ERR_IOERR,
|
|
|
|
OPEN = ASE::Awk::ERR_OPEN,
|
|
|
|
READ = ASE::Awk::ERR_READ,
|
|
|
|
WRITE = ASE::Awk::ERR_WRITE,
|
|
|
|
CLOSE = ASE::Awk::ERR_CLOSE,
|
|
|
|
INTERN = ASE::Awk::ERR_INTERN,
|
|
|
|
RUNTIME = ASE::Awk::ERR_RUNTIME,
|
|
|
|
BLKNST = ASE::Awk::ERR_BLKNST,
|
|
|
|
EXPRNST = ASE::Awk::ERR_EXPRNST,
|
|
|
|
SINOP = ASE::Awk::ERR_SINOP,
|
|
|
|
SINCL = ASE::Awk::ERR_SINCL,
|
|
|
|
SINRD = ASE::Awk::ERR_SINRD,
|
|
|
|
SOUTOP = ASE::Awk::ERR_SOUTOP,
|
|
|
|
SOUTCL = ASE::Awk::ERR_SOUTCL,
|
|
|
|
SOUTWR = ASE::Awk::ERR_SOUTWR,
|
|
|
|
LXCHR = ASE::Awk::ERR_LXCHR,
|
|
|
|
LXDIG = ASE::Awk::ERR_LXDIG,
|
|
|
|
LXUNG = ASE::Awk::ERR_LXUNG,
|
|
|
|
ENDSRC = ASE::Awk::ERR_ENDSRC,
|
|
|
|
ENDCMT = ASE::Awk::ERR_ENDCMT,
|
|
|
|
ENDSTR = ASE::Awk::ERR_ENDSTR,
|
|
|
|
ENDREX = ASE::Awk::ERR_ENDREX,
|
|
|
|
LBRACE = ASE::Awk::ERR_LBRACE,
|
|
|
|
LPAREN = ASE::Awk::ERR_LPAREN,
|
|
|
|
RPAREN = ASE::Awk::ERR_RPAREN,
|
|
|
|
RBRACK = ASE::Awk::ERR_RBRACK,
|
|
|
|
COMMA = ASE::Awk::ERR_COMMA,
|
|
|
|
SCOLON = ASE::Awk::ERR_SCOLON,
|
|
|
|
COLON = ASE::Awk::ERR_COLON,
|
|
|
|
STMEND = ASE::Awk::ERR_STMEND,
|
|
|
|
IN = ASE::Awk::ERR_IN,
|
|
|
|
NOTVAR = ASE::Awk::ERR_NOTVAR,
|
|
|
|
EXPRES = ASE::Awk::ERR_EXPRES,
|
|
|
|
WHILE = ASE::Awk::ERR_WHILE,
|
|
|
|
ASSIGN = ASE::Awk::ERR_ASSIGN,
|
|
|
|
IDENT = ASE::Awk::ERR_IDENT,
|
|
|
|
FNNAME = ASE::Awk::ERR_FNNAME,
|
|
|
|
BLKBEG = ASE::Awk::ERR_BLKBEG,
|
|
|
|
BLKEND = ASE::Awk::ERR_BLKEND,
|
|
|
|
DUPBEG = ASE::Awk::ERR_DUPBEG,
|
|
|
|
DUPEND = ASE::Awk::ERR_DUPEND,
|
|
|
|
BFNRED = ASE::Awk::ERR_BFNRED,
|
|
|
|
AFNRED = ASE::Awk::ERR_AFNRED,
|
|
|
|
GBLRED = ASE::Awk::ERR_GBLRED,
|
|
|
|
PARRED = ASE::Awk::ERR_PARRED,
|
|
|
|
DUPPAR = ASE::Awk::ERR_DUPPAR,
|
|
|
|
DUPGBL = ASE::Awk::ERR_DUPGBL,
|
|
|
|
DUPLCL = ASE::Awk::ERR_DUPLCL,
|
|
|
|
BADPAR = ASE::Awk::ERR_BADPAR,
|
|
|
|
BADVAR = ASE::Awk::ERR_BADVAR,
|
|
|
|
UNDEF = ASE::Awk::ERR_UNDEF,
|
|
|
|
LVALUE = ASE::Awk::ERR_LVALUE,
|
|
|
|
GBLTM = ASE::Awk::ERR_GBLTM,
|
|
|
|
LCLTM = ASE::Awk::ERR_LCLTM,
|
|
|
|
PARTM = ASE::Awk::ERR_PARTM,
|
|
|
|
DELETE = ASE::Awk::ERR_DELETE,
|
|
|
|
BREAK = ASE::Awk::ERR_BREAK,
|
|
|
|
CONTINUE = ASE::Awk::ERR_CONTINUE,
|
|
|
|
NEXTBEG = ASE::Awk::ERR_NEXTBEG,
|
|
|
|
NEXTEND = ASE::Awk::ERR_NEXTEND,
|
|
|
|
NEXTFBEG = ASE::Awk::ERR_NEXTFBEG,
|
|
|
|
NEXTFEND = ASE::Awk::ERR_NEXTFEND,
|
|
|
|
PRINTFARG = ASE::Awk::ERR_PRINTFARG,
|
|
|
|
PREPST = ASE::Awk::ERR_PREPST,
|
|
|
|
GLNCPS = ASE::Awk::ERR_GLNCPS,
|
|
|
|
DIVBY0 = ASE::Awk::ERR_DIVBY0,
|
|
|
|
OPERAND = ASE::Awk::ERR_OPERAND,
|
|
|
|
POSIDX = ASE::Awk::ERR_POSIDX,
|
|
|
|
ARGTF = ASE::Awk::ERR_ARGTF,
|
|
|
|
ARGTM = ASE::Awk::ERR_ARGTM,
|
|
|
|
FNNONE = ASE::Awk::ERR_FNNONE,
|
|
|
|
NOTIDX = ASE::Awk::ERR_NOTIDX,
|
|
|
|
NOTDEL = ASE::Awk::ERR_NOTDEL,
|
|
|
|
NOTMAP = ASE::Awk::ERR_NOTMAP,
|
|
|
|
NOTMAPIN = ASE::Awk::ERR_NOTMAPIN,
|
|
|
|
NOTMAPNILIN = ASE::Awk::ERR_NOTMAPNILIN,
|
|
|
|
NOTREF = ASE::Awk::ERR_NOTREF,
|
|
|
|
NOTASS = ASE::Awk::ERR_NOTASS,
|
|
|
|
IDXVALASSMAP = ASE::Awk::ERR_IDXVALASSMAP,
|
|
|
|
POSVALASSMAP = ASE::Awk::ERR_POSVALASSMAP,
|
|
|
|
MAPTOSCALAR = ASE::Awk::ERR_MAPTOSCALAR,
|
|
|
|
SCALARTOMAP = ASE::Awk::ERR_SCALARTOMAP,
|
|
|
|
MAPNOTALLOWED = ASE::Awk::ERR_MAPNOTALLOWED,
|
|
|
|
VALTYPE = ASE::Awk::ERR_VALTYPE,
|
|
|
|
RDELETE = ASE::Awk::ERR_RDELETE,
|
|
|
|
RNEXTBEG = ASE::Awk::ERR_RNEXTBEG,
|
|
|
|
RNEXTEND = ASE::Awk::ERR_RNEXTEND,
|
|
|
|
RNEXTFBEG = ASE::Awk::ERR_RNEXTFBEG,
|
|
|
|
RNEXTFEND = ASE::Awk::ERR_RNEXTFEND,
|
|
|
|
BFNUSER = ASE::Awk::ERR_BFNUSER,
|
|
|
|
BFNIMPL = ASE::Awk::ERR_BFNIMPL,
|
|
|
|
IOUSER = ASE::Awk::ERR_IOUSER,
|
|
|
|
IONONE = ASE::Awk::ERR_IONONE,
|
|
|
|
IOIMPL = ASE::Awk::ERR_IOIMPL,
|
|
|
|
IONMEM = ASE::Awk::ERR_IONMEM,
|
|
|
|
IONMNL = ASE::Awk::ERR_IONMNL,
|
|
|
|
FMTARG = ASE::Awk::ERR_FMTARG,
|
|
|
|
FMTCNV = ASE::Awk::ERR_FMTCNV,
|
|
|
|
CONVFMTCHR = ASE::Awk::ERR_CONVFMTCHR,
|
|
|
|
OFMTCHR = ASE::Awk::ERR_OFMTCHR,
|
|
|
|
REXRECUR = ASE::Awk::ERR_REXRECUR,
|
|
|
|
REXRPAREN = ASE::Awk::ERR_REXRPAREN,
|
|
|
|
REXRBRACKET = ASE::Awk::ERR_REXRBRACKET,
|
|
|
|
REXRBRACE = ASE::Awk::ERR_REXRBRACE,
|
|
|
|
REXUNBALPAR = ASE::Awk::ERR_REXUNBALPAR,
|
|
|
|
REXCOLON = ASE::Awk::ERR_REXCOLON,
|
|
|
|
REXCRANGE = ASE::Awk::ERR_REXCRANGE,
|
|
|
|
REXCCLASS = ASE::Awk::ERR_REXCCLASS,
|
|
|
|
REXBRANGE = ASE::Awk::ERR_REXBRANGE,
|
|
|
|
REXEND = ASE::Awk::ERR_REXEND,
|
|
|
|
REXGARBAGE = ASE::Awk::ERR_REXGARBAGE
|
|
|
|
};
|
|
|
|
// end of enum class ERROR
|
|
|
|
|
2007-07-19 23:35:00 +00:00
|
|
|
typedef ASE::Awk::char_t char_t;
|
|
|
|
|
2007-05-17 00:14:00 +00:00
|
|
|
Awk ();
|
2007-08-17 00:19:00 +00:00
|
|
|
!Awk ();
|
2007-05-17 00:14:00 +00:00
|
|
|
virtual ~Awk ();
|
|
|
|
|
2007-08-22 22:56:00 +00:00
|
|
|
virtual void Close ();
|
|
|
|
virtual bool Parse ();
|
|
|
|
virtual bool Run ();
|
2007-08-25 01:06:00 +00:00
|
|
|
virtual bool Run (System::String^ entryPoint, cli::array<System::String^>^ args);
|
2007-08-22 22:56:00 +00:00
|
|
|
|
2007-09-07 23:14:00 +00:00
|
|
|
/**
|
|
|
|
* sets the request to stop the Run method
|
|
|
|
*/
|
|
|
|
virtual void Stop ();
|
|
|
|
|
2007-08-25 01:06:00 +00:00
|
|
|
delegate void RunStartHandler (Awk^ awk);
|
|
|
|
delegate void RunEndHandler (Awk^ awk);
|
|
|
|
delegate void RunReturnHandler (Awk^ awk);
|
|
|
|
delegate void RunStatementHandler (Awk^ awk);
|
2007-07-17 20:20:00 +00:00
|
|
|
|
2007-08-22 22:56:00 +00:00
|
|
|
/*event*/ RunStartHandler^ OnRunStart;
|
|
|
|
/*event*/ RunEndHandler^ OnRunEnd;
|
|
|
|
/*event*/ RunReturnHandler^ OnRunReturn;
|
|
|
|
/*event*/ RunStatementHandler^ OnRunStatement;
|
2007-05-17 00:14:00 +00:00
|
|
|
|
2007-08-25 01:06:00 +00:00
|
|
|
delegate bool FunctionHandler (System::String^ name, cli::array<Argument^>^ args, Return^ ret);
|
2007-08-22 22:56:00 +00:00
|
|
|
virtual bool AddFunction (System::String^ name, int minArgs, int maxArgs, FunctionHandler^ handler);
|
|
|
|
virtual bool DeleteFunction (System::String^ name);
|
|
|
|
|
|
|
|
virtual bool SetWord (System::String^ ow, System::String^ nw);
|
|
|
|
virtual bool UnsetWord (System::String^ ow);
|
|
|
|
virtual bool UnsetAllWords ();
|
2007-05-17 00:14:00 +00:00
|
|
|
|
2007-08-22 22:56:00 +00:00
|
|
|
virtual bool SetMaxDepth (DEPTH id, size_t depth);
|
|
|
|
virtual bool GetMaxDepth (DEPTH id, size_t* depth);
|
2007-05-17 00:14:00 +00:00
|
|
|
|
2007-09-07 23:14:00 +00:00
|
|
|
virtual bool SetErrorString (ERROR num, System::String^ str);
|
|
|
|
|
2007-08-17 00:19:00 +00:00
|
|
|
property OPTION Option
|
2007-07-16 20:16:00 +00:00
|
|
|
{
|
2007-09-07 23:14:00 +00:00
|
|
|
OPTION get ();
|
|
|
|
void set (OPTION opt);
|
2007-07-16 20:16:00 +00:00
|
|
|
}
|
|
|
|
|
2007-08-25 01:06:00 +00:00
|
|
|
property System::String^ ErrorMessage
|
|
|
|
{
|
2007-08-26 23:33:00 +00:00
|
|
|
System::String^ get () { return this->errMsg; }
|
2007-08-25 01:06:00 +00:00
|
|
|
}
|
|
|
|
|
2007-08-26 23:33:00 +00:00
|
|
|
property ERROR ErrorCode
|
|
|
|
{
|
|
|
|
ERROR get () { return this->errCode; }
|
|
|
|
}
|
|
|
|
|
|
|
|
property unsigned int ErrorLine
|
|
|
|
{
|
|
|
|
unsigned int get () { return this->errLine; }
|
|
|
|
}
|
2007-08-25 01:06:00 +00:00
|
|
|
|
2007-07-16 20:16:00 +00:00
|
|
|
protected:
|
2007-08-20 23:27:00 +00:00
|
|
|
MojoAwk* awk;
|
2007-08-17 00:19:00 +00:00
|
|
|
OPTION option;
|
2007-08-20 23:27:00 +00:00
|
|
|
System::Collections::Hashtable^ funcs;
|
2007-07-16 20:16:00 +00:00
|
|
|
|
2007-07-25 18:53:00 +00:00
|
|
|
public protected:
|
2007-08-04 00:58:00 +00:00
|
|
|
// Source
|
|
|
|
virtual int OpenSource (Source^ source) = 0;
|
|
|
|
virtual int CloseSource (Source^ source) = 0;
|
|
|
|
virtual int ReadSource (
|
|
|
|
Source^ source, cli::array<char_t>^ buf, int len) = 0;
|
|
|
|
virtual int WriteSource (
|
|
|
|
Source^ source, cli::array<char_t>^ buf, int len) = 0;
|
|
|
|
|
2007-07-25 18:53:00 +00:00
|
|
|
// File
|
|
|
|
virtual int OpenFile (File^ file) = 0;
|
|
|
|
virtual int CloseFile (File^ file) = 0;
|
|
|
|
virtual int ReadFile (
|
|
|
|
File^ file, cli::array<char_t>^ buf, int len) = 0;
|
|
|
|
virtual int WriteFile (
|
|
|
|
File^ file, cli::array<char_t>^ buf, int len) = 0;
|
|
|
|
virtual int FlushFile (File^ file) = 0;
|
|
|
|
|
|
|
|
// Pipe
|
|
|
|
virtual int OpenPipe (Pipe^ pipe) = 0;
|
|
|
|
virtual int ClosePipe (Pipe^ pipe) = 0;
|
|
|
|
virtual int ReadPipe (
|
|
|
|
Pipe^ pipe, cli::array<char_t>^ buf, int len) = 0;
|
|
|
|
virtual int WritePipe (
|
|
|
|
Pipe^ pipe, cli::array<char_t>^ buf, int len) = 0;
|
|
|
|
virtual int FlushPipe (Pipe^ pipe) = 0;
|
|
|
|
|
|
|
|
// Console
|
|
|
|
virtual int OpenConsole (Console^ console) = 0;
|
|
|
|
virtual int CloseConsole (Console^ console) = 0;
|
|
|
|
virtual int ReadConsole (
|
|
|
|
Console^ console, cli::array<char_t>^ buf, int len) = 0;
|
|
|
|
virtual int WriteConsole (
|
|
|
|
Console^ console, cli::array<char_t>^ buf, int len) = 0;
|
|
|
|
virtual int FlushConsole (Console^ console) = 0;
|
|
|
|
virtual int NextConsole (Console^ console) = 0;
|
|
|
|
|
2007-07-16 20:16:00 +00:00
|
|
|
public protected:
|
2007-08-21 23:24:00 +00:00
|
|
|
bool Awk::DispatchFunction (ASE::Awk::Return* ret,
|
2007-08-20 23:27:00 +00:00
|
|
|
const ASE::Awk::Argument* args, size_t nargs,
|
|
|
|
const char_t* name, size_t len);
|
2007-08-26 23:33:00 +00:00
|
|
|
|
|
|
|
public protected:
|
|
|
|
System::String^ errMsg;
|
|
|
|
unsigned int errLine;
|
|
|
|
ERROR errCode;
|
|
|
|
|
|
|
|
void setError (ERROR num);
|
|
|
|
void retrieveError ();
|
|
|
|
bool runErrorReported; // only used if the run-callback is activated.
|
2007-09-07 23:14:00 +00:00
|
|
|
bool stopRequested;
|
2007-05-17 00:14:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|