]> granicus.if.org Git - yasm/commitdiff
Remove some unused yasm_scanner variables, and properly document the
authorPeter Johnson <peter@tortall.net>
Thu, 2 Nov 2006 07:44:09 +0000 (07:44 -0000)
committerPeter Johnson <peter@tortall.net>
Thu, 2 Nov 2006 07:44:09 +0000 (07:44 -0000)
remaining ones.

svn path=/trunk/yasm/; revision=1678

libyasm/file.c
libyasm/file.h
modules/parsers/gas/gas-token.re
modules/parsers/nasm/nasm-token.re

index 30515cf44143f7d93460819bcf44005efaf06447..63f37b942f090627cb35a1cba5263f0b094d0634 100644 (file)
@@ -54,13 +54,9 @@ yasm_scanner_initialize(yasm_scanner *s)
     s->tok = NULL;
     s->ptr = NULL;
     s->cur = NULL;
-    s->pos = NULL;
     s->lim = NULL;
     s->top = NULL;
     s->eof = NULL;
-    s->tchar = 0;
-    s->tline = 0;
-    s->cline = 1;
 }
 
 void
@@ -90,7 +86,6 @@ yasm_fill_helper(yasm_scanner *s, unsigned char **cursor,
        s->tok = s->bot;
        s->ptr -= cnt;
        *cursor -= cnt;
-       s->pos -= cnt;
        s->lim -= cnt;
     }
     if (!s->bot)
@@ -101,7 +96,6 @@ yasm_fill_helper(yasm_scanner *s, unsigned char **cursor,
        s->tok = buf;
        s->ptr = &buf[s->ptr - s->bot];
        *cursor = &buf[*cursor - s->bot];
-       s->pos = &buf[s->pos - s->bot];
        s->lim = &buf[s->lim - s->bot];
        s->top = &s->lim[BSIZE];
        if (s->bot)
index d81061d2b960b556fb10443ac55da1f6bc123aef..3569dd2f5c2c73bb644a60578f82c50b7bc56c34 100644 (file)
 
 /** Re2c scanner state. */
 typedef struct yasm_scanner {
-    unsigned char *bot, *tok, *ptr, *cur, *pos, *lim, *top, *eof;
-    unsigned int tchar, tline, cline;
+    unsigned char *bot;            /**< Bottom of scan buffer */
+    unsigned char *tok;            /**< Start of token */
+    unsigned char *ptr;            /**< Scan marker */
+    unsigned char *cur;            /**< Cursor (1 past end of token) */
+    unsigned char *lim;            /**< Limit of good data */
+    unsigned char *top;            /**< Top of scan buffer */
+    unsigned char *eof;            /**< End of file */
 } yasm_scanner;
 
 /** Initialize scanner state.
index db08de4a9e8ac97280b3422003ff2dcb988f689c..64fdebb1e93881bfc78c770796100cfb837aa0c0 100644 (file)
@@ -46,11 +46,7 @@ RCSID("$Id$");
 
 #define RETURN(i)      {s->cur = cursor; return i;}
 
-#define SCANINIT()     { \
-       s->tchar = cursor - s->pos; \
-       s->tline = s->cline; \
-       s->tok = cursor; \
-    }
+#define SCANINIT()     {s->tok = cursor;}
 
 #define TOK            ((char *)s->tok)
 #define TOKLEN         (size_t)(cursor-s->tok)
@@ -149,7 +145,6 @@ fill(yasm_parser_gas *parser_gas, YYCTYPE *cursor)
            s->tok = s->bot;
            s->ptr -= cnt;
            cursor -= cnt;
-           s->pos -= cnt;
            s->lim -= cnt;
        }
        if (!s->bot)
@@ -160,7 +155,6 @@ fill(yasm_parser_gas *parser_gas, YYCTYPE *cursor)
            s->tok = buf;
            s->ptr = &buf[s->ptr - s->bot];
            cursor = &buf[cursor - s->bot];
-           s->pos = &buf[s->pos - s->bot];
            s->lim = &buf[s->lim - s->bot];
            s->top = &s->lim[BSIZE];
            if (s->bot)
@@ -712,7 +706,6 @@ rept_scan:
                    s->tok = NULL;
                    s->ptr = NULL;
                    s->cur = NULL;
-                   s->pos = NULL;
                    s->lim = NULL;
                    s->top = NULL;
                    s->eof = NULL;
index d2879a886cfd87ee7a33e8c94b6e9221c493edc9..2dab17de0a9809030be3ac8eb9bc9735c4825802 100644 (file)
@@ -45,11 +45,7 @@ RCSID("$Id$");
 
 #define RETURN(i)      {s->cur = cursor; return i;}
 
-#define SCANINIT()     { \
-       s->tchar = cursor - s->pos; \
-       s->tline = s->cline; \
-       s->tok = cursor; \
-    }
+#define SCANINIT()     {s->tok = cursor;}
 
 #define TOK            ((char *)s->tok)
 #define TOKLEN         (size_t)(cursor-s->tok)