home *** CD-ROM | disk | FTP | other *** search
/ AI Game Programming Wisdom / AIGameProgrammingWisdom.iso / SourceCode / 10 Scripting / 02 Berger / scc / SCC.H < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-16  |  1.1 KB  |  37 lines

  1. #ifndef __SCC_H__
  2. #define __SCC_H__
  3.  
  4. // Silly useless VC++ warnings...
  5. #pragma warning( disable : 4786 )
  6.  
  7. #include <assert.h>
  8. #include <string>
  9. #include <map>
  10.  
  11. #include "PTNode.H"
  12.  
  13. // The symbol table contains mappings from a string that the script contains
  14. // to the compiler's identifier node that represents this symbol.  The symbol
  15. // table ensures that all references to a variable points to the same internal
  16. // data structure.  In a more sophisticated compiler, the symbol table is more
  17. // sophisticated to allow for scopes, objects, functions, etc.
  18. using namespace std;
  19.  
  20. typedef map< string, IdentifierNodePtr > SymbolTable;
  21. extern SymbolTable symtbl;
  22.  
  23.  
  24. // Every rule in Bison have an associated type or "lvalue".  Bison expects a
  25. // program to override the 'YYSTYPE' macro with the type name.  Here, we
  26. // define all rules in Bison are a PTNode smart pointer.
  27. #define YYSTYPE PTNodePtr
  28.  
  29. // Extern a few functions that are needed by Flex & Bison to communicate to
  30. // each other.
  31. extern int yyerror( char *err );
  32. extern int yylex();
  33. extern int yyparse();
  34.  
  35.  
  36. #endif // __SCC_H__
  37.