home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / gnusmalltalk / mstsym.h < prev    next >
C/C++ Source or Header  |  1992-02-15  |  3KB  |  111 lines

  1. /***********************************************************************
  2.  *
  3.  *    Symbol Table declarations
  4.  *
  5.  ***********************************************************************/
  6.  
  7. /***********************************************************************
  8.  *
  9.  * Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc.
  10.  * Written by Steve Byrne.
  11.  *
  12.  * This file is part of GNU Smalltalk.
  13.  *
  14.  * GNU Smalltalk is free software; you can redistribute it and/or modify it
  15.  * under the terms of the GNU General Public License as published by the Free
  16.  * Software Foundation; either version 1, or (at your option) any later 
  17.  * version.
  18.  * 
  19.  * GNU Smalltalk is distributed in the hope that it will be useful, but WITHOUT
  20.  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
  21.  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  22.  * more details.
  23.  * 
  24.  * You should have received a copy of the GNU General Public License along with
  25.  * GNU Smalltalk; see the file COPYING.  If not, write to the Free Software
  26.  * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  
  27.  *
  28.  ***********************************************************************/
  29.  
  30.  
  31. /*
  32.  *    Change Log
  33.  * ============================================================================
  34.  * Author      Date       Change 
  35.  * sbyrne    13 Jan 90      Added thisContextSymbol.
  36.  *
  37.  * sbyrne     1 Jan 89      Created.
  38.  *
  39.  */
  40.  
  41. #ifndef __MSTSYM__
  42. #define __MSTSYM__
  43.  
  44. #define INITIAL_SYMBOL_TABLE_SIZE    521
  45.  
  46. /* Uncomment this to enable profiling of the symbol table */
  47. /*#define symbol_table_profiling */
  48.  
  49. typedef enum {
  50.   temporaryScope,
  51.   receiverScope,
  52.   poolScope,
  53.   globalScope
  54. } ScopeType;
  55.  
  56.  
  57.  
  58. typedef struct SymbolStruct {
  59.   OBJ_HEADER;            /* I love inheritance */
  60.   char        symString[1];
  61. } *Symbol;
  62.  
  63. typedef struct SymbolEntryStruct {
  64.   ScopeType    scope;
  65.   OOP        symbol;
  66.   int        varIndex;    /* index of receiver or temporary */
  67. } *SymbolEntry;
  68.  
  69. extern SymbolEntry    findVariable();
  70.  
  71. extern OOP        atColonSymbol, atColonPutColonSymbol, sizeSymbol,
  72.             nextSymbol, nextPutColonSymbol, atEndSymbol, 
  73.               classSymbol, blockCopyColonSymbol, valueSymbol,
  74.             valueColonValueColonSymbol,
  75.             valueColonValueColonValueColonSymbol,
  76.              valueWithArgumentsColonSymbol,
  77.             valueColonSymbol, doColonSymbol, newSymbol,
  78.             newColonSymbol, plusSymbol, minusSymbol,
  79.             lessThanSymbol, greaterThanSymbol, lessEqualSymbol,
  80.             greaterEqualSymbol, equalSymbol, notEqualSymbol,
  81.             timesSymbol, divideSymbol, remainderSymbol,
  82.             bitShiftColonSymbol, integerDivideSymbol,
  83.             bitAndColonSymbol, bitOrColonSymbol, sameObjectSymbol,
  84.               notSameObjectSymbol,
  85.               whileTrueColonSymbol, whileFalseColonSymbol,
  86.             ifTrueColonSymbol, ifFalseColonSymbol, 
  87.             ifTrueColonIfFalseColonSymbol,
  88.               ifFalseColonIfTrueColonSymbol, andColonSymbol,
  89.             orColonSymbol, selfSymbol, superSymbol, trueSymbol,
  90.               falseSymbol, nilSymbol, orSymbol, andSymbol,
  91.             doesNotUnderstandColonSymbol, unknownSymbol,
  92.             charSymbol, stringSymbol, stringOutSymbol, 
  93.             symbolSymbol, intSymbol, longSymbol, doubleSymbol,
  94.             voidSymbol, variadicSymbol, cObjectSymbol,
  95.             smalltalkSymbol, symbolTable, thisContextSymbol,
  96.                         byteArraySymbol, byteArrayOutSymbol;
  97.  
  98. extern OOP        internString(),
  99.               makeInstanceVariableArray(),
  100.             makeClassVariableDictionary(),
  101.             makePoolArray(), 
  102.             internStringOOP();
  103.  
  104. extern char        *symbolAsString();
  105.  
  106. int            stringOOPLen();
  107. void            printString();
  108.  
  109.  
  110. #endif /* __MSTSYM__ */
  111.