The tables are binary trees, partitioned by entry point, so names spaced symbols are preceded by name space, as per standard, andhav their own entries into symbol function.:
KeyOperation myspace mykey mydef;
Does an operation on a symbol table with entry point myspace Directed graphs with no cross links are always a great partition tool. So we build in name space partition to the symbol table, it is all reusable code:
client_names = get_key(,null,mynames);
mydef = get_key(client_name,mykey);
A simple first step to the correct binary tree. Th symbol table has a SetNames that initializes the next calls with a defined namespace, two forms of the calls, one without names space and one with. Note, this method looks lot like UCB Dbase with key/value pairs. That database works fine on an enterprise level, in these snippets we expect entry names and symbols to be less than a thousand per snippet, typically a ten step path through the tree..
This stuff is simple to deploy with the symbol type field well enumerated, the symbol manager always in alignment by following that field for verification of an arguments and position.. The symbol manager always expects the first arg to be name space on certain calls, and can check the key type on a call using key symbols. Xchars does this, checks for a connection type argument first, then a windows type argument, then a valid rect. It has a link with the type field such that a reference to rect can trace back to the containing window and connection.
The 64 bit long drives this model.
We would never consider marshaling call arguments with a symbol table in 32 bit systems. To much spaghetti per call, better to do it t compile time. The world suddenly changed when we can all assume 64 bit args. We get the high speed look up that compares favorable in real time, an we get universal args list s a 64 bit definition can point to the entire address space. Be greedy, consume the unsigned long.
Standard entry:
int Entry(int *argc, void * args[]); {
PSym p = get_key(args[*argc+1]);
if(!p) return(NOTFOUND);
if(p->type != entry_tag) return(NOTFOUND);
*argc+=1;
p->def.entry(args,argc);
}
Note: The definition field of the symbol is always a union of the types possible. EntryType entry; is the definition when type equals entry_tag. So, preload you symbol table with entry points.
Note: This returns NOTFOUND on bad type field, not ERROR. Thus we get overloading, the entry point may be an overloaded symbol. NOTFOUND tells ExecCommand to keep looking elsewhere.
No comments:
Post a Comment