예제 #1
0
        public void AddUsing(UsingNamespace un)
        {
            if (DeclarationFound)
            {
                Compiler.Report.Error(1529, un.Location, "A using clause must precede all other namespace elements except extern alias declarations");
            }

            if (clauses == null)
            {
                clauses = new List <UsingNamespace> ();
            }

            clauses.Add(un);

            resolved = false;
        }
예제 #2
0
			public override void Visit(UsingNamespace un)
			{
				var ud = new UsingDeclaration();
				var loc = LocationsBag.GetLocations(un);
				ud.AddChild(new CSharpTokenNode(Convert(un.Location), UsingDeclaration.UsingKeywordRole), UsingDeclaration.UsingKeywordRole);
				if (un.NamespaceExpression != null)
					ud.AddChild(ConvertToType(un.NamespaceExpression), UsingDeclaration.ImportRole);
				if (loc != null)
					ud.AddChild(new CSharpTokenNode(Convert(loc [0]), Roles.Semicolon), Roles.Semicolon);
				AddToNamespace(ud);
			}
예제 #3
0
파일: namespace.cs 프로젝트: GirlD/mono
		public void AddUsing (UsingNamespace un)
		{
			if (DeclarationFound){
				Compiler.Report.Error (1529, un.Location, "A using clause must precede all other namespace elements except extern alias declarations");
			}

			if (clauses == null)
				clauses = new List<UsingNamespace> ();

			clauses.Add (un);
		}
예제 #4
0
 public virtual void Visit(UsingNamespace un)
 {
 }
예제 #5
0
void case_18()
#line 469 "cs-parser.jay"
{
		var un = new UsingNamespace ((ATypeNameExpression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));
		current_namespace.AddUsing (un);
		
		lbag.AddLocation (un, GetLocation (yyVals[0+yyTop]));
	  }
예제 #6
0
파일: visit.cs 프로젝트: KAW0/Alter-Native
		public virtual void Visit (UsingNamespace un)
		{
		}
예제 #7
0
파일: namespace.cs 프로젝트: nobled/mono
		void Warning_DuplicateEntry (UsingNamespace entry)
		{
			Compiler.Report.Warning (105, 3, entry.Location,
				"The using directive for `{0}' appeared previously in this namespace",
				entry.ResolvedExpression.GetSignatureForError ());
		}
예제 #8
0
		public void AddUsing (UsingNamespace un, bool forceAppend = false)
		{
			bool isPlayScript = this.CompilationSourceFile != null &&
				this.CompilationSourceFile.SourceFile != null && 
				this.CompilationSourceFile.SourceFile.FileType == Mono.CSharp.SourceFileType.PlayScript;

			if (DeclarationFound && !forceAppend && !isPlayScript){
				Compiler.Report.Error (1529, un.Location, "A using clause must precede all other namespace elements except extern alias declarations");
			}

			if (clauses == null)
				clauses = new List<UsingNamespace> ();

			clauses.Add (un);
		}