/*****************************************************************************/
/* */
-/* scanner.h */
+/* scanner.h */
/* */
/* Configuration file scanner for the sim65 6502 simulator */
/* */
/* */
/* */
-/* (C) 1998-2002 Ullrich von Bassewitz */
-/* Wacholderweg 14 */
-/* D-70597 Stuttgart */
-/* EMail: uz@musoftware.de */
+/* (C) 1998-2012, Ullrich von Bassewitz */
+/* Roemerstrasse 52 */
+/* D-70794 Filderstadt */
+/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
+/* common */
+#include "attrib.h"
+#include "strbuf.h"
+
+
+
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
CFGTOK_EQ,
CFGTOK_COLON,
CFGTOK_DOT,
+ CFGTOK_DOTDOT,
CFGTOK_EOF,
/* Primary blocks */
- CFGTOK_CHIPS,
+ CFGTOK_CPU,
+ CFGTOK_ADDRSPACE,
- /* Chips section */
- CFGTOK_NAME,
- CFGTOK_ADDR,
- CFGTOK_RANGE,
+ /* Secondary stuff */
+ CFGTOK_TYPE,
/* Special identifiers */
CFGTOK_TRUE,
/* Mapping table entry, special identifier --> token */
typedef struct IdentTok IdentTok;
struct IdentTok {
- const char* Ident; /* Identifier */
- cfgtok_t Tok; /* Token for identifier */
+ const char* Ident; /* Identifier */
+ cfgtok_t Tok; /* Token for identifier */
};
-#define ENTRY_COUNT(s) (sizeof (s) / sizeof (s [0]))
+#define ENTRY_COUNT(s) (sizeof (s) / sizeof (s [0]))
/* Current token and attributes */
-#define CFG_MAX_IDENT_LEN 255
-extern cfgtok_t CfgTok;
-extern char CfgSVal [CFG_MAX_IDENT_LEN+1];
-extern unsigned long CfgIVal;
+extern cfgtok_t CfgTok;
+extern StrBuf CfgSVal;
+extern unsigned long CfgIVal;
/* Error location */
-extern unsigned CfgErrorLine;
-extern unsigned CfgErrorCol;
+extern unsigned CfgErrorLine;
+extern unsigned CfgErrorCol;
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
void CfgConsumeColon (void);
/* Consume a colon */
+void CfgConsumeRCurly (void);
+/* Consume a right curly brace */
+
void CfgOptionalComma (void);
/* Consume a comma if there is one */