This commit is contained in:
parent
f857751606
commit
aae2e8e05f
168 changed files with 11625 additions and 0 deletions
75
Utils/Parser Generator/SOURCE/yysldbug.c
Normal file
75
Utils/Parser Generator/SOURCE/yysldbug.c
Normal file
|
@ -0,0 +1,75 @@
|
|||
/************************************************************
|
||||
yysldbug.c
|
||||
This file can be freely modified for the generation of
|
||||
custom code.
|
||||
|
||||
Copyright (c) 1999 Bumble-Bee Software Ltd.
|
||||
************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <winbase.h>
|
||||
#endif
|
||||
#include "lex.h"
|
||||
|
||||
#ifdef YYDEBUG
|
||||
|
||||
int YYNEAR YYDCDECL yylexdebug = 0;
|
||||
int YYNEAR YYDCDECL yylexdebugflush = 0;
|
||||
#ifndef YYNINITSTREAM
|
||||
FILE YYFAR *YYNEAR YYDCDECL yylexdebugout = stdout;
|
||||
#else
|
||||
FILE YYFAR *YYNEAR YYDCDECL yylexdebugout = NULL;
|
||||
#endif
|
||||
|
||||
#ifdef YYPROTOTYPE
|
||||
void YYCDECL yydmatch(int expr)
|
||||
#else
|
||||
void YYCDECL yydmatch(expr)
|
||||
int expr;
|
||||
#endif
|
||||
{
|
||||
if (yydebug || yylexdebug) {
|
||||
char string[128];
|
||||
int i;
|
||||
|
||||
yylexdebugoutput("match: \"");
|
||||
for (i = 0; i < yyleng; i++) {
|
||||
yydebugoutput(yytext[i]);
|
||||
}
|
||||
sprintf(string, "\", %d\n", (int) expr);
|
||||
yylexdebugoutput(string);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef YYPROTOTYPE
|
||||
void YYCDECL yylexdebugoutput(YYCONST char *string)
|
||||
#else
|
||||
void YYCDECL yylexdebugoutput(string)
|
||||
YYCONST char *string;
|
||||
#endif
|
||||
{
|
||||
yyassert(string != NULL);
|
||||
|
||||
#ifdef _WIN32
|
||||
if (yylexdebugout != NULL) {
|
||||
#else
|
||||
yyassert(yylexdebugout != NULL);
|
||||
#endif
|
||||
while (*string != '\0') {
|
||||
putc(*string++, yylexdebugout);
|
||||
}
|
||||
|
||||
if (yydebugflush || yylexdebugflush) {
|
||||
fflush(yylexdebugout);
|
||||
}
|
||||
#ifdef _WIN32
|
||||
}
|
||||
else {
|
||||
OutputDebugString(string);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue