Esempio n. 1
0
        /** gets the fully qualified name for the symbol with the symbolName
         * This method checks if the symbol is present in the Scope and throws an error if not
         */
        public String GetFullyQualifiedNameForSymbol(String symbolName)
        {
            if (getSymbol(symbolName) == null)
            {
                throw new InternalCompilerException("error in scope " + this + ", symbol with name: " + symbolName + " not found");
            }
            String namespaceName = GetFullyQualifiedScopeName();
            String fullyQualName = namespaceName;

            if (fullyQualName.Length > 0)
            {
                fullyQualName += ".";
            }
            fullyQualName += IdlNaming.MapIdlNameToClsName(symbolName);
            return(fullyQualName);
        }
Esempio n. 2
0
        /// <summary>returns the fully qualified CLS name of this scope (usable for type generation)</summary>
        /// <remarks>for type-scopes, returns the nested scope name, because this one is needed for type generation</remarks>
        private String GetFullyQualifiedScopeName()
        {
            string result = "";

            for (Scope scope = this; scope.getParentScope() != null; scope = scope.getParentScope())
            {
                string scopeName = IdlNaming.MapIdlNameToClsName(scope.getTypeScopeName());
                if (result == "")
                {
                    result = scopeName;
                }
                else
                {
                    result = scopeName + '.' + result;
                }
            }

            return(result);
        }