/* */
/* */
/* */
-/* (C) 2000-2002 Ullrich von Bassewitz */
+/* (C) 2000-2003 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@musoftware.de */
D = AllocIf (".IFBLANK", 1);
NextTok ();
if (IfCond) {
- if (Tok == TOK_SEP) {
+ if (TokIsSep (Tok)) {
SetIfCond (D, 1);
} else {
SetIfCond (D, 0);
D = AllocIf (".IFNBLANK", 1);
NextTok ();
if (IfCond) {
- if (Tok == TOK_SEP) {
+ if (TokIsSep (Tok)) {
SetIfCond (D, 0);
} else {
SetIfCond (D, 1);
/* */
/* */
/* */
-/* (C) 1998-2000 Ullrich von Bassewitz */
+/* (C) 1998-2003 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@musoftware.de */
*Bank = *Expr = 0;
- if (Tok == TOK_SEP) {
+ if (TokIsSep (Tok)) {
*AddrMode = AM_IMPLICIT;
}
- } else {
+ } else {
*AddrMode = AM_ABS | AM_DIR;
/* */
/* */
/* */
-/* (C) 1998-2002 Ullrich von Bassewitz */
+/* (C) 1998-2003 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@musoftware.de */
} else {
/* Skip any tokens */
int Braces = 0;
- while (Tok != TOK_SEP && Tok != TOK_EOF) {
+ while (!TokIsSep (Tok)) {
if (Tok == TOK_LPAREN) {
++Braces;
} else if (Tok == TOK_RPAREN) {
while (Tok != TOK_COMMA) {
/* We may not end-of-line of end-of-file here */
- if (Tok == TOK_SEP || Tok == TOK_EOF) {
+ if (TokIsSep (Tok)) {
Error (ERR_UNEXPECTED_EOL);
return 0;
}
while (Tok != TOK_RPAREN) {
/* We may not end-of-line of end-of-file here */
- if (Tok == TOK_SEP || Tok == TOK_EOF) {
+ if (TokIsSep (Tok)) {
Error (ERR_UNEXPECTED_EOL);
return 0;
}
* will check for the closing paren, we don't need to print an error
* here, just bail out.
*/
- if (Tok == TOK_SEP || Tok == TOK_EOF) {
+ if (TokIsSep (Tok)) {
break;
}
/* */
/* */
/* */
-/* (C) 1998-2000 Ullrich von Bassewitz */
+/* (C) 1998-2003 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@musoftware.de */
}
} else {
/* Accept a newline or end of file for new style macros */
- if (Tok == TOK_SEP || Tok == TOK_EOF) {
+ if (TokIsSep (Tok)) {
break;
}
}
* generated by a user.
*/
unsigned PrefixLen = (I->Id[0] == LocalStart);
- sprintf (SVal, "%.*sLOCAL-MACRO-SYMBOL-%04X", PrefixLen,
+ sprintf (SVal, "%.*sLOCAL-MACRO-SYMBOL-%04X", PrefixLen,
I->Id, Mac->LocalStart + Index);
break;
}
E = NewMacExp (M);
/* Read the actual parameters */
- while (Tok != TOK_SEP && Tok != TOK_EOF) {
+ while (!TokIsSep (Tok)) {
TokNode* Last;
/* Read tokens for one parameter, accept empty params */
Last = 0;
- while (Tok != TOK_COMMA && Tok != TOK_SEP) {
+ while (!TokIsSep (Tok)) {
TokNode* T;
TokNode* Last;
/* Check if there is really a parameter */
- if (Tok == TOK_SEP || Tok == TOK_EOF || Tok == TOK_COMMA) {
+ if (TokIsSep (Tok) || Tok == TOK_COMMA) {
Error (ERR_MACRO_PARAM_EXPECTED);
SkipUntilSep ();
return;
/* Insert it into the list */
if (Last == 0) {
- E->Params [E->ParamCount] = T;
+ E->Params [E->ParamCount] = T;
} else {
- Last->Next = T;
+ Last->Next = T;
}
Last = T;
/* And skip it... */
NextTok ();
- } while (Tok != TOK_COMMA && Tok != TOK_SEP && Tok != TOK_EOF);
+ } while (Tok != TOK_COMMA && !TokIsSep (Tok));
/* One parameter more */
++E->ParamCount;
/* */
/* */
/* */
-/* (C) 2000 Ullrich von Bassewitz */
-/* Wacholderweg 14 */
-/* D-70597 Stuttgart */
-/* EMail: uz@musoftware.de */
+/* (C) 2000-2003 Ullrich von Bassewitz */
+/* Wacholderweg 14 */
+/* D-70597 Stuttgart */
+/* EMail: uz@musoftware.de */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
while (Parens != 0 || Tok != TOK_RPAREN) {
/* Check for end of line or end of input */
- if (Tok == TOK_SEP || Tok == TOK_EOF) {
+ if (TokIsSep (Tok)) {
Error (ERR_UNEXPECTED_EOL);
return List;
}
void SkipUntilSep (void)
/* Skip tokens until we reach a line separator or end of file */
{
- while (Tok != TOK_SEP && Tok != TOK_EOF) {
+ while (!TokIsSep (Tok)) {
NextTok ();
}
}
/* */
/* */
/* */
-/* (C) 1998-2002 Ullrich von Bassewitz */
+/* (C) 1998-2003 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@musoftware.de */
case 1: *Flag = 1; NextTok (); break;
default: ErrorSkip (ERR_ONOFF_EXPECTED); break;
}
- } else if (Tok == TOK_SEP || Tok == TOK_EOF) {
+ } else if (TokIsSep (Tok)) {
/* Without anything assume switch on */
*Flag = 1;
} else {
/* common */
#include "filepos.h"
+#include "inline.h"
TOK_PLUS, /* + */
TOK_MINUS, /* - */
- TOK_MUL, /* * */
+ TOK_MUL, /* * */
TOK_STAR = TOK_MUL, /* Alias */
TOK_DIV, /* / */
TOK_MOD, /* ! */
int TokHasIVal (enum Token Tok);
/* Return true if the given token has an attached IVal */
+#if defined(HAVE_INLINE)
+INLINE int TokIsSep (enum Token T)
+/* Return true if this is a separator token */
+{
+ return (T == TOK_SEP || T == TOK_EOF);
+}
+#else
+# define TokIsSep(T) (T == TOK_SEP || T == TOK_EOF)
+#endif
+
int GetSubKey (const char** Keys, unsigned Count);
/* Search for a subkey in a table of keywords. The current token must be an
* identifier and all keys must be in upper case. The identifier will be