Added erase basic function.

Some Kewords:: qualifiers were still missing.


git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/branches/ErrorHandling@5838 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2011-11-30 21:48:21 +00:00
parent 2c80bb5ff1
commit 90f308452a
2 changed files with 39 additions and 1 deletions

View File

@ -1120,6 +1120,10 @@ listtokens(FILE * f, tokenrec * l_buf)
output_msg("DIM");
break;
case tokerase:
output_msg("ERASE");
break;
case tokpoke:
output_msg("POKE");
break;
@ -4844,6 +4848,33 @@ cmddim(struct LOC_exec *LINK)
while (!iseos(LINK));
}
void PBasic::
cmderase(struct LOC_exec *LINK)
{
varrec *v = NULL;
do
{
if (LINK->t == NULL || LINK->t->kind != tokvar)
snerr(": error in DIM command");
v = LINK->t->UU.vp;
LINK->t = LINK->t->next;
if (v->stringvar)
{
free_dim_stringvar(v);
}
else
{
PhreeqcPtr->free_check_null(v->UU.U0.arr);
v->UU.U0.arr = NULL;
}
v->numdims = 0;
if (!iseos(LINK)) require(tokcomma, LINK);
}
while (!iseos(LINK));
}
void PBasic::
cmdpoke(struct LOC_exec *LINK)
{
@ -5064,6 +5095,10 @@ exec(void)
cmddim(&V);
break;
case tokerase:
cmderase(&V);
break;
case tokpoke:
cmdpoke(&V);
break;
@ -6263,6 +6298,7 @@ const std::map<const std::string, PBasic::BASIC_TOKEN>::value_type temp_tokens[]
std::map<const std::string, PBasic::BASIC_TOKEN>::value_type("gotoxy", PBasic::tokgotoxy),
std::map<const std::string, PBasic::BASIC_TOKEN>::value_type("on", PBasic::tokon),
std::map<const std::string, PBasic::BASIC_TOKEN>::value_type("dim", PBasic::tokdim),
std::map<const std::string, PBasic::BASIC_TOKEN>::value_type("erase", PBasic::tokerase),
std::map<const std::string, PBasic::BASIC_TOKEN>::value_type("poke", PBasic::tokpoke),
std::map<const std::string, PBasic::BASIC_TOKEN>::value_type("list", PBasic::toklist),
std::map<const std::string, PBasic::BASIC_TOKEN>::value_type("run", PBasic::tokrun),

View File

@ -293,7 +293,8 @@ public:
tokpr_phi,
tokgas_p,
tokgas_vm,
tokpressure
tokpressure,
tokerase
};
#if !defined(PHREEQCI_GUI)
@ -411,6 +412,7 @@ public:
void cmdgotoxy(struct LOC_exec *LINK);
void cmdon(struct LOC_exec *LINK);
void cmddim(struct LOC_exec *LINK);
void cmderase(struct LOC_exec *LINK);
void cmdpoke(struct LOC_exec *LINK);
int basic_main(char *commands);
int basic_compile(char *commands, void **lnbase, void **vbase, void **lpbase);