/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
+** Splint - annotation-assisted static program checker
+** Copyright (C) 1994-2003 University of Virginia,
** Massachusetts Institute of Technology
**
** This program is free software; you can redistribute it and/or modify it
** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
** MA 02111-1307, USA.
**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
+** For information on splint: info@splint.org
+** To report a bug: splint-bug@splint.org
+** For more information: http://www.splint.org
*/
/*
** scanline.c
** and determine its kind.
*/
-# include "lclintMacros.nf"
-# include "llbasic.h"
+# include "splintMacros.nf"
+# include "basic.h"
# include "signature.h"
# include "signature2.h"
# include "scan.h"
/*@notfunction@*/
# define MOVECHAR() do { *bufptr++ = c; c = *currentLine++; colNumber++; } while (FALSE)
-/*@constant static int MAXCHAR;@*/
-# define MAXCHAR 512
+/* evans 2003-04-21: changed name to avoid conflict with MS VC++ */
+/*@constant static int SCANMAXCHAR;@*/
+# define SCANMAXCHAR 512
/*@constant static int TABSIZE;@*/
# define TABSIZE 8
static charClassData charClass[LASTCHAR + 1];
-static unsigned int colNumber;
-static unsigned int startCol;
+static int colNumber;
+static int startCol;
static bool reportEOL;
static bool reportComments;
-static char tokenBuffer[MAXCHAR];
+static char tokenBuffer[SCANMAXCHAR];
static const charClassData charClassDef[] =
{
}
ltoken_setCol (newToken, startCol);
- ltoken_setLine (newToken, tsource_thisLineNumber (LSLScanSource ()));
- ltoken_setFileName (newToken, tsource_fileName (LSLScanSource ()));
+ ltoken_setLine (newToken, inputStream_thisLineNumber (LSLScanSource ()));
+ ltoken_setFileName (newToken, inputStream_fileName (LSLScanSource ()));
if (ltoken_getCode (newToken) == LST_COMMENTSYM)
{
lsymbol_fromChars ("E O F"),
0, TRUE));
ltoken_setCol (t, colNumber);
- ltoken_setLine (t, tsource_thisLineNumber (LSLScanSource ()));
- ltoken_setFileName (t, tsource_fileName (LSLScanSource ()));
+ ltoken_setLine (t, inputStream_thisLineNumber (LSLScanSource ()));
+ ltoken_setFileName (t, inputStream_fileName (LSLScanSource ()));
return t;
}
static void
LocalUserError (char *msg)
{
- tsource *s = LSLScanSource ();
- llfatalerror (message ("%s:%u,%u: %s",
- cstring_fromChars (tsource_fileName (s)),
- tsource_thisLineNumber (s), colNumber,
+ inputStream s = LSLScanSource ();
+ llfatalerror (message ("%s:%d,%d: %s",
+ inputStream_fileName (s),
+ inputStream_thisLineNumber (s), colNumber,
cstring_fromChars (msg)));
}
ltoken_compose = LSLReserveToken (LST_COMPOSESYM, "\\composeSort");
ltoken_if = LSLReserveToken (LST_ifTOKEN, "if");
- (void) LSLReserveToken (LST_LPAR, "(");
+ (void) LSLReserveToken (LST_LPAR, " (");
(void) LSLReserveToken (LST_RPAR, ")");
(void) LSLReserveToken (LST_COMMA, ",");
(void) LSLReserveToken (LST_COLON, ":");
charCode lscanCharClass (char c)
{
- return charClass[(int)(c)].code;
+ return charClass[ (int) (c)].code;
}
bool LSLIsEndComment (char c)
{
- return charClass[(int)(c)].endCommentChar;
+ return charClass[ (int) (c)].endCommentChar;
}
void lsetCharClass (char c, charCode cod)
{
- charClass[(int)(c)].code = cod;
+ charClass[ (int) (c)].code = cod;
}
void lsetEndCommentChar (char c, bool flag)
{
- charClass[(int)(c)].endCommentChar = flag;
+ charClass[ (int) (c)].endCommentChar = flag;
}