Esempio n. 1
0
        public override void Visit(EnumValueDeclaration enumValueDeclaration)
        {
            if (typeof(T) == typeof(EnumValueDeclaration))
            {
                mCollectedNodes.Add(enumValueDeclaration as T);
            }

            base.Visit(enumValueDeclaration);
        }
        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);
        }