Index: src/CodeGen/OperatorTable.cc
===================================================================
--- src/CodeGen/OperatorTable.cc	(revision eeaa3e2b4b50ff73386830c663367b7ad89482e1)
+++ src/CodeGen/OperatorTable.cc	(revision 81da70a5fabf0e44bf05c7b927e395b9e4c76239)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Feb 10 18:12:12 2020
-// Update Count     : 17
+// Last Modified On : Tue Feb 18 15:55:01 2020
+// Update Count     : 55
 //
 
@@ -17,4 +17,5 @@
 #include <map>        // for map, _Rb_tree_const_iterator, map<>::const_iterator
 #include <utility>    // for pair
+using namespace std;
 
 #include "OperatorTable.h"
@@ -22,135 +23,110 @@
 
 namespace CodeGen {
-	namespace {
-		const OperatorInfo tableValues[] = {
-			{	"?[?]",   "",     "_operator_index",             "Index",                      OT_INDEX          },
-			{	"?{}",    "=",    "_constructor",                "Constructor",                OT_CTOR           },
-			{	"^?{}",   "",     "_destructor",                 "Destructor",                 OT_DTOR           },
-			{	"?()",    "",     "_operator_call",              "Call Operator",              OT_CALL           },
-			{	"?++",    "++",   "_operator_postincr",          "Postfix Increment",          OT_POSTFIXASSIGN  },
-			{	"?--",    "--",   "_operator_postdecr",          "Postfix Decrement",          OT_POSTFIXASSIGN  },
-			{	"*?",     "*",    "_operator_deref",             "Dereference",                OT_PREFIX         },
-			{	"+?",     "+",    "_operator_unaryplus",         "Plus",                       OT_PREFIX         },
-			{	"-?",     "-",    "_operator_unaryminus",        "Minus",                      OT_PREFIX         },
-			{	"~?",     "~",    "_operator_bitnot",            "Bitwise Not",                OT_PREFIX         },
-			{	"!?",     "!",    "_operator_lognot",            "Logical Not",                OT_PREFIX         },
-			{	"++?",    "++",   "_operator_preincr",           "Prefix Increment",           OT_PREFIXASSIGN   },
-			{	"--?",    "--",   "_operator_predecr",           "Prefix Decrement",           OT_PREFIXASSIGN   },
-			{	"?\\?",   "\\",   "_operator_exponential",       "Exponentiation",             OT_INFIX          },
-			{	"?*?",    "*",    "_operator_multiply",          "Multiplication",             OT_INFIX          },
-			{	"?/?",    "/",    "_operator_divide",            "Division",                   OT_INFIX          },
-			{	"?%?",    "%",    "_operator_modulus",           "Modulo",                     OT_INFIX          },
-			{	"?+?",    "+",    "_operator_add",               "Addition",                   OT_INFIX          },
-			{	"?-?",    "-",    "_operator_subtract",          "Substraction",               OT_INFIX          },
-			{	"?<<?",   "<<",   "_operator_shiftleft",         "Shift Left",                 OT_INFIX          },
-			{	"?>>?",   ">>",   "_operator_shiftright",        "Shift Right",                OT_INFIX          },
-			{	"?<?",    "<",    "_operator_less",              "Less-than",                  OT_INFIX          },
-			{	"?>?",    ">",    "_operator_greater",           "Greater-than",               OT_INFIX          },
-			{	"?<=?",   "<=",   "_operator_lessequal",         "Less-than-or-Equal",         OT_INFIX          },
-			{	"?>=?",   ">=",   "_operator_greaterequal",      "Greater-than-or-Equal",      OT_INFIX          },
-			{	"?==?",   "==",   "_operator_equal",             "Equality",                   OT_INFIX          },
-			{	"?!=?",   "!=",   "_operator_notequal",          "Not-Equal",                  OT_INFIX          },
-			{	"?&?",    "&",    "_operator_bitand",            "Bitwise And",                OT_INFIX          },
-			{	"?^?",    "^",    "_operator_bitxor",            "Bitwise Xor",                OT_INFIX          },
-			{	"?|?",    "|",    "_operator_bitor",             "Bitwise Or",                 OT_INFIX          },
-			{	"?=?",    "=",    "_operator_assign",            "Assignment",                 OT_INFIXASSIGN    },
-			{	"?\\=?",  "\\=",  "_operator_expassign",         "Exponentiation Assignment",  OT_INFIXASSIGN    },
-			{	"?*=?",   "*=",   "_operator_multassign",        "Multiplication Assignment",  OT_INFIXASSIGN    },
-			{	"?/=?",   "/=",   "_operator_divassign",         "Division Assignment",        OT_INFIXASSIGN    },
-			{	"?%=?",   "%=",   "_operator_modassign",         "Modulo Assignment",          OT_INFIXASSIGN    },
-			{	"?+=?",   "+=",   "_operator_addassign",         "Addition Assignment",        OT_INFIXASSIGN    },
-			{	"?-=?",   "-=",   "_operator_subassign",         "Substrction Assignment",     OT_INFIXASSIGN    },
-			{	"?<<=?",  "<<=",  "_operator_shiftleftassign",   "Shift Left Assignment",      OT_INFIXASSIGN    },
-			{	"?>>=?",  ">>=",  "_operator_shiftrightassign",  "Shift Right Assignment",     OT_INFIXASSIGN    },
-			{	"?&=?",   "&=",   "_operator_bitandassign",      "Bitwise And Assignment",     OT_INFIXASSIGN    },
-			{	"?^=?",   "^=",   "_operator_bitxorassign",      "Bitwise Xor Assignment",     OT_INFIXASSIGN    },
-			{	"?|=?",   "|=",   "_operator_bitorassign",       "Bitwise Or Assignment",      OT_INFIXASSIGN    },
-		};
+	const OperatorInfo CodeGen::tableValues[] = {
+		// inputName symbol   outputName                     friendlyName                  type
+		{	"?[?]",   "",     "_operator_index",             "Index",                      OT_INDEX          },
+		{	"?{}",    "=",    "_constructor",                "Constructor",                OT_CTOR           },
+		{	"^?{}",   "",     "_destructor",                 "Destructor",                 OT_DTOR           },
+		{	"?()",    "",     "_operator_call",              "Call Operator",              OT_CALL           },
+		{	"?++",    "++",   "_operator_postincr",          "Postfix Increment",          OT_POSTFIXASSIGN  },
+		{	"?--",    "--",   "_operator_postdecr",          "Postfix Decrement",          OT_POSTFIXASSIGN  },
+		{	"*?",     "*",    "_operator_deref",             "Dereference",                OT_PREFIX         },
+		{	"+?",     "+",    "_operator_unaryplus",         "Plus",                       OT_PREFIX         },
+		{	"-?",     "-",    "_operator_unaryminus",        "Minus",                      OT_PREFIX         },
+		{	"~?",     "~",    "_operator_bitnot",            "Bitwise Not",                OT_PREFIX         },
+		{	"!?",     "!",    "_operator_lognot",            "Logical Not",                OT_PREFIX         },
+		{	"++?",    "++",   "_operator_preincr",           "Prefix Increment",           OT_PREFIXASSIGN   },
+		{	"--?",    "--",   "_operator_predecr",           "Prefix Decrement",           OT_PREFIXASSIGN   },
+		{	"?\\?",   "\\",   "_operator_exponential",       "Exponentiation",             OT_INFIX          },
+		{	"?*?",    "*",    "_operator_multiply",          "Multiplication",             OT_INFIX          },
+		{	"?/?",    "/",    "_operator_divide",            "Division",                   OT_INFIX          },
+		{	"?%?",    "%",    "_operator_modulus",           "Modulo",                     OT_INFIX          },
+		{	"?+?",    "+",    "_operator_add",               "Addition",                   OT_INFIX          },
+		{	"?-?",    "-",    "_operator_subtract",          "Substraction",               OT_INFIX          },
+		{	"?<<?",   "<<",   "_operator_shiftleft",         "Shift Left",                 OT_INFIX          },
+		{	"?>>?",   ">>",   "_operator_shiftright",        "Shift Right",                OT_INFIX          },
+		{	"?<?",    "<",    "_operator_less",              "Less-than",                  OT_INFIX          },
+		{	"?>?",    ">",    "_operator_greater",           "Greater-than",               OT_INFIX          },
+		{	"?<=?",   "<=",   "_operator_lessequal",         "Less-than-or-Equal",         OT_INFIX          },
+		{	"?>=?",   ">=",   "_operator_greaterequal",      "Greater-than-or-Equal",      OT_INFIX          },
+		{	"?==?",   "==",   "_operator_equal",             "Equality",                   OT_INFIX          },
+		{	"?!=?",   "!=",   "_operator_notequal",          "Not-Equal",                  OT_INFIX          },
+		{	"?&?",    "&",    "_operator_bitand",            "Bitwise And",                OT_INFIX          },
+		{	"?^?",    "^",    "_operator_bitxor",            "Bitwise Xor",                OT_INFIX          },
+		{	"?|?",    "|",    "_operator_bitor",             "Bitwise Or",                 OT_INFIX          },
+		{	"?=?",    "=",    "_operator_assign",            "Assignment",                 OT_INFIXASSIGN    },
+		{	"?\\=?",  "\\=",  "_operator_expassign",         "Exponentiation Assignment",  OT_INFIXASSIGN    },
+		{	"?*=?",   "*=",   "_operator_multassign",        "Multiplication Assignment",  OT_INFIXASSIGN    },
+		{	"?/=?",   "/=",   "_operator_divassign",         "Division Assignment",        OT_INFIXASSIGN    },
+		{	"?%=?",   "%=",   "_operator_modassign",         "Modulo Assignment",          OT_INFIXASSIGN    },
+		{	"?+=?",   "+=",   "_operator_addassign",         "Addition Assignment",        OT_INFIXASSIGN    },
+		{	"?-=?",   "-=",   "_operator_subassign",         "Substrction Assignment",     OT_INFIXASSIGN    },
+		{	"?<<=?",  "<<=",  "_operator_shiftleftassign",   "Shift Left Assignment",      OT_INFIXASSIGN    },
+		{	"?>>=?",  ">>=",  "_operator_shiftrightassign",  "Shift Right Assignment",     OT_INFIXASSIGN    },
+		{	"?&=?",   "&=",   "_operator_bitandassign",      "Bitwise And Assignment",     OT_INFIXASSIGN    },
+		{	"?^=?",   "^=",   "_operator_bitxorassign",      "Bitwise Xor Assignment",     OT_INFIXASSIGN    },
+		{	"?|=?",   "|=",   "_operator_bitorassign",       "Bitwise Or Assignment",      OT_INFIXASSIGN    },
+	}; // tableValues
 
-		const int numOps = sizeof( tableValues ) / sizeof( OperatorInfo );
+	std::map< std::string, OperatorInfo > CodeGen::table;
 
-		std::map< std::string, OperatorInfo > table;
-
-		void initialize() {
-			for ( int i = 0; i < numOps; ++i ) {
-				table[ tableValues[i].inputName ] = tableValues[i];
-			} // for
-		}
-	} // namespace
-
-	bool operatorLookup( const std::string & funcName, OperatorInfo & info ) {
-		static bool init = false;
-		if ( ! init ) {
-			initialize();
-		} // if
-
-		std::map< std::string, OperatorInfo >::const_iterator i = table.find( funcName );
-		if ( i == table.end() ) {
-			if ( isPrefix( funcName, "?`" ) ) {			// user-defined postfix operator ?
-				info.inputName = funcName;
-				info.symbol = funcName.substr(2);
-				info.outputName = toString( "__postfix_call_", info.symbol );
-				info.type = OT_POSTFIX;
-				return true;
-			}
-			return false;
-		} else {
-			info = i->second;
-			return true;
-		} // if
+	CodeGen::CodeGen() {
+		enum { numOps = sizeof( tableValues ) / sizeof( OperatorInfo ) };
+		for ( int i = 0; i < numOps; i += 1 ) {
+			table[ tableValues[i].inputName ] = tableValues[i];
+		} // for
 	}
 
-	bool isOperator( const std::string & funcName ) {
-		OperatorInfo info;
-		return operatorLookup( funcName, info );
+	const OperatorInfo * operatorLookup( const string & funcName ) {
+		if ( funcName.find_first_of( "?^*+-!", 0, 1 ) == string::npos ) return nullptr; // prefilter
+		const OperatorInfo * ret = &CodeGen::table.find( funcName )->second; // must be in the table
+		assert( ret );
+		return ret;
 	}
 
-	std::string operatorFriendlyName( const std::string & funcName ) {
-		OperatorInfo info;
-		if( operatorLookup( funcName, info ) ) {
-			return info.friendlyName;
-		}
+	bool isOperator( const string & funcName ) {
+		return operatorLookup( funcName ) != nullptr;
+	}
+
+	string operatorFriendlyName( const string & funcName ) {
+		const OperatorInfo * info = operatorLookup( funcName );
+		if ( info ) return info->friendlyName;
 		return "";
 	}
 
-	/// determines if a given function name is one of the operator types between [begin, end)
-	template<typename Iterator>
-	bool isOperatorType( const std::string & funcName, Iterator begin, Iterator end ) {
-		OperatorInfo info;
-		if ( operatorLookup( funcName, info ) ) {
-			return std::find( begin, end, info.type ) != end;
-		}
+	bool isConstructor( const string & funcName ) {
+		const OperatorInfo * info = operatorLookup( funcName );
+		if ( info ) return info->type == OT_CTOR;
 		return false;
 	}
 
-	bool isConstructor( const std::string & funcName ) {
-		static OperatorType types[] = { OT_CTOR };
-		return isOperatorType( funcName, std::begin(types), std::end(types) );
+	bool isDestructor( const string & funcName ) {
+		const OperatorInfo * info = operatorLookup( funcName );
+		if ( info ) return info->type == OT_DTOR;
+		return false;
 	}
 
-	bool isDestructor( const std::string & funcName ) {
-		static OperatorType types[] = { OT_DTOR };
-		return isOperatorType( funcName, std::begin(types), std::end(types) );
+	bool isCtorDtor( const string & funcName ) {
+		const OperatorInfo * info = operatorLookup( funcName );
+		if ( info ) return info->type <= OT_CONSTRUCTOR;
+		return false;
 	}
 
-	bool isAssignment( const std::string & funcName ) {
-		static OperatorType types[] = { OT_PREFIXASSIGN, OT_POSTFIXASSIGN, OT_INFIXASSIGN };
-		return isOperatorType( funcName, std::begin(types), std::end(types) );
+	bool isAssignment( const string & funcName ) {
+		const OperatorInfo * info = operatorLookup( funcName );
+		if ( info ) return info->type > OT_CONSTRUCTOR && info->type <= OT_ASSIGNMENT;
+		return false;
 	}
 
-	bool isCtorDtor( const std::string & funcName ) {
-		static OperatorType types[] = { OT_CTOR, OT_DTOR };
-		return isOperatorType( funcName, std::begin(types), std::end(types) );
+	bool isCtorDtorAssign( const string & funcName ) {
+		const OperatorInfo * info = operatorLookup( funcName );
+		if ( info ) return info->type <= OT_ASSIGNMENT;
+		return false;
 	}
 
-	bool isCtorDtorAssign( const std::string & funcName ) {
-		static OperatorType types[] = { OT_CTOR, OT_DTOR, OT_PREFIXASSIGN, OT_POSTFIXASSIGN, OT_INFIXASSIGN };
-		return isOperatorType( funcName, std::begin(types), std::end(types) );
-	}
+	CodeGen codegen;									// initialize singleton package
 } // namespace CodeGen
 
 // Local Variables: //
 // tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
 // End: //
