/* common */
#include "cmdline.h"
#include "target.h"
+#include "tgttrans.h"
#include "version.h"
/* ca65 */
LongOption (&I, OptTab, sizeof(OptTab)/sizeof(OptTab[0]));
break;
- case 'g':
+ case 'g':
OptDebugInfo (Arg, 0);
break;
break;
case 'V':
- OptVersion (Arg, 0);
+ OptVersion (Arg, 0);
break;
case 'W':
exit (EXIT_FAILURE);
}
+ /* Intialize the target translation tables */
+ TgtTranslateInit ();
+
/* Initialize the scanner, open the input file */
InitScanner (InFile);
#include "anonname.h"
#include "codegen.h"
#include "datatype.h"
+#include "declattr.h"
#include "error.h"
#include "expr.h"
#include "funcdesc.h"
DeclSpec Spec;
Declaration Decl;
-
+ DeclAttr Attr;
/* Allow an ellipsis as last parameter */
if (curtok == TOK_ELLIPSIS) {
Spec.StorageClass &= ~SC_DEF;
}
+ /* Parse an attribute */
+ ParseAttribute (&Decl, &Attr);
+
/* Create a symbol table entry */
AddLocalSym (Decl.Ident, ParamTypeCvt (Decl.Type), Spec.StorageClass, 0);
"`\"' expected",
"`:' expected",
"`;' expected",
+ "`,' expected",
"`(' expected",
"`)' expected",
"`[' expected",
"Illegal modifier",
"Illegal type qualifier",
"Illegal storage class",
+ "Illegal attribute",
"Illegal segment name: `%s'",
"Division by zero",
"Modulo operation with zero",
#define ERROR_H
-
+
/* common */
#include "attrib.h"
ERR_QUOTE_EXPECTED,
ERR_COLON_EXPECTED,
ERR_SEMICOLON_EXPECTED,
+ ERR_COMMA_EXPECTED,
ERR_LPAREN_EXPECTED,
ERR_RPAREN_EXPECTED,
ERR_LBRACK_EXPECTED,
ERR_ILLEGAL_MODIFIER,
ERR_ILLEGAL_QUALIFIER,
ERR_ILLEGAL_STORAGE_CLASS,
+ ERR_ILLEGAL_ATTRIBUTE,
ERR_ILLEGAL_SEG_NAME,
ERR_DIV_BY_ZERO,
ERR_MOD_BY_ZERO,
-#include "../common/xmalloc.h"
-
+/* common */
+#include "xmalloc.h"
+
+/* cc65 */
#include "anonname.h"
#include "asmlabel.h"
#include "codegen.h"
#include "cmdline.h"
#include "fname.h"
#include "target.h"
+#include "tgttrans.h"
#include "version.h"
#include "xmalloc.h"
default:
AbEnd ("Unknown target system type");
- }
+ }
+
+ /* Initialize the translation tables for the target system */
+ TgtTranslateInit ();
}
cpu.o \
datatype.o \
declare.o \
+ declattr.o \
error.o \
expr.o \
exprheap.o \
cpu.obj \
datatype.obj \
declare.obj \
+ declattr.obj \
error.obj \
expr.obj \
exprheap.obj \
FILE cpu.obj
FILE datatype.obj
FILE declare.obj
+FILE declattr.obj
FILE error.obj
FILE expr.obj
FILE exprheap.obj
#include <string.h>
#include <errno.h>
#include <ctype.h>
-
+
/* common */
#include "tgttrans.h"
nxtval = SignExtendChar (TgtTranslateChar (C));
/* Character constants have type int */
- nxttype = type_int;
+ nxttype = type_int;
}
+void ConsumeComma (void)
+/* Check for a comma and skip it. */
+{
+ /* Try do be smart about typos... */
+ if (CurTok.Tok == TOK_COMMA) {
+ NextToken ();
+ } else {
+ Error (ERR_COMMA_EXPECTED);
+ if (CurTok.Tok == TOK_SEMI) {
+ NextToken ();
+ }
+ }
+}
+
+
+
void ConsumeLParen (void)
/* Check for a left parenthesis and skip it */
{
void ConsumeSemi (void);
/* Check for a semicolon and skip it. */
+void ConsumeComma (void);
+/* Check for a comma and skip it. */
+
void ConsumeLParen (void);
/* Check for a left parenthesis and skip it */