scc.h

来自「C人工智能游戏开发的一些实例源代码 C Game development in 」· C头文件 代码 · 共 37 行

H
37
字号
#ifndef __SCC_H__
#define __SCC_H__

// Silly useless VC++ warnings...
#pragma warning( disable : 4786 )

#include <assert.h>
#include <string>
#include <map>

#include "PTNode.H"

// The symbol table contains mappings from a string that the script contains
// to the compiler's identifier node that represents this symbol.  The symbol
// table ensures that all references to a variable points to the same internal
// data structure.  In a more sophisticated compiler, the symbol table is more
// sophisticated to allow for scopes, objects, functions, etc.
using namespace std;

typedef map< string, IdentifierNodePtr > SymbolTable;
extern SymbolTable symtbl;


// Every rule in Bison have an associated type or "lvalue".  Bison expects a
// program to override the 'YYSTYPE' macro with the type name.  Here, we
// define all rules in Bison are a PTNode smart pointer.
#define YYSTYPE PTNodePtr

// Extern a few functions that are needed by Flex & Bison to communicate to
// each other.
extern int yyerror( char *err );
extern int yylex();
extern int yyparse();


#endif // __SCC_H__

⌨️ 快捷键说明

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