
#line 1 "symb.ch"
/*************************************************************************/
#line 1 "symb.ch"
/*                                                                       */
#line 1 "symb.ch"
/*        Produced by Metachop version 2.0  -    1989-1995               */
#line 1 "symb.ch"
/*     Tree      Meta     Chopper      developped    by                  */
#line 1 "symb.ch"
/*                  Eric Lavillonniere                                   */
#line 1 "symb.ch"
/*                                                                       */
#line 1 "symb.ch"
/*************************************************************************/
#line 1 "symb.ch"
#line 1 "symb.ch"
#include "token.h"
#line 1 "symb.ch"
extern int _retVal[50];
#line 1 "symb.ch"
extern PPTREE _storeVal[50],_nextVal;
#line 1 "symb.ch"
extern PPTREE stackTree[1024];
#line 1 "symb.ch"
extern int ptStackTree;
#line 1 "symb.ch"
#define decomp decomp_sgt
#line 1 "symb.ch"
#line 1 "symb.ch"
#ifndef for_elem
#line 1 "symb.ch"
#line 1 "symb.ch"
#define for_elem _for_elem
#line 1 "symb.ch"
#endif
#ifdef INCONNU
#line 1 "symb.ch"
#line 1 "symb.ch"
PTREE   for_elem ;
#line 1 "symb.ch"
#line 1 "symb.ch"
#endif
#include "symb.h"

#line 5 "symb.ch"
#line 5 "symb.ch"
int SymbolTable::AddLevel ()
#line 5 "symb.ch"
{
#line 5 "symb.ch"
#line 10 "symb.ch"
    if ( pvSize == pvSizeMax ) {
#line 10 "symb.ch"
#line 11 "symb.ch"
                                    if ( !pvTable ) 
#line 11 "symb.ch"
#line 12 "symb.ch"
                                        pvTable = (TabList **)malloc((pvSizeMax = 10) * sizeof(TabList *));
#line 12 "symb.ch"
                                    else 
#line 14 "symb.ch"
                                    {
#line 14 "symb.ch"
#line 15 "symb.ch"
                                        pvTable = (TabList **)realloc(pvTable, (pvSizeMax += 10) * sizeof(TabList *));
#line 15 "symb.ch"
#line 15 "symb.ch"
                                    }
#line 15 "symb.ch"
#line 15 "symb.ch"
                                 }
#line 15 "symb.ch"
#line 22 "symb.ch"
    pvCurrentLevel = *(pvTable + pvSize) = new TabList((PTREE)0);
#line 22 "symb.ch"
#line 25 "symb.ch"
    return ++pvSize ;
#line 25 "symb.ch"
#line 26 "symb.ch"
}
#line 26 "symb.ch"

#line 28 "symb.ch"
#line 28 "symb.ch"
int SymbolTable::RemoveLevel ()
#line 28 "symb.ch"
{
#line 28 "symb.ch"
#line 33 "symb.ch"
    if ( !pvSize ) 
#line 33 "symb.ch"
#line 34 "symb.ch"
        return 0 ;
#line 34 "symb.ch"
#line 37 "symb.ch"
    pvSize-- ;
#line 37 "symb.ch"
#line 38 "symb.ch"
    delete *(pvTable + pvSize);
#line 38 "symb.ch"
#line 39 "symb.ch"
    pvCurrentLevel = *(pvTable + pvSize - 1);
#line 39 "symb.ch"
#line 42 "symb.ch"
    return pvSize ;
#line 42 "symb.ch"
#line 43 "symb.ch"
}
#line 43 "symb.ch"

#line 45 "symb.ch"
#line 45 "symb.ch"
void SymbolTable::AddVar ( PTREE var )
#line 45 "symb.ch"
{
#line 45 "symb.ch"
#line 50 "symb.ch"
    if ( pvSize == 0 ) 
#line 50 "symb.ch"
#line 51 "symb.ch"
        AddLevel();
#line 51 "symb.ch"
#line 52 "symb.ch"
    pvCurrentLevel -> InsertRemove(var);
#line 52 "symb.ch"
#line 53 "symb.ch"
}
#line 53 "symb.ch"

#line 55 "symb.ch"
#line 55 "symb.ch"
void SymbolTable::RemoveVar ( PTREE var )
#line 55 "symb.ch"
{
#line 55 "symb.ch"
#line 58 "symb.ch"
    pvCurrentLevel -> Remove(var);
#line 58 "symb.ch"
#line 59 "symb.ch"
}
#line 59 "symb.ch"

#line 61 "symb.ch"
#line 61 "symb.ch"
PTREE SymbolTable::GetVar ( char *var )
#line 61 "symb.ch"
{
#line 61 "symb.ch"
#line 64 "symb.ch"
    TabList **ptLevel = pvTable + pvSize - 1 ;
#line 64 "symb.ch"
#line 65 "symb.ch"
    PTREE   result ;
#line 65 "symb.ch"
#line 65 "symb.ch"
#line 68 "symb.ch"
    if ( !pvSize ) 
#line 68 "symb.ch"
#line 69 "symb.ch"
        return (PTREE)0 ;
#line 69 "symb.ch"
#line 72 "symb.ch"
#line 72 "symb.ch"
    for (; ptLevel >= pvTable ; ptLevel-- ) {
#line 72 "symb.ch"
#line 73 "symb.ch"
                                                if ( (result=(**ptLevel)[var]) ) 
#line 73 "symb.ch"
#line 74 "symb.ch"
                                                    return result ;
#line 74 "symb.ch"
#line 74 "symb.ch"
                                               }
#line 74 "symb.ch"
#line 74 "symb.ch"
#line 78 "symb.ch"
    return (PTREE)0 ;
#line 78 "symb.ch"
#line 79 "symb.ch"
}
#line 79 "symb.ch"
/*Well done my boy */ 
#line 79 "symb.ch"

