Beispiel #1
0
 protected VccQualifiedName(BlockStatement containingBlock, VccQualifiedName template)
     : base(containingBlock, template)
 {
 }
Beispiel #2
0
        internal override void AddInitializingFieldAssignmentsTo(ICollection<Statement> statements, Expression target, VccStructuredTypeDeclaration typeDecl)
        {
            foreach (var pair in this.designatorsWithExpressions) {
            var targetDotField = target;
            foreach (var desig in pair.Designators)
              targetDotField = new VccQualifiedName(targetDotField, desig, desig.SourceLocation);

            targetDotField.SetContainingExpression(this);
            AddInitializationTo(statements, pair.Expression, targetDotField, TypeExpression.For(targetDotField.Type.ResolvedType), this.ContainingBlock);
              }
        }
Beispiel #3
0
 /// <summary>
 /// Supply initialization code for a structured variable in the static initializer.
 /// </summary>
 /// <param name="statements">statements collection into which new statements are added</param>
 /// <param name="target">the name of the struct variable</param>
 /// <param name="typeDecl">the structured type's declaration</param>
 internal override void AddInitializingFieldAssignmentsTo(ICollection<Statement> statements, Expression target, VccStructuredTypeDeclaration typeDecl)
 {
     bool isUnion = typeDecl is VccUnionDeclaration;
       IEnumerator<Expression> exprEnumerator= this.expressions.GetEnumerator();
       foreach (FieldDefinition fd in IteratorHelper.GetFilterEnumerable<ITypeDeclarationMember, FieldDefinition>(typeDecl.TypeDeclarationMembers)) {
     SimpleName fieldName = new SimpleName(fd.Name, target.SourceLocation, false);
     var varDotField = new VccQualifiedName(target, fieldName, target.SourceLocation);
     if (exprEnumerator.MoveNext())
       AddInitializationTo(statements, exprEnumerator.Current, varDotField, fd.Type, this.ContainingBlock);
     if (isUnion) return;
       }
 }