Mano pdp8 SymbolTable.cc

From Minor Miracle Software
Revision as of 17:29, 13 June 2016 by WikiSysop (talk | contribs) (Created page with " SymbolTable.cc <PRE> // SymbolTable Class // Nested Label's are not allowed. #ifndef SYMBOLTABLE_CC #define SYMBOLTABLE_CC #ifndef MANO_H #include "mano.h" #endif #ifn...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


SymbolTable.cc


// SymbolTable Class
// Nested Label's are not allowed.

#ifndef SYMBOLTABLE_CC
#define SYMBOLTABLE_CC

#ifndef MANO_H
 #include "mano.h"
#endif

#ifndef SYMBOLMANO_CC
  #include "SymbolMano.cc"
#endif

// Utility includes
#ifndef CHAR_STRING_CC
  #include "charString.cc"
#endif

#ifndef LIST_CC
  #include "list.cc"
#endif


class SymbolTable {

	list<SymbolMano> Symbol_list_m;

public:

	SymbolTable(){}

	~SymbolTable(){}

	SymbolTable( const SymbolTable& B)
	{
		Symbol_list_m = B.Symbol_list_m;
	}


	short Search( charString charString_A )
	{
		SymbolMano SM;
		SM.FillSymbolMano(charString_A, 0, 0 );
		
		if( Symbol_list_m.locate( SM ) )
		{
			Symbol_list_m.returncurrent( SM );

			return SM.returnLocation();
		}
		else
			return -1;
	}

	void LoadSymbol( charString charString_A, short s_Location, short LC )
	{
		if( DEBUG ) cout << "SymbolTable: FillSymbolTable 0" << endl;
		
		SymbolMano SM;
		
		SM.FillSymbolMano(charString_A, s_Location, LC );
		
		Symbol_list_m += SM;
	} // LoadSymbol( charString charString_A, short s_Location )
};
#endif // end SymbolTable


Internal Links

Parent Article: Mano PDP-8 Simulation Project Source Code