Exemple #1
0
 public virtual void VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer)
 {
     if (this.ThrowException)
     {
         throw (System.Exception) this.CreateException(fixedVariableInitializer);
     }
 }
 public virtual void VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer)
 {
     if (ThrowException)
     {
         throw (Exception)CreateException(fixedVariableInitializer);
     }
 }
 public override void VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer)
 {
     throw NotSupportedToConsistency();
 }
Exemple #4
0
			public override void Visit (FixedField f)
			{
				var location = LocationsBag.GetMemberLocation (f);
				
				var newField = new FixedFieldDeclaration ();
				AddAttributeSection (newField, f);
				AddModifiers (newField, location);
				if (location != null)
					newField.AddChild (new CSharpTokenNode (Convert (location [0]), "fixed".Length), FixedFieldDeclaration.Roles.Keyword);
				newField.AddChild (ConvertToType (f.TypeName), FixedFieldDeclaration.Roles.Type);
				
				var variable = new FixedVariableInitializer ();
				variable.AddChild (new Identifier (f.MemberName.Name, Convert (f.MemberName.Location)), FixedFieldDeclaration.Roles.Identifier);
				if (!f.Initializer.IsNull) {
					var bracketLocations = LocationsBag.GetLocations (f.Initializer);
					if (bracketLocations != null && bracketLocations.Count > 1)
						variable.AddChild (new CSharpTokenNode (Convert (bracketLocations [0]), 1), FixedFieldDeclaration.Roles.LBracket);
						
					variable.AddChild ((Expression)f.Initializer.Accept (this), FieldDeclaration.Roles.Expression);
					if (bracketLocations != null && bracketLocations.Count > 1)
						variable.AddChild (new CSharpTokenNode (Convert (bracketLocations [0]), 1), FixedFieldDeclaration.Roles.RBracket);
				}
				newField.AddChild (variable, FixedFieldDeclaration.VariableRole);
				
				if (f.Declarators != null) {
					foreach (var decl in f.Declarators) {
						var declLoc = LocationsBag.GetLocations (decl);
						if (declLoc != null)
							newField.AddChild (new CSharpTokenNode (Convert (declLoc [0]), 1), FieldDeclaration.Roles.Comma);
						
						variable = new FixedVariableInitializer ();
						variable.AddChild (new Identifier (decl.Name.Value, Convert (decl.Name.Location)), FieldDeclaration.Roles.Identifier);
						if (!decl.Initializer.IsNull) {
							var bracketLocations = LocationsBag.GetLocations (f.Initializer);
							if (bracketLocations != null && bracketLocations.Count > 1)
								variable.AddChild (new CSharpTokenNode (Convert (bracketLocations [0]), 1), FixedFieldDeclaration.Roles.LBracket);
							variable.AddChild ((Expression)decl.Initializer.Accept (this), FieldDeclaration.Roles.Expression);
							if (bracketLocations != null && bracketLocations.Count > 1)
								variable.AddChild (new CSharpTokenNode (Convert (bracketLocations [0]), 1), FixedFieldDeclaration.Roles.RBracket);
						}
						newField.AddChild (variable, FixedFieldDeclaration.VariableRole);
					}
				}
				if (location != null)
					newField.AddChild (new CSharpTokenNode (Convert (location [1]), 1), FieldDeclaration.Roles.Semicolon);
				typeStack.Peek ().AddChild (newField, TypeDeclaration.MemberRole);
				
			}
Exemple #5
0
 public RedILNode VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer, State data)
 {
     throw new System.NotImplementedException();
 }
		public void VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer)
		{
			StartNode(fixedVariableInitializer);
			fixedVariableInitializer.NameToken.AcceptVisitor(this);
			if (!fixedVariableInitializer.CountExpression.IsNull) {
				WriteToken(Roles.LBracket);
				Space(policy.SpacesWithinBrackets);
				fixedVariableInitializer.CountExpression.AcceptVisitor(this);
				Space(policy.SpacesWithinBrackets);
				WriteToken(Roles.RBracket);
			}
			EndNode(fixedVariableInitializer);
		}
Exemple #7
0
			public override void Visit(FixedField f)
			{
				var location = LocationsBag.GetMemberLocation(f);
				int locationIdx = 0;
				
				var newField = new FixedFieldDeclaration();
				AddAttributeSection(newField, f);
				AddModifiers(newField, location);
				if (location != null && location.Count > 0)
					newField.AddChild(new CSharpTokenNode(Convert(location [locationIdx++]), FixedFieldDeclaration.FixedKeywordRole), FixedFieldDeclaration.FixedKeywordRole);

				if (f.TypeExpression != null)
					newField.AddChild(ConvertToType(f.TypeExpression), Roles.Type);
				
				var variable = new FixedVariableInitializer();
				variable.AddChild(Identifier.Create(f.MemberName.Name, Convert(f.MemberName.Location)), Roles.Identifier);
				if (f.Initializer != null && !f.Initializer.IsNull) {
					variable.AddChild(new CSharpTokenNode(Convert(f.Initializer.Location), Roles.LBracket), Roles.LBracket);
					
					variable.AddChild((Expression)f.Initializer.Accept(this), Roles.Expression);
					var bracketLocations = LocationsBag.GetLocations(f.Initializer);
					if (bracketLocations != null)
						variable.AddChild(new CSharpTokenNode(Convert(bracketLocations [0]), Roles.RBracket), Roles.RBracket);
				}
				newField.AddChild(variable, FixedFieldDeclaration.VariableRole);
				
				if (f.Declarators != null) {
					foreach (var decl in f.Declarators) {
						var declLoc = LocationsBag.GetLocations(decl);
						if (declLoc != null)
							newField.AddChild(new CSharpTokenNode(Convert(declLoc [0]), Roles.Comma), Roles.Comma);
						
						variable = new FixedVariableInitializer();
						variable.AddChild(Identifier.Create(decl.Name.Value, Convert(decl.Name.Location)), Roles.Identifier);
						variable.AddChild(new CSharpTokenNode(Convert(decl.Initializer.Location), Roles.LBracket), Roles.LBracket);
						variable.AddChild((Expression)decl.Initializer.Accept(this), Roles.Expression);
						var bracketLocations = LocationsBag.GetLocations(decl.Initializer);
						if (bracketLocations != null)
							variable.AddChild(new CSharpTokenNode(Convert(bracketLocations [0]), Roles.RBracket), Roles.RBracket);

						newField.AddChild(variable, FixedFieldDeclaration.VariableRole);
					}
				}
				if (location != null && location.Count > locationIdx)
					newField.AddChild(new CSharpTokenNode(Convert(location [locationIdx]), Roles.Semicolon), Roles.Semicolon);
				typeStack.Peek().AddChild(newField, Roles.TypeMemberRole);
				
			}
 public override void VisitFixedVariableInitializer(FixedVariableInitializer syntax)
 {
     _underlyingVisitor.VisitFixedVariableInitializer(syntax);
 }
		public virtual void VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer)
		{
			DebugExpression(fixedVariableInitializer);
			StartNode(fixedVariableInitializer);
			WriteIdentifier(fixedVariableInitializer.NameToken);
			if (!fixedVariableInitializer.CountExpression.IsNull) {
				var braceHelper = BraceHelper.LeftBracket(this, CodeBracesRangeFlags.SquareBrackets);
				Space(policy.SpacesWithinBrackets);
				fixedVariableInitializer.CountExpression.AcceptVisitor(this);
				Space(policy.SpacesWithinBrackets);
				braceHelper.RightBracket();
			}
			EndNode(fixedVariableInitializer);
		}
Exemple #10
0
 public UnifiedElement VisitFixedVariableInitializer(
     FixedVariableInitializer fixedVariableInitializer, object data)
 {
     throw new NotImplementedException("FixedVariableInitializer");
 }
 public Node VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer)
 {
     return(CreateDummy(fixedVariableInitializer));
 }
Exemple #12
0
        public void VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer)
        {
            JsonObject initializer = new JsonObject();
            initializer.Comment = "VisitFixedVariableInitializer";
            initializer.AddJsonValue("identifier", GetIdentifier(fixedVariableInitializer.NameToken));
            if (!fixedVariableInitializer.CountExpression.IsNull)
            {

                initializer.AddJsonValue("count-expression", GenExpression(fixedVariableInitializer.CountExpression));
            }

            Push(initializer);
            throw new FirstTimeUseException();
        }
Exemple #13
0
 public void VisitFixedVariableInitializer(FixedVariableInitializer node)
 {
     NotSupported(node);
 }
Exemple #14
0
 public StringBuilder VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer, int data)
 {
     throw new ASLException("ASL does not understand the fixed keyword.");
 }
 /// <inheritdoc/>
 public virtual void VisitFixedVariableInitializer(FixedVariableInitializer syntax)
 {
     VisitNode(syntax);
 }
 public StringBuilder VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer, int data)
 {
     throw new SLSharpException("SL# does not understand the fixed keyword.");
 }
Exemple #17
0
 public void VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer)
 {
     throw new NotImplementedException();
 }
 public virtual void VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer)
 {
     if (this.ThrowException)
     {
         throw (Exception)this.CreateException(fixedVariableInitializer);
     }
 }
Exemple #19
0
 public StringBuilder VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer)
 {
     throw new NotImplementedException();
 }
		public virtual void VisitFixedVariableInitializer (FixedVariableInitializer fixedVariableInitializer)
		{
			VisitChildren (fixedVariableInitializer);
		}
 public JNode VisitFixedVariableInitializer(FixedVariableInitializer node)
 {
     throw new NotImplementedException();
 }
Exemple #22
0
 public override bool VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer)
 {
     base.VisitFixedVariableInitializer(fixedVariableInitializer);
     return(true);
 }
 public virtual Node VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer)
 {
     throw new System.NotImplementedException();
 }