Пример #1
0
        public override void Visit(EnumDeclaration enumDeclaration)
        {
            if (typeof(T) == typeof(EnumDeclaration))
            {
                mCollectedNodes.Add(enumDeclaration as T);
            }

            base.Visit(enumDeclaration);
        }
        public static EnumDeclaration FromLibraryEnum(FlowScriptModuleEnum libraryEnum)
        {
            var enumDeclaration = new EnumDeclaration(
                new Identifier(ValueKind.Type, libraryEnum.Name));

            foreach (var libraryEnumMember in libraryEnum.Members)
            {
                var valueDeclaration = new EnumValueDeclaration(
                    new Identifier(ValueKind.Unresolved, libraryEnumMember.Name),
                    Expression.FromText(libraryEnumMember.Value)
                    );

                enumDeclaration.Values.Add(valueDeclaration);
            }

            return(enumDeclaration);
        }