home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / misc / toolboxsas.lha / Toolbox / lib / lalr / Scanner.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-15  |  543 b   |  32 lines

  1. /* $Id: Scanner.c,v 2.6 1992/08/07 15:28:42 grosch rel $ */
  2.  
  3. $@ #include "$.h"
  4. #include <stdio.h>
  5.  
  6.  
  7. $@ $_tScanAttribute $_Attribute    = {{1,0}};
  8.  
  9.  
  10. $@ int $_GetToken(void)
  11.  {
  12.   char ch;
  13.  
  14.   do
  15.    {
  16.     ch = getchar();
  17.     if (ch == '\n')
  18.      {
  19. $@      $_Attribute.Position.Column = 0;
  20. $@      $_Attribute.Position.Line++;
  21.      }
  22.     else
  23. $@      $_Attribute.Position.Column++;
  24.    }
  25.   while (ch == ' ' || ch == '\t' || ch == '\n');
  26.   return(ch == -1 ? 0 : ch);
  27.  }
  28.  
  29.  
  30. $@ void $_ErrorAttribute(short yyToken, $_tScanAttribute *yyRepairAttribute)
  31.  {}
  32.