Permalink
Browse files

Rename methods to make it clear what 'symbols table' they operate on.

  • Loading branch information...
1 parent 00f59ac commit 4eef510e33e2381c515af199127842ff84d6e8f1 @v-for-vandal v-for-vandal committed Dec 26, 2013
Showing with 18 additions and 18 deletions.
  1. +9 −9 Source/Modules/lang.cxx
  2. +6 −6 Source/Modules/lua.cxx
  3. +3 −3 Source/Modules/swigmod.h
View
@@ -319,7 +319,7 @@ overloading(0),
multiinput(0),
cplus_runtime(0),
directors(0) {
- addScope(""); // create top level/global symbol table scope
+ symbolAddScope(""); // create top level/global symbol table scope
argc_template_string = NewString("argc");
argv_template_string = NewString("argv[%d]");
@@ -3060,7 +3060,7 @@ int Language::addSymbol(const String *s, const Node *n, const_String_or_char_ptr
//Printf( stdout, "addSymbol: %s %s\n", s, scope );
Hash *symbols = Getattr(symtabs, scope ? scope : "");
if (!symbols) {
- symbols = addScope(scope);
+ symbols = symbolAddScope(scope);
} else {
Node *c = Getattr(symbols, s);
if (c && (c != n)) {
@@ -3077,15 +3077,15 @@ int Language::addSymbol(const String *s, const Node *n, const_String_or_char_ptr
}
/* -----------------------------------------------------------------------------
- * Lanugage::addScope( const_String_or_char_ptr scopeName )
+ * Lanugage::symbolAddScope( const_String_or_char_ptr scopeName )
*
* Creates a scope (symbols Hash) for given name. This method is auxilary,
* you don't have to call it - addSymbols will lazily create scopes automatically.
* If scope with given name already exists, then do nothing.
* Returns newly created (or already existing) scope.
* ----------------------------------------------------------------------------- */
-Hash* Language::addScope(const_String_or_char_ptr scope) {
- Hash *symbols = scopeLookup(scope);
+Hash* Language::symbolAddScope(const_String_or_char_ptr scope) {
+ Hash *symbols = symbolScopeLookup(scope);
if(!symbols) {
// Order in which to following parts are executed is important. In Lanugage
// constructor addScope("") is called to create a top level scope itself.
@@ -3108,18 +3108,18 @@ Hash* Language::addScope(const_String_or_char_ptr scope) {
}
/* -----------------------------------------------------------------------------
- * Lanugage::scopeLookup( const_String_or_char_ptr scope )
+ * Lanugage::symbolSscopeLookup( const_String_or_char_ptr scope )
*
* Lookup and returns a symtable (hash) representing given scope. Hash contains
* all symbols in this scope.
* ----------------------------------------------------------------------------- */
-Hash* Language::scopeLookup( const_String_or_char_ptr scope ) {
+Hash* Language::symbolScopeLookup( const_String_or_char_ptr scope ) {
Hash *symbols = Getattr(symtabs, scope ? scope : "");
return symbols;
}
/* -----------------------------------------------------------------------------
- * Lanugage::scopeSymbolLookup( const_String_or_char_ptr scope )
+ * Lanugage::symbolScopeSymbolLookup( const_String_or_char_ptr scope )
*
* For every scope there is a special pseudo-symbol in the top scope (""). It
* exists solely to detect name clashes. This pseudo symbol may contain a few properties,
@@ -3133,7 +3133,7 @@ Hash* Language::scopeLookup( const_String_or_char_ptr scope ) {
* There is no difference from symbolLookup() method except for signature
* and return type.
* ----------------------------------------------------------------------------- */
-Hash* Language::scopeSymbolLookup( const_String_or_char_ptr scope )
+Hash* Language::symbolScopePseudoSymbolLookup( const_String_or_char_ptr scope )
{
/* Getting top scope */
const_String_or_char_ptr top_scope = "";
View
@@ -1669,7 +1669,7 @@ class LUA:public Language {
* A small helper to hide impelementation of how CArrays hashes are stored
* ---------------------------------------------------------------------------- */
Hash *rawGetCArraysHash(const_String_or_char_ptr name) {
- Hash *scope = scopeLookup( name ? name : "" );
+ Hash *scope = symbolScopeLookup( name ? name : "" );
if(!scope)
return 0;
@@ -1694,10 +1694,10 @@ class LUA:public Language {
* only at first call (a.k.a when nspace is created).
* ---------------------------------------------------------------------------- */
Hash *getCArraysHash(String *nspace, bool reg = true) {
- Hash *scope = scopeLookup(nspace ? nspace : "");
+ Hash *scope = symbolScopeLookup(nspace ? nspace : "");
if(!scope) {
- addScope( nspace ? nspace : "" );
- scope = scopeLookup(nspace ? nspace : "");
+ symbolAddScope( nspace ? nspace : "" );
+ scope = symbolScopeLookup(nspace ? nspace : "");
assert(scope);
}
Hash *carrays_hash = Getattr(scope, "lua:cdata");
@@ -1979,14 +1979,14 @@ class LUA:public Language {
* ----------------------------------------------------------------------------- */
void closeNamespaces(File *dataOutput) {
// Special handling for empty module.
- if (scopeLookup("") == 0 || rawGetCArraysHash("") == 0) {
+ if (symbolScopeLookup("") == 0 || rawGetCArraysHash("") == 0) {
// Module is empty. Create hash for global scope in order to have swig__Module
// variable in resulting file
getCArraysHash(0);
}
// Because we cant access directly 'symtabs', instead we access
// top-level scope and look on all scope pseudo-symbols in it.
- Hash *top_scope = scopeLookup("");
+ Hash *top_scope = symbolScopeLookup("");
assert(top_scope);
Iterator ki = First(top_scope);
List *to_close = NewList();
View
@@ -216,9 +216,9 @@ class Language:public Dispatcher {
virtual int addSymbol(const String *s, const Node *n, const_String_or_char_ptr scope = ""); /* Add symbol */
virtual void dumpSymbols();
virtual Node *symbolLookup(String *s, const_String_or_char_ptr scope = ""); /* Symbol lookup */
- virtual Hash* addScope(const_String_or_char_ptr scope);
- virtual Hash* scopeLookup( const_String_or_char_ptr scope );
- virtual Hash* scopeSymbolLookup( const_String_or_char_ptr scope );
+ virtual Hash* symbolAddScope(const_String_or_char_ptr scope);
+ virtual Hash* symbolScopeLookup( const_String_or_char_ptr scope );
+ virtual Hash* symbolScopePseudoSymbolLookup( const_String_or_char_ptr scope );
virtual Node *classLookup(const SwigType *s) const; /* Class lookup */
virtual Node *enumLookup(SwigType *s); /* Enum lookup */
virtual int abstractClassTest(Node *n); /* Is class really abstract? */

0 comments on commit 4eef510

Please sign in to comment.