예제 #1
0
		void HandleVisitorFixedFieldDeclarationVisited (FixedFieldDeclaration node, InspectionData data)
		{
			foreach (var rule in policy.Rules) {
				if (rule.CheckField (node, data))
					return;
			}
		}
예제 #2
0
 public virtual void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
 {
     if (this.ThrowException)
     {
         throw (System.Exception) this.CreateException(fixedFieldDeclaration);
     }
 }
예제 #3
0
 public virtual void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
 {
     if (ThrowException)
     {
         throw (Exception)CreateException(fixedFieldDeclaration);
     }
 }
예제 #4
0
 public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
 {
     if (fixedFieldDeclaration.HasModifier(Modifiers.Static))
     {
         CheckDependency(fixedFieldDeclaration.ReturnType);
         base.VisitFixedFieldDeclaration(fixedFieldDeclaration);
     }
 }
 public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
 {
     fixedFieldDeclaration.ReturnType.AcceptVisitor(this);
     foreach (var init in fixedFieldDeclaration.Variables)
     {
         Colorize(init.NameToken, fieldDeclarationColor);
         init.CountExpression.AcceptVisitor(this);
     }
 }
예제 #6
0
 void HandleVisitorFixedFieldDeclarationVisited(FixedFieldDeclaration node, InspectionData data)
 {
     foreach (var rule in policy.Rules)
     {
         if (rule.CheckField(node, data))
         {
             return;
         }
     }
 }
            public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
            {
                base.VisitFixedFieldDeclaration(fixedFieldDeclaration);
                var entity = AffectedEntity.Field;

                if (fixedFieldDeclaration.Modifiers.HasFlag(Modifiers.Const))
                {
                    entity = AffectedEntity.ConstantField;
                }
                else if (fixedFieldDeclaration.Modifiers.HasFlag(Modifiers.Readonly))
                {
                    entity = AffectedEntity.ReadonlyField;
                }
                CheckName(fixedFieldDeclaration, entity, fixedFieldDeclaration.NameToken, GetAccessibiltiy(fixedFieldDeclaration, Modifiers.Private));
            }
		public virtual void VisitFixedFieldDeclaration (FixedFieldDeclaration fixedFieldDeclaration)
		{
			VisitChildren (fixedFieldDeclaration);
		}
 public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
 {
     CheckStaticRequired(fixedFieldDeclaration);
     base.VisitFixedFieldDeclaration(fixedFieldDeclaration);
 }
        public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
        {
            FixAttributesAndDocComment(fixedFieldDeclaration);

            FormatCommas(fixedFieldDeclaration, policy.SpaceBeforeFieldDeclarationComma, policy.SpaceAfterFieldDeclarationComma);

            var lastLoc = fixedFieldDeclaration.StartLocation;
            curIndent.Push(IndentType.Block);
            foreach (var initializer in fixedFieldDeclaration.Variables) {
                if (lastLoc.Line != initializer.StartLocation.Line) {
                    FixStatementIndentation(initializer.StartLocation);
                    lastLoc = initializer.StartLocation;
                }
                initializer.AcceptVisitor(this);
            }
            curIndent.Pop();
            FixSemicolon(fixedFieldDeclaration.SemicolonToken);
        }
예제 #11
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);
				
			}
예제 #12
0
 public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
 {
     base.VisitFixedFieldDeclaration(fixedFieldDeclaration);
     CheckNode(fixedFieldDeclaration);
 }
예제 #13
0
		public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
		{
			FormatAttributedNode(fixedFieldDeclaration);
			FormatCommas(fixedFieldDeclaration, policy.SpaceBeforeFieldDeclarationComma, policy.SpaceAfterFieldDeclarationComma);
			if (fixedFieldDeclaration.NextSibling is FieldDeclaration || fixedFieldDeclaration.NextSibling is FixedFieldDeclaration) {
				EnsureBlankLinesAfter(fixedFieldDeclaration, policy.BlankLinesBetweenFields);
			} else if (IsMember(fixedFieldDeclaration.NextSibling)) {
				EnsureBlankLinesAfter(fixedFieldDeclaration, policy.BlankLinesBetweenMembers);
			}
			
			var lastLoc = fixedFieldDeclaration.StartLocation;
			curIndent.Push(IndentType.Block);
			foreach (var initializer in fixedFieldDeclaration.Variables) {
				if (lastLoc.Line != initializer.StartLocation.Line) {
					FixStatementIndentation(initializer.StartLocation);
					lastLoc = initializer.StartLocation;
				}
				initializer.AcceptVisitor(this);
			}
			curIndent.Pop ();
		}
예제 #14
0
 public StringBuilder VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
 {
     throw new NotImplementedException();
 }
예제 #15
0
 public StringBuilder VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration, int data)
 {
     throw new SLSharpException("SL# does not understand the fixed keyword.");
 }
예제 #16
0
 public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
 {
     if (fixedFieldDeclaration.HasModifier(Modifiers.Static))
     {
         this.CheckDependency(fixedFieldDeclaration.ReturnType);
         base.VisitFixedFieldDeclaration(fixedFieldDeclaration);
     }
 }
예제 #17
0
			public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
			{
				base.VisitFixedFieldDeclaration(fixedFieldDeclaration);
				CheckNode(fixedFieldDeclaration);
			}
예제 #18
0
 public UnifiedElement VisitFixedFieldDeclaration(
     FixedFieldDeclaration fixedFieldDeclaration, object data)
 {
     throw new NotImplementedException("FixedFieldDeclaration");
 }
예제 #19
0
파일: TempEmitter.cs 프로젝트: yctri/Bridge
 public void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
 {
     throw new NotImplementedException();
 }
예제 #20
0
 public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
 {
     base.VisitFixedFieldDeclaration(fixedFieldDeclaration);
     unsafeStateStack.Peek().UseUnsafeConstructs = true;
 }
			public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
			{
				base.VisitFixedFieldDeclaration(fixedFieldDeclaration);
				var entity = AffectedEntity.Field;
				if (fixedFieldDeclaration.Modifiers.HasFlag(Modifiers.Const)) {
					entity = AffectedEntity.ConstantField;
				} else if (fixedFieldDeclaration.Modifiers.HasFlag(Modifiers.Readonly)) {
					entity = AffectedEntity.ReadonlyField;
				}
				CheckName(fixedFieldDeclaration, entity, fixedFieldDeclaration.NameToken, GetAccessibiltiy(fixedFieldDeclaration, Modifiers.Private));
			}
예제 #22
0
 public JNode VisitFixedFieldDeclaration(FixedFieldDeclaration node)
 {
     throw new NotImplementedException();
 }
 /// <inheritdoc/>
 public virtual void VisitFixedFieldDeclaration(FixedFieldDeclaration syntax)
 {
     VisitNode(syntax);
 }
예제 #24
0
 public Node VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
 {
     return(CreateDummy(fixedFieldDeclaration));
 }
예제 #25
0
 public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
 {
     Check(fixedFieldDeclaration.Name, fixedFieldDeclaration.NameToken, ctx.TranslateString("Fixed field"));
 }
예제 #26
0
        public void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
        {
            JsonObject declaration = CreateJsonEntityDeclaration(fixedFieldDeclaration);


            AddKeyword(declaration, FixedFieldDeclaration.FixedKeywordRole);
            declaration.AddJsonValue("variables", GetCommaSeparatedList(fixedFieldDeclaration.Variables));

            Push(declaration);
            throw new FirstTimeUseException();
        }
 public override void VisitFixedFieldDeclaration(FixedFieldDeclaration syntax)
 {
     _underlyingVisitor.VisitFixedFieldDeclaration(syntax);
 }
예제 #28
0
		public void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
		{
			StartNode(fixedFieldDeclaration);
			WriteAttributes(fixedFieldDeclaration.Attributes);
			WriteModifiers(fixedFieldDeclaration.ModifierTokens);
			WriteKeyword(FixedFieldDeclaration.FixedKeywordRole);
			Space();
			fixedFieldDeclaration.ReturnType.AcceptVisitor(this);
			Space();
			WriteCommaSeparatedList(fixedFieldDeclaration.Variables);
			Semicolon();
			EndNode(fixedFieldDeclaration);
		}
 public virtual void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
 {
     if (this.ThrowException)
     {
         throw (Exception)this.CreateException(fixedFieldDeclaration);
     }
 }
예제 #30
0
 public RedILNode VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration, State data)
 {
     throw new System.NotImplementedException();
 }
예제 #31
0
파일: Lower.cs 프로젝트: evanw/minisharp
 public void VisitFixedFieldDeclaration(FixedFieldDeclaration node)
 {
     NotSupported(node);
 }
예제 #32
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);
				
			}
예제 #33
0
 public StringBuilder VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration, int data)
 {
     throw new ASLException("ASL does not understand the fixed keyword.");
 }
 public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
 {
     throw NotSupportedToConsistency();
 }
예제 #35
0
		public override IUnresolvedEntity VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration, object data)
		{
			// TODO: add support for fixed fields
			return base.VisitFixedFieldDeclaration(fixedFieldDeclaration, data);
		}
 public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
 {
     // nothing
 }
예제 #37
0
 public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
 {
 }
예제 #38
0
 public virtual Node VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
 {
     throw new System.NotImplementedException();
 }