Recovered from cvs revision 2007-05-24 03:37:00

This commit is contained in:
2007-05-24 15:56:00 +00:00
parent 698794fb61
commit d58553120e
6 changed files with 72 additions and 24 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: Awk.cpp,v 1.36 2007/05/22 16:01:25 bacon Exp $
* $Id: Awk.cpp,v 1.37 2007/05/23 11:43:24 bacon Exp $
*/
#include <ase/awk/Awk.hpp>
@ -364,16 +364,6 @@ namespace ASE
{
}
void Awk::Run::setMaxBlockDepth (size_t n)
{
ase_awk_setmaxdepth (awk->awk, ASE_AWK_DEPTH_BLOCK_RUN, n);
}
void Awk::Run::setMaxExpressionDepth (size_t n)
{
ase_awk_setmaxdepth (awk->awk, ASE_AWK_DEPTH_EXPR_RUN, n);
}
int Awk::Run::stop ()
{
ASE_ASSERT (this->run != ASE_NULL);
@ -570,6 +560,18 @@ namespace ASE
return ase_awk_getoption (awk);
}
void Awk::setDepth (int id, size_t depth)
{
ASE_ASSERT (awk != ASE_NULL);
ase_awk_setmaxdepth (awk, id, depth);
}
int Awk::getDepth (int id)
{
ASE_ASSERT (awk != ASE_NULL);
return ase_awk_getmaxdepth (awk, id);
}
int Awk::parse ()
{
ASE_ASSERT (awk != ASE_NULL);

View File

@ -1,5 +1,5 @@
/*
* $Id: Awk.hpp,v 1.34 2007/05/22 16:01:25 bacon Exp $
* $Id: Awk.hpp,v 1.35 2007/05/23 11:43:24 bacon Exp $
*/
#ifndef _ASE_AWK_AWK_HPP_
@ -369,9 +369,6 @@ namespace ASE
size_t getErrorLine () const;
const char_t* getErrorMessage () const;
void setMaxBlockDepth (size_t n);
void setMaxExpressionDepth (size_t n);
protected:
Awk* awk;
run_t* run;
@ -399,6 +396,19 @@ namespace ASE
virtual void setOption (int opt);
virtual int getOption () const;
enum Depth
{
DEPTH_BLOCK_PARSE = ASE_AWK_DEPTH_BLOCK_PARSE,
DEPTH_BLOCK_RUN = ASE_AWK_DEPTH_BLOCK_RUN,
DEPTH_EXPR_PARSE = ASE_AWK_DEPTH_EXPR_PARSE,
DEPTH_EXPR_RUN = ASE_AWK_DEPTH_EXPR_RUN,
DEPTH_REX_BUILD = ASE_AWK_DEPTH_REX_BUILD,
DEPTH_REX_MATCH = ASE_AWK_DEPTH_REX_MATCH
};
virtual void setDepth (int id, size_t depth);
virtual int getDepth (int id);
virtual int parse ();
virtual int run (const char_t* main = ASE_NULL,
const char_t** args = ASE_NULL, size_t nargs = 0);

View File

@ -1,5 +1,5 @@
/*
* $Id: StdAwk.cpp,v 1.19 2007/05/20 16:21:09 bacon Exp $
* $Id: StdAwk.cpp,v 1.21 2007/05/23 14:15:16 bacon Exp $
*/
#include <ase/awk/StdAwk.hpp>
@ -29,7 +29,11 @@ namespace ASE
#define ADD_FUNC(name,min,max,impl) \
do { \
if (addFunction (name, min, max, \
(FunctionHandler)impl) == -1) return -1; \
(FunctionHandler)impl) == -1) \
{ \
Awk::close (); \
return -1; \
} \
} while (0)
int StdAwk::open ()

View File

@ -1,5 +1,5 @@
/*
* $Id: StdAwk.hpp,v 1.9 2007/05/16 14:44:13 bacon Exp $
* $Id: StdAwk.hpp,v 1.11 2007/05/23 14:15:16 bacon Exp $
*/
#ifndef _ASE_AWK_STDAWK_HPP_
@ -34,7 +34,6 @@ namespace ASE
int strfgmtime (Return* ret, const Argument* args, size_t nargs);
int system (Return* ret, const Argument* args, size_t nargs);
// pipe io handlers
int openPipe (Pipe& io);
int closePipe (Pipe& io);