/* */
/* */
/* */
-/* (C) 1998-2002 Ullrich von Bassewitz */
-/* Wacholderweg 14 */
-/* D-70597 Stuttgart */
-/* EMail: uz@musoftware.de */
+/* (C) 1998-2003 Ullrich von Bassewitz */
+/* Römerstrasse 52 */
+/* D-70794 Filderstadt */
+/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
"Duplicate `.ELSE'",
"Conditional assembly branch was never closed",
"Lexical level was not terminated correctly",
+ "No open lexical level",
"Segment attribute mismatch",
"Segment stack overflow",
"Segment stack is empty",
"CPU not supported",
"Counter underflow",
"Undefined label",
- "Open `%s´",
+ "Open `%s'",
"File name `%s' not found in file table",
};
/* */
/* */
/* */
-/* (C) 1998-2002 Ullrich von Bassewitz */
-/* Wacholderweg 14 */
-/* D-70597 Stuttgart */
-/* EMail: uz@musoftware.de */
+/* (C) 1998-2003 Ullrich von Bassewitz */
+/* Römerstrasse 52 */
+/* D-70794 Filderstadt */
+/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
ERR_DUPLICATE_ELSE,
ERR_OPEN_IF,
ERR_OPEN_PROC,
+ ERR_NO_OPEN_PROC,
ERR_SEG_ATTR_MISMATCH,
ERR_SEGSTACK_OVERFLOW,
ERR_SEGSTACK_EMPTY,
static void DoEndProc (void)
/* Leave a lexical level */
-{
- SymLeaveLevel ();
+{
+ if (!SymIsLocalLevel ()) {
+ /* No local symbol table level open */
+ ErrorSkip (ERR_NO_OPEN_PROC);
+ } else {
+ SymLeaveLevel ();
+ }
}
void SymLeaveLevel (void)
/* Leave the current lexical level */
-{
+{
SymTab = SymTab->BackLink;
}
+int SymIsLocalLevel (void)
+/* Return true if we ae on a local symbol table level. */
+{
+ return (SymTab != RootTab);
+}
+
+
+
void SymDef (const char* Name, ExprNode* Expr, int ZP, int Label)
/* Define a new symbol */
{
void SymLeaveLevel (void);
/* Leave the current lexical level */
+int SymIsLocalLevel (void);
+/* Return true if we ae on a local symbol table level. */
+
void SymDef (const char* Name, ExprNode* Expr, int ZP, int Label);
/* Define a new symbol */
/* Mark the given symbol as a global symbol, that is, as a symbol that is
* either imported or exported.
*/
-
+
void SymGlobalZP (const char* Name);
/* Mark the given symbol as a global zeropage symbol, that is, as a symbol
* that is either imported or exported.