-/* Generated by re2c 0.13.0.dev on Tue May 1 09:59:49 2007 */
+/* Generated by re2c 0.13.0.dev on Sat May 5 19:12:48 2007 */
#line 1 "scanner.re"
/* $Id$ */
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <sstream>
+#include <stdarg.h>
#include "scanner.h"
#include "parser.h"
#include "y.tab.h"
#define MAX(a,b) (((a)>(b))?(a):(b))
#endif
-#define BSIZE 8192
-
+#define BSIZE 8192
#define YYCTYPE unsigned char
#define YYCURSOR cursor
#define YYLIMIT lim
exit(1);
}
+void Scanner::fatalf(const char *fmt, ...) const
+{
+ char szBuf[4096];
+
+ va_list args;
+
+ va_start(args, fmt);
+ vsnprintf(szBuf, sizeof(szBuf), fmt, args);
+ va_end(args);
+
+ szBuf[sizeof(szBuf)-1] = '0';
+
+ fatal(szBuf);
+}
+
Scanner::~Scanner()
{
if (bot)
std::make_pair(cfg.to_string().substr(sizeof("variable:") - 1), strVal)
).second)
{
- fatal("variable already being used and cannot be changed");
+ fatalf("variable '%s' already being used and cannot be changed", cfg.to_string().c_str());
}
}
else if (mapDefineKeys.find(cfg.to_string()) != mapDefineKeys.end())
std::make_pair(cfg.to_string().substr(sizeof("define:") - 1), strVal)
).second)
{
- fatal("define already being used and cannot be changed");
+ fatalf("define '%s' already being used and cannot be changed", cfg.to_string().c_str());
}
}
else if (mapLabelKeys.find(cfg.to_string()) != mapLabelKeys.end())
std::make_pair(cfg.to_string().substr(sizeof("label:") - 1), strVal)
).second)
{
- fatal("label already being used and cannot be changed");
+ fatalf("label '%s' already being used and cannot be changed", cfg.to_string().c_str());
}
}
else
int echo();
int scan();
+ void fatalf(const char*, ...) const;
void fatal(const char*) const;
void fatal(uint, const char*) const;
#include <string.h>
#include <iostream>
#include <sstream>
+#include <stdarg.h>
#include "scanner.h"
#include "parser.h"
#include "y.tab.h"
#define MAX(a,b) (((a)>(b))?(a):(b))
#endif
-#define BSIZE 8192
-
+#define BSIZE 8192
#define YYCTYPE unsigned char
#define YYCURSOR cursor
#define YYLIMIT lim
exit(1);
}
+void Scanner::fatalf(const char *fmt, ...) const
+{
+ char szBuf[4096];
+
+ va_list args;
+
+ va_start(args, fmt);
+ vsnprintf(szBuf, sizeof(szBuf), fmt, args);
+ va_end(args);
+
+ szBuf[sizeof(szBuf)-1] = '0';
+
+ fatal(szBuf);
+}
+
Scanner::~Scanner()
{
if (bot)