Cleaned up lexer

- separated the lexer into multiple functions so it is more readable
- fixed issue with long label names in macro arguments
- added error checking code to prevent buffer overflows
This commit is contained in:
YamaArashi committed 2014-08-22 21:44:18 -07:00
1 parent 6198cc185c
commit 2bf31870a7
3 files changed
+490 -506

No files matched your search

+5 -2
View File
@@ -5,7 +5,8 @@
#include "asm/types.h"
#define LEXHASHSIZE 512
#define LEXHASHSIZE (1 << 11)
#define MAXSTRLEN 255
struct sLexInitString {
char *tzName;
@@ -18,7 +19,9 @@ struct sLexFloat {
};
struct yy_buffer_state {
char *pBufferStart;
char *pBufferRealStart; // actual starting address
char *pBufferStart; // address where the data is initially written
// after the "safety margin"
char *pBuffer;
ULONG nBufferSize;
ULONG oAtLineStart;