Beispiel #1
0
        private void registerMethod(IMethodDeclaration method, Context context)
        {
            IDeclaration actual;

            if (method is SetterMethodDeclaration)
            {
                if (methodsMap.TryGetValue("setter:" + method.GetName(), out actual))
                {
                    throw new SyntaxError("Duplicate setter: \"" + method.GetName() + "\"");
                }
                methodsMap["setter:" + method.GetName()] = method;
            }
            else if (method is GetterMethodDeclaration)
            {
                if (methodsMap.TryGetValue("getter:" + method.GetName(), out actual))
                {
                    throw new SyntaxError("Duplicate getter: \"" + method.GetName() + "\"");
                }
                methodsMap["getter:" + method.GetName()] = method;
            }
            else
            {
                if (!methodsMap.TryGetValue(method.GetName(), out actual))
                {
                    actual = new MethodDeclarationMap(method.GetName());
                    methodsMap[method.GetName()] = (MethodDeclarationMap)actual;
                }
                ((MethodDeclarationMap)actual).register(method, context);
            }
        }
Beispiel #2
0
        public void registerDeclaration(IMethodDeclaration declaration)
        {
            INamed actual = getRegistered(declaration.GetName());

            if (actual != null && !(actual is MethodDeclarationMap))
            {
                throw new SyntaxError("Duplicate name: \"" + declaration.GetName() + "\"");
            }
            if (actual == null)
            {
                actual = new MethodDeclarationMap(declaration.GetName());
                declarations[declaration.GetName()] = (MethodDeclarationMap)actual;
            }
            ((MethodDeclarationMap)actual).register(declaration, this);
        }
 private static MethodRef CreateRef(IMethodDeclaration md)
 {
     return(MethodRef.CreateLocalReference(md.GetName(), md.DeclaredElement, md));
 }
Beispiel #4
0
 public string GetName()
 {
     return(wrapped.GetName());
 }
Beispiel #5
0
 public override string GetTypeName()
 {
     return(method.GetName());
 }