scanner.h

来自「C-Talk is interpreted scripting language」· C头文件 代码 · 共 42 行

H
42
字号
#ifndef __SCANNER_H__
#define __SCANNER_H__

#include "ctalk.h"

#define GET_BUF_SIZE 1024

class CtkScanner { 
    FILE* yyfile;
    char  yybuf[GET_BUF_SIZE+1];
    char* yyptr;

   public:
    int   yyline;

    void  reset(FILE* f);
    int   get();

    void  error(char const* msg);

    static CtkScanner instance;
};

#define TOKEN_HASH_TABLE_SIZE 13135

struct CtkToken;

class CtkSymbolTable { 
    CtkToken* tokenHashTable[TOKEN_HASH_TABLE_SIZE];
    int       nSymbols;

   public:
    CtkToken* add(char const* name, int tag);

    static CtkSymbolTable instance;

    CtkSymbolTable();
    ~CtkSymbolTable();
};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?