?? cr_abs.hpp
字號(hào):
//**********************************************************
// CR_ABS.HPP
// Coco/R C++ Support Library.
// Author: Frankie Arzu <farzu@uvg.edu.gt>
//
// Jun 12, 1996 Version 1.06
// Many fixes and suggestions thanks to
// Pat Terry <cspt@cs.ru.ac.za>
// May 05, 1999 Version 1.12
// Added options to retrieve token info
//**********************************************************
#ifndef CR_ABS
#define CR_ABS
#include <stdlib.h>
class AbsToken {
// Abstract Token
public:
int Sym; // Token Number
int Line, Col; // line and column of current Token
int Len; // length of current Token
long Pos; // file position of current Token
int GetSym()
{ return Sym; }
int SetSym(int sym)
{ return Sym = sym; };
long GetPos()
{ return Pos; };
void Init(int sym = 0, int line = 0, int col = 0, long pos = 0, int len = 0)
{ Sym = sym; Line = line; Col = col; Pos = pos; Len = len; };
};
class AbsScanner {
// Abstract Scanner
public:
AbsToken CurrSym; // current (most recently parsed) token
AbsToken NextSym; // next (look ahead) token
virtual int Get() = 0;
// Retrieves next token
virtual void Reset() = 0;
// Reset the scanner
virtual unsigned char CurrentCh(long pos) = 0;
// Returns character at position pos in source file
virtual void GetString(AbsToken *Sym, char *Buffer, int Max) = 0;
// Retrieves at most Max characters from Sym into Buffer
virtual void GetString(long Pos, char *Buffer, int Max) = 0;
// Retrieves at most Max characters from position Pos into Buffer
virtual void GetName(AbsToken *Sym, char *Buffer, int Max) = 0;
// Retrieves at most Max characters from Sym into Buffer
// Buffer is capitalized if IGNORE CASE was specified
virtual long GetLine(long Pos, char *Line, int Max) = 0;
// Retrieves at most Max characters (or until next line break)
// from position Pos in source file into Line
};
class AbsError {
// Abstract Error Reporting
public:
virtual void Store(int nr, int line, int col, long pos) = 0;
// Records that error nr has been detected at specified position
virtual void StoreErr(int nr, AbsToken &Token) = 0;
// Associates error nr with Token
virtual void StoreWarn(int nr, AbsToken &Token) = 0;
// Associates warning nr with Token
virtual void SummarizeErrors() = 0;
// Reports on all errors recorded
};
#endif // CR_ABS
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -