quick start:g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_io.a #include <SofList.h> SofList(); SofList(const SofList& arg); boolean add(long name, long tag, long pos, long size); long first(long name); long last(long name); long getCount();
description:SofList list; // setup a simple symbol table // SofSymbolTable table; SysString n1(L"Long"); long i1 = table.add(n1); // add a node to the soflist // list.setTable(table); list.add(i1, 0, -1, sizeof(long)); list.debug(L"added nodes"); long tag = list.prev(i1, 1000); if (tag != 0) { Console::put(L"Error in previous"); }
static const SysString CLASS_NAME = L"SofList";
static const long STACK_SIZE = 2048;
static const long GROW_SIZE = 1024;
static const long DEF_STACK_SIZE = 0;
static const long DEF_STACK_PTR = 0;
static const long DEF_STACK_FRAME = 0;
static const long NO_TAG = -2147483647;
static const long ERR = 10100;
static const long ERR_SYMB = 10102;
static const long ERR_COPY = 10104;
static const long ERR_DELETE = 10105;
static const long ERR_ADD = 10106;
static const long ERR_EXISTS = 10107;
static const long ERR_CURR = 10108;
SofNode* root_d;
SofNode* current_d;
SofSymbolTable* table_d;
SofNode** stack_d;
long stack_size_d;
long stack_ptr_d;
long stack_frame_d;
Integral::DEBUG debug_level_d;
static MemoryManager mgr_d;
static const SysString& name();
static boolean diagnose(Integral::DEBUG debug_level);
boolean debug(const unichar* msg) const;
boolean setDebug(Integral::DEBUG debug_level);
~SofList();
SofList();
SofList(const SofList& arg);
boolean assign(const SofList& arg);
SofList& operator= (const SofList& arg);
these methods are omitted because SofList can not write itself to an sof file
these methods are omitted because they are not useful for SofList objects
new and delete are omitted because memory for SofList objects is not managed by the MemoryManager class
boolean clear();
long memSize();
boolean add(long name, long tag, long pos, long size);
boolean addQuick(long name, long tag, long pos, long size);
boolean remove();
boolean find(long name, long tag);
long first(long name);
long last(long name);
long next(long name, long cur_tag);
long prev(long name, long cur_tag);
boolean setTable(SofSymbolTable& table);
boolean setPosition(long pos);
boolean setSize(long size);
long getName() const;
long getTag() const;
long getPosition() const;
long getSize() const;
long getNameCount();
long getCount();
long getCount(long name);
SofNode* newNode();
boolean deleteNode(SofNode* node);
boolean addNode(SofNode* node);
SofNode* findNode(long name, long tag);
SofNode* findNode(long name);
boolean nodeGt(const SofNode* node, long name, long tag) const;
boolean nodeLt(const SofNode* node, long name, long tag) const;
boolean nodeGt(const SofNode* node, long name) const;
boolean nodeLt(const SofNode* node, long name) const;
boolean nodeGt(const SofNode* node_1, const SofNode* node_2) const;
boolean nodeLt(const SofNode* node_1, const SofNode* node_2) const;
boolean nodeEq(const SofNode* node, long name) const;
long getCount(SofNode* node);
long getCount(SofNode* node, long name);
boolean push(SofNode* ptr);
boolean pop(SofNode*& ptr);
boolean pushFrame();
boolean popFrame();
boolean display();
boolean display(SysString& str, SofNode* node);
boolean displayTree();
boolean displayTree(SofNode* node, long level);
SofList list; // setup a simple symbol table // SofSymbolTable table; SysString n1(L"Long"); long i1 = table.add(n1); SysString n2(L"Short"); long i2 = table.add(n2); SysString n3(L"Float"); long i3 = table.add(n3); SysString n4(L"Char"); long i4 = table.add(n4); list.add(i1, 0, -1, sizeof(long)); list.add(i2, 0, -1, sizeof(short)); list.add(i3, 0, -1, sizeof(float)); list.add(i4, 0, -1, sizeof(char)); list.add(i2, 1, -1, sizeof(short)); list.add(i1, -1, -1, sizeof(long)); list.add(i4, 3, -1, sizeof(char)); list.add(i4, 2, -1, sizeof(char)); long tag = list.first(i4); if (tag != 0) { Console::put(L"Error in first"); } tag = list.next(i4, tag); if (tag != 2) { Console::put(L"Error in next"); } tag = list.next(i2, -100); if (tag != 0) { Console::put(L"Error in next"); } tag = list.prev(i1, 1000); if (tag != 0) { Console::put(L"Error in first"); }