www.pudn.com > 12cocorc.zip > SCAN_C.FRM


//**************************************************************** 
//   CPLUS2\SCAN_C.FRM 
//   Coco/R C++ Support Frames. 
//   Author: Frankie Arzu  
// 
//   Jun 12, 1996  Version 1.06 
//      Many fixes and suggestions thanks to 
//      Pat Terry  
//**************************************************************** 
 
#include -->TokensHeader 
#include -->ScanHeader 
 
#define Scan_Ch        Ch 
#define Scan_NextCh    NextCh 
#define Scan_ComEols   ComEols 
#define Scan_CurrLine  CurrLine 
#define Scan_CurrCol   CurrCol 
#define Scan_LineStart LineStart 
#define Scan_BuffPos   BuffPos 
#define Scan_NextLen   NextSym.Len 
 
int -->ScanClass::STATE0[] = {-->State0}; 
 
int -->ScanClass::CheckLiteral(int id) 
{ char c; 
  c =  CurrentCh(NextSym.Pos); 
  if (IgnoreCase) c = Upcase(c); 
  switch (c) { 
  -->Literals 
  } 
  return id; 
} 
 
int -->ScanClass::Comment() 
{ int Level, StartLine, OldCol; 
  long OldLineStart; 
 
  Level = 1; StartLine = CurrLine; 
  OldLineStart = LineStart; OldCol = CurrCol; 
  -->Comment 
  return 0; 
} 
 
int -->ScanClass::Get() 
{ int state, ctx; 
 
  start: 
    -->GetIgnore 
    -->GetComment 
 
    CurrSym = NextSym; 
    NextSym.Init(0, CurrLine, CurrCol - 1, BuffPos, 0); 
    NextSym.Len  = 0; ctx = 0; 
 
    if (Ch == EOF_CHAR) return EOFSym; 
    state = STATE0[Ch]; 
    while(1) { 
      Scan_NextCh(); NextSym.Len++; 
      switch (state) { 
      -->GetDFA 
      default: return NoSym; /* Scan_NextCh already done */ 
      } 
    } 
}