Esempio n. 1
0
/*****************************************************************************
	ExeLst()
	This function executes a less-than-sign (<) command.
	n<	Iterate n times
*****************************************************************************/
#include "zport.h"		/* define portability identifiers */
#include "tecoc.h"		/* define general identifiers */
#include "defext.h"		/* define external global variables */
#include "deferr.h"		/* define identifiers for error messages */
DEFAULT ExeLst()				/* execute a  < command */
{
	DBGFEN(1,"ExeLst",NULL);
	if (++LStTop >= LPS_SIZE) {		/* if loop stack is full */
		ErrMsg(ERR_PDO);		/* push-down list overflow */
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}
	if (EStTop == EStBot) {			/* if no numeric argument */
		NArgmt = INFINITE;		/* make it an infinite loop */
	} else {
		if (GetNmA() == FAILURE) {	/* get numeric argmument */
			DBGFEX(1,DbgFNm,"FAILURE");
			return FAILURE;
		}
		if (NArgmt <= 0) {		/* if null loop */
			if (FlowEL()== FAILURE) { /* flow to end of loop */
				DBGFEX(1,DbgFNm,"FAILURE");
				return FAILURE;
			}
			CmdMod = '\0';		/* clear modifiers flags */
			DBGFEX(1,DbgFNm,"SUCCESS");
			return SUCCESS;
		}
	}
	LStack[LStTop].LIndex = NArgmt;		/* store loop index */
	LStack[LStTop].LAddr = CBfPtr;		/* store loop start */
	CmdMod = '\0';				/* clear modifiers flags */
	DBGFEX(1,DbgFNm,"SUCCESS");
	return SUCCESS;
}
Esempio n. 2
0
File: exef.c Progetto: rmblair/tecoc
static DEFAULT ExeFGt()			/* execute an F> command */
{
	DBGFEN(1,"ExeFGt",NULL);

	if (LStTop == LStBot) {			/* if not in a loop */
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}

	if (FlowEL() == FAILURE) {		/* flow to end-of-loop */
		DBGFEX(1,DbgFNm,"FAILURE");
		return FAILURE;
	}
	CBfPtr--;				/* backup before the ">" */
	LStTop++;				/* cancel what FlowEL did */
	CmdMod = '\0';				/* clear modifiers flags */
	EStTop = EStBot;			/* clear expression stack */

	DBGFEX(1,DbgFNm,"SUCCESS");
	return SUCCESS;
}