コード例 #1
0
 public static UnifiedPropertyDefinitionPart Create(
     UnifiedSet <UnifiedAnnotation> annotations = null,
     UnifiedSet <UnifiedModifier> modifiers     = null,
     UnifiedBlock body = null)
 {
     return(new UnifiedPropertyDefinitionPart {
         Annotations = annotations,
         Modifiers = modifiers,
         Body = body,
     });
 }
コード例 #2
0
 public static UnifiedGenericArgument Create(
     UnifiedExpression type = null,
     UnifiedSet <UnifiedModifier> modifiers = null,
     UnifiedSet <UnifiedTypeConstrain>
     constrains = null)
 {
     return(new UnifiedGenericArgument {
         Value = type,
         Modifiers = modifiers,
         Constrains = constrains
     });
 }
コード例 #3
0
ファイル: UnifiedGenericType.cs プロジェクト: macc704/UNICOEN
        public override IEnumerable <ElementReference> ElementReferences()
        {
            yield return
                (ElementReference.Create(
                     () => Arguments,
                     v => Arguments = (UnifiedSet <UnifiedGenericArgument>)v)
                );

            yield return
                (ElementReference.Create(
                     () => Type, v => Type = (UnifiedType)v));
        }
コード例 #4
0
ファイル: UnifiedCall.cs プロジェクト: macc704/UNICOEN
 public static UnifiedCall Create(
     UnifiedExpression target          = null,
     UnifiedSet <UnifiedArgument> args = null,
     UnifiedSet <UnifiedGenericArgument> genericArguments = null,
     UnifiedProc proc = null)
 {
     return(new UnifiedCall {
         Function = target,
         Arguments = args,
         GenericArguments = genericArguments,
         Proc = proc
     });
 }
コード例 #5
0
ファイル: UnifiedTry.cs プロジェクト: macc704/UNICOEN
 public static UnifiedTry Create(
     UnifiedBlock body = null,
     UnifiedSet <UnifiedCatch> catches = null,
     UnifiedBlock elseBody             = null,
     UnifiedBlock finallyBody          = null)
 {
     return(new UnifiedTry {
         Body = body,
         Catches = catches,
         ElseBody = elseBody,
         FinallyBody = finallyBody,
     });
 }
コード例 #6
0
        public override IEnumerable <ElementReference> ElementReferencesOfFields(

            )
        {
            yield return
                (ElementReference.Create(
                     () => _arguments,
                     v => _arguments = (UnifiedSet <UnifiedArgument>)v));

            yield return
                (ElementReference.Create(
                     () => _type, v => _type = (UnifiedType)v));
        }
コード例 #7
0
 public static UnifiedImport Create(
     UnifiedExpression name   = null, string alias = null,
     UnifiedExpression member = null,
     UnifiedSet <UnifiedModifier> modifiers = null)
 {
     return(new UnifiedImport {
         Member = member,
         Name = name,
         Alias = alias != null
                                                         ? UnifiedVariableIdentifier.Create(alias)
                                                         : null,
         Modifiers = modifiers,
     });
 }
コード例 #8
0
ファイル: UnifiedCatch.cs プロジェクト: macc704/UNICOEN
 public static UnifiedCatch Create(
     UnifiedSet <UnifiedType> types,
     UnifiedExpression assign,
     UnifiedBlock body = null,
     UnifiedSet <UnifiedAnnotation> annotations = null,
     UnifiedSet <UnifiedModifier> modifiers     = null)
 {
     return(new UnifiedCatch {
         Annotations = annotations,
         Modifiers = modifiers,
         Types = types,
         Assign = assign,
         Body = body,
     });
 }
コード例 #9
0
ファイル: UnifiedNew.cs プロジェクト: macc704/UNICOEN
 public static UnifiedNew Create(
     UnifiedExpression target = null,
     UnifiedSet <UnifiedArgument> arguments = null,
     UnifiedSet <UnifiedGenericArgument> genericArguments = null,
     UnifiedArrayLiteral initialValues = null,
     UnifiedBlock body = null)
 {
     return(new UnifiedNew {
         Target = target,
         Arguments = arguments,
         GenericArguments = genericArguments,
         InitialValue = initialValues,
         Body = body,
     });
 }
コード例 #10
0
 public static UnifiedDelegateDefinition Create(
     UnifiedSet <UnifiedAnnotation> annotations = null,
     UnifiedSet <UnifiedModifier> modifiers     = null,
     UnifiedType type = null,
     UnifiedSet <UnifiedGenericParameter> genericParameters = null,
     UnifiedIdentifier name = null,
     UnifiedSet <UnifiedParameter> parameters = null)
 {
     return(new UnifiedDelegateDefinition {
         Name = name,
         Annotations = annotations,
         Type = type,
         GenericParameters = genericParameters,
         Modifiers = modifiers,
         Parameters = parameters,
     });
 }
コード例 #11
0
 public static UnifiedEventDefinition Create(
     UnifiedSet <UnifiedAnnotation> annotations = null,
     UnifiedSet <UnifiedModifier> modifiers     = null,
     UnifiedType type = null,
     UnifiedSet <UnifiedIdentifier> names  = null,
     UnifiedPropertyDefinitionPart adder   = null,
     UnifiedPropertyDefinitionPart remover = null)
 {
     return(new UnifiedEventDefinition {
         Annotations = annotations,
         Modifiers = modifiers,
         Type = type,
         Names = names,
         Adder = adder,
         Remover = remover,
     });
 }
コード例 #12
0
ファイル: UnifiedParameter.cs プロジェクト: macc704/UNICOEN
 public static UnifiedParameter Create(
     UnifiedSet <UnifiedAnnotation> annotations = null,
     UnifiedSet <UnifiedModifier> modifiers     = null,
     UnifiedType type = null,
     UnifiedSet <UnifiedIdentifier> names   = null,
     UnifiedExpression defaultValue         = null,
     UnifiedExpression annotationExpression = null)
 {
     return(new UnifiedParameter {
         Annotations = annotations,
         Modifiers = modifiers,
         Type = type,
         Names = names,
         DefaultValue = defaultValue,
         AnnotationExpression = annotationExpression,
     });
 }
コード例 #13
0
        public static UnifiedSet <UnifiedAnnotation> Merge(
            this IList <UnifiedSet <UnifiedAnnotation> > collections)
        {
            Contract.Requires <InvalidOperationException>(
                collections.All(c => c.Parent == null));
            if (collections.Count == 0)
            {
                return(UnifiedSet <UnifiedAnnotation> .Create());
            }
            var ret = collections[0];

            for (int i = 1; i < collections.Count; i++)
            {
                ret.AddRange(collections[i].ElementsThenClear());
            }
            return(ret);
        }
コード例 #14
0
 public static UnifiedPropertyDefinition Create(
     UnifiedSet <UnifiedAnnotation> annotations = null,
     UnifiedSet <UnifiedModifier> modifiers     = null,
     UnifiedType type = null, UnifiedIdentifier name = null,
     UnifiedSet <UnifiedParameter> parameters = null,
     UnifiedPropertyDefinitionPart getter     = null,
     UnifiedPropertyDefinitionPart setter     = null)
 {
     return(new UnifiedPropertyDefinition {
         Annotations = annotations,
         Modifiers = modifiers,
         Type = type,
         Name = name,
         Parameters = parameters,
         Getter = getter,
         Setter = setter,
     });
 }
コード例 #15
0
        public static TSelf Create(
            UnifiedBlock body = null,
            UnifiedSet <UnifiedAnnotation> annotations             = null,
            UnifiedSet <UnifiedModifier> modifiers                 = null,
            UnifiedSet <UnifiedParameter> parameters               = null,
            UnifiedSet <UnifiedGenericParameter> genericParameters = null,
            UnifiedSet <UnifiedType> throws = null)
        {
            var ret = UnifiedFactory <TSelf> .Create();

            ret.Body              = body;
            ret.Annotations       = annotations;
            ret.Modifiers         = modifiers;
            ret.Parameters        = parameters;
            ret.GenericParameters = genericParameters;
            ret.Throws            = throws;
            return(ret);
        }
コード例 #16
0
        public static T Create(
            UnifiedSet <UnifiedAnnotation> annotations = null,
            UnifiedSet <UnifiedModifier> modifiers     = null,
            UnifiedExpression name = null,
            UnifiedSet <UnifiedGenericParameter> genericParameters = null,
            UnifiedSet <UnifiedTypeConstrain> constrains           = null,
            UnifiedBlock body = null)
        {
            var ret = UnifiedFactory <T> .Create();

            ret.Annotations       = annotations;
            ret.Modifiers         = modifiers;
            ret.Name              = name;
            ret.GenericParameters = genericParameters;
            ret.Constrains        = constrains;
            ret.Body              = body;
            return(ret);
        }
コード例 #17
0
 public static UnifiedVariableDefinition Create(
     UnifiedSet <UnifiedAnnotation> annotations = null,
     UnifiedSet <UnifiedModifier> modifiers     = null,
     UnifiedType type                       = null,
     UnifiedIdentifier name                 = null,
     UnifiedExpression initialValue         = null,
     UnifiedSet <UnifiedArgument> arguments = null,
     UnifiedIntegerLiteral bitField         = null,
     UnifiedBlock body                      = null)
 {
     return(new UnifiedVariableDefinition {
         Annotations = annotations,
         Arguments = arguments,
         BitField = bitField,
         Body = body,
         InitialValue = initialValue,
         Modifiers = modifiers,
         Name = name,
         Type = type,
     });
 }
コード例 #18
0
 public static UnifiedFunctionDefinition Create(
     UnifiedSet <UnifiedAnnotation> annotations = null,
     UnifiedSet <UnifiedModifier> modifiers     = null,
     UnifiedType type = null,
     UnifiedSet <UnifiedGenericParameter> genericParameters = null,
     UnifiedIdentifier name = null,
     UnifiedSet <UnifiedParameter> parameters = null,
     UnifiedSet <UnifiedType> throws          = null,
     UnifiedBlock body = null,
     UnifiedExpression annotationExpression = null)
 {
     return(new UnifiedFunctionDefinition {
         Name = name,
         Annotations = annotations,
         Type = type,
         GenericParameters = genericParameters,
         Modifiers = modifiers,
         Parameters = parameters,
         Throws = throws,
         Body = body,
         AnnotationExpression = annotationExpression,
     });
 }
コード例 #19
0
 public static UnifiedSet <T> ToSet <T>(this IEnumerable <T> collection)
     where T : UnifiedElement
 {
     return(UnifiedSet <T> .Create(collection));
 }