# include "cscannerHelp.h"
# include "cscanner.h"
# include "cgrammar_tokens.h"
+# include "osd.h"
static int lminput (void);
static int s_tokLength = 0;
}
else /* if (c == '@') */
{
- llassert (FALSE); /*@i23@*/
+ llassert (FALSE);
+
if (cscannerHelp_handleLlSpecial () != BADTOK)
{
llerrorlit (FLG_SYNTAX, "Macro cannot use special syntax");
cstring_free (exname);
}
+
+ cscannerHelp_handleNewLine (); // evans 2003-10-27: pragment increments line
}
else if (cstring_equalPrefixLit (olc, "ident"))
{
/* Some pre-processors will leave these in the code. Ignore rest of line */
+ cscannerHelp_handleNewLine (); // evans 2003-10-27: ident increments line
}
+
/*
** Yuk...Win32 filenames can have spaces in them...we need to read
** to the matching end quote.
}
llassert (*tmp == '\"');
-
tmp++;
-
fname = tmp;
while (*tmp != '\"' && *tmp != '\0')
}
llassert (*tmp == '\"');
-
*tmp = '\0';
# if defined(OS2) || defined(MSDOS) || defined(WIN32)
** We handle a plain # in the input file, by echoing it, and ignoring it in the post-pp-file.
*/
mstring_free (ol);
+ cscannerHelp_handleNewLine (); // evans 2003-10-27: increments line
return FALSE;
} else {
voptgenerror
message ("Unrecognized pre-processor directive: #%s",
cstring_fromChars (ol)),
g_currentloc);
+ cscannerHelp_handleNewLine (); // evans 2003-10-27: increments line
}
sfree (ol);
s = mstring_append (s, c);
charsread++;
}
- /*@i888@*/ }
+ /*@-branchstate@*/
+ } /* spurious (?) warnings about s */
+ /*@=branchstate@*/
DPRINTF (("Read: %s / %s", s, fileloc_unparse (g_currentloc)));
if (annotationInfo_isDefined (ainfo)) {
DPRINTF (("Found annotation: %s", annotationInfo_unparse (ainfo)));
- /*@i324@*/ yylval.annotation = ainfo;
+ yylval.annotation = ainfo;
s_tokLength = 0;
sfree (os);
sfree (t);
message ("Semantic comment unrecognized: %s",
cstring_fromChars (os)),
loc);
- /*@i888@*/ }
+ /*@-branchstate@*/
+ } /* spurious (?) warning about t */
+ /*@=branchstate@*/
sfree (t);
}
if (annotationInfo_isDefined (ainfo))
{
DPRINTF (("Found annotation: %s", annotationInfo_unparse (ainfo)));
- /*@i324@*/ yylval.annotation = ainfo;
+ yylval.annotation = ainfo;
return CANNOTATION;
}
else
if (uentry_isIter (le))
{
- /*@i32@*/ yylval.entry = le;
+ yylval.entry = le;
return (ITER_NAME);
}
else if (uentry_isEndIter (le))
{
- /*@i32@*/ yylval.entry = le;
+ yylval.entry = le;
return (ITER_ENDNAME);
}
else if (uentry_isUndefined (le))
}
else
{
- /*@i32@*/ yylval.entry = le;
+ yylval.entry = le;
return (IDENTIFIER);
}
}
}
else
{
- /*@i32@*/ yylval.entry = le;
+ yylval.entry = le;
return (IDENTIFIER);
}
{
return (tok == QMAXSET || tok == QMAXREAD);
/* || tok == QMINREAD || tok == QMINSET */
- /*@i4523@*/
/* uncomment the additional if statement tests when minSet and minRead are supported */
}
int cscannerHelp_returnToken (int t)
{
- yylval.tok = lltok_create (t, fileloc_decColumn (g_currentloc, s_tokLength));
+ if (s_tokLength > fileloc_column (g_currentloc)) {
+ yylval.tok = lltok_create (t, fileloc_copy (g_currentloc));
+ } else {
+ yylval.tok = lltok_create (t, fileloc_decColumn (g_currentloc, s_tokLength));
+ }
+
s_tokLength = 0;
s_lastWasString = FALSE;
return (t);