public static UnifiedPropertyDefinitionPart Create( UnifiedSet <UnifiedAnnotation> annotations = null, UnifiedSet <UnifiedModifier> modifiers = null, UnifiedBlock body = null) { return(new UnifiedPropertyDefinitionPart { Annotations = annotations, Modifiers = modifiers, Body = body, }); }
public static UnifiedGenericArgument Create( UnifiedExpression type = null, UnifiedSet <UnifiedModifier> modifiers = null, UnifiedSet <UnifiedTypeConstrain> constrains = null) { return(new UnifiedGenericArgument { Value = type, Modifiers = modifiers, Constrains = constrains }); }
public override IEnumerable <ElementReference> ElementReferences() { yield return (ElementReference.Create( () => Arguments, v => Arguments = (UnifiedSet <UnifiedGenericArgument>)v) ); yield return (ElementReference.Create( () => Type, v => Type = (UnifiedType)v)); }
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 }); }
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, }); }
public override IEnumerable <ElementReference> ElementReferencesOfFields( ) { yield return (ElementReference.Create( () => _arguments, v => _arguments = (UnifiedSet <UnifiedArgument>)v)); yield return (ElementReference.Create( () => _type, v => _type = (UnifiedType)v)); }
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, }); }
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, }); }
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, }); }
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, }); }
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, }); }
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, }); }
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); }
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, }); }
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); }
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); }
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, }); }
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, }); }
public static UnifiedSet <T> ToSet <T>(this IEnumerable <T> collection) where T : UnifiedElement { return(UnifiedSet <T> .Create(collection)); }