ack/lang/basic/src/llmess.h

61 lines
1.2 KiB
C
Raw Normal View History

1988-07-04 11:45:41 +00:00
/*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
#include <stdio.h>
1988-07-04 11:45:41 +00:00
#include "tokentab.h"
#include "system.h"
#include "print.h"
1988-07-04 11:45:41 +00:00
/* Mod van gertjan */
extern int LLsymb;
extern int toknum;
void error_char(char *format,char ch)
1988-07-04 11:45:41 +00:00
{
extern int listing,errorcnt;
extern int basicline;
if ( !listing ) fprint(STDERR, "LINE %d:",basicline);
fprint(STDERR, format,ch);
errorcnt++;
}
void error_string(char* format,char* str)
1988-07-04 11:45:41 +00:00
{
extern int listing,errorcnt;
extern int basicline;
if ( !listing ) fprint(STDERR, "LINE %d:",basicline);
fprint(STDERR, format,str);
errorcnt++;
}
void LLmessage(int insertedtok )
1988-07-04 11:45:41 +00:00
{
if ( insertedtok < 0 ) {
error("Fatal stack overflow\n");
C_close();
sys_stop( S_EXIT );
}
if ( insertedtok == 0 )
if ( LLsymb < 256 )
error_char("%c deleted\n", (char)LLsymb);
else
error_string("%s deleted\n", tokentab[ LLsymb-256 ]);
else {
if ( insertedtok < 256 )
error_char("%c inserted\n", (char)insertedtok);
else
error_string("%s inserted\n", tokentab[ insertedtok-256 ]);
toknum = insertedtok;
}
}