Пример #1
0
        public override object Visit(ObjectiveTypeForwardDeclarationStatement node)
        {
            foreach (var typeName in node.Names)
            {
                LanguageType  objectiveTypeNode = null;
                ObjectiveType objectiveType     = null;

                if (Types.Peek().TryGetValue(typeName, out objectiveTypeNode))
                {
                    objectiveType = ( ObjectiveType )objectiveTypeNode;
                }
                else
                {
                    objectiveType = new ObjectiveType();
                    TranslationUnit.ObjectiveTypes.Add(objectiveType);
                    Types.Peek()[typeName] = objectiveType;

                    objectiveType.Name = typeName;
                }
            }

            return(null);
        }
Пример #2
0
        public override object Visit(ObjectiveTypeDeclarationStatement node)
        {
            using (ASTScope.PushScoped(node))
            {
                LanguageType  objectiveTypeNode = null;
                ObjectiveType objectiveType     = null;

                if (Types.Peek().TryGetValue(node.Name, out objectiveTypeNode))
                {
                    objectiveType = ( ObjectiveType )objectiveTypeNode;
                }
                else
                {
                    objectiveType = new ObjectiveType();
                    TranslationUnit.ObjectiveTypes.Add(objectiveType);
                    Types.Peek()[node.Name] = objectiveType;

                    objectiveType.Name = node.Name;
                }

                using (Scope.PushScoped(objectiveType))
                    return(base.Visit(node));
            }
        }