changed Awk::parse() to accept a reference type instead of a pointer type

This commit is contained in:
2009-07-14 04:03:53 +00:00
parent 9b6eb94664
commit af6831ed3c
5 changed files with 58 additions and 23 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: Awk.cpp 230 2009-07-13 08:51:23Z hyunghwan.chung $
* $Id: Awk.cpp 231 2009-07-13 10:03:53Z hyunghwan.chung $
*
Copyright 2006-2009 Chung, Hyung-Hwan.
@ -39,6 +39,8 @@ struct rxtn_t
Awk::Run* run;
};
Awk::NoSource Awk::Source::NONE;
//////////////////////////////////////////////////////////////////
// Awk::RIO
//////////////////////////////////////////////////////////////////
@ -1275,14 +1277,20 @@ int Awk::unsetAllWords ()
return qse_awk_setword (awk, QSE_NULL, 0, QSE_NULL, 0);
}
Awk::Run* Awk::parse (Source* in, Source* out)
Awk::Run* Awk::parse (Source& in, Source& out)
{
QSE_ASSERT (awk != QSE_NULL);
if (&in == &Source::NONE)
{
setError (ERR_INVAL);
return QSE_NULL;
}
fini_runctx ();
sourceReader = in;
sourceWriter = out;
sourceReader = ∈
sourceWriter = (&out == &Source::NONE)? QSE_NULL: &out;
qse_awk_sio_t sio;
sio.in = readSource;