當前位置: 首頁>>代碼示例>>C#>>正文


C# CSharp.Report類代碼示例

本文整理匯總了C#中Mono.CSharp.Report的典型用法代碼示例。如果您正苦於以下問題:C# Report類的具體用法?C# Report怎麽用?C# Report使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Report類屬於Mono.CSharp命名空間,在下文中一共展示了Report類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Shell

		public Shell(MainWindow container) : base()
		{
			this.container = container;
			WrapMode = WrapMode.Word;
			CreateTags ();

			Pango.FontDescription font_description = new Pango.FontDescription();
			font_description.Family = "Monospace";
			ModifyFont(font_description);
			
			TextIter end = Buffer.EndIter;
			Buffer.InsertWithTagsByName (ref end, "Mono C# Shell, type 'help;' for help\n\nEnter statements or expressions below.\n", "Comment");
			ShowPrompt (false);
			
			report = new Report (new ConsoleReportPrinter ());
			evaluator = new Evaluator (new CompilerSettings (), report);
			evaluator.DescribeTypeExpressions = true;
			
			evaluator.InteractiveBaseClass = typeof (InteractiveGraphicsBase);
			evaluator.Run ("LoadAssembly (\"System.Drawing\");");
			evaluator.Run ("using System; using System.Linq; using System.Collections; using System.Collections.Generic; using System.Drawing;");

			if (!MainClass.Debug){
				GuiStream error_stream = new GuiStream ("Error", (x, y) => Output (x, y));
				StreamWriter gui_output = new StreamWriter (error_stream);
				gui_output.AutoFlush = true;
				Console.SetError (gui_output);

				GuiStream stdout_stream = new GuiStream ("Stdout", (x, y) => Output (x, y));
				gui_output = new StreamWriter (stdout_stream);
				gui_output.AutoFlush = true;
				Console.SetOut (gui_output);
			}
		}
開發者ID:krijesta,項目名稱:mono-tools,代碼行數:34,代碼來源:Shell.cs

示例2: CSharpCompiler

        public CSharpCompiler()
        {
            CompilerSettings settings = new CompilerSettings ();
            Report report = new Report (new NullReportPrinter ());

            evaluator = new Evaluator (settings, report);
        }
開發者ID:syoubin,項目名稱:gbrainy_android,代碼行數:7,代碼來源:CSharpCompiler.cs

示例3: GetDocCommentNode

		private static XmlNode GetDocCommentNode (MemberCore mc,
			string name, Report Report)
		{
			// FIXME: It could be even optimizable as not
			// to use XmlDocument. But anyways the nodes
			// are not kept in memory.
			XmlDocument doc = RootContext.Documentation.XmlDocumentation;
			try {
				XmlElement el = doc.CreateElement ("member");
				el.SetAttribute ("name", name);
				string normalized = mc.DocComment;
				el.InnerXml = normalized;
				// csc keeps lines as written in the sources
				// and inserts formatting indentation (which 
				// is different from XmlTextWriter.Formatting
				// one), but when a start tag contains an 
				// endline, it joins the next line. We don't
				// have to follow such a hacky behavior.
				string [] split =
					normalized.Split ('\n');
				int j = 0;
				for (int i = 0; i < split.Length; i++) {
					string s = split [i].TrimEnd ();
					if (s.Length > 0)
						split [j++] = s;
				}
				el.InnerXml = line_head + String.Join (
					line_head, split, 0, j);
				return el;
			} catch (Exception ex) {
				Report.Warning (1570, 1, mc.Location, "XML comment on `{0}' has non-well-formed XML ({1})", name, ex.Message);
				XmlComment com = doc.CreateComment (String.Format ("FIXME: Invalid documentation markup was found for member {0}", name));
				return com;
			}
		}
開發者ID:kumpera,項目名稱:mono,代碼行數:35,代碼來源:doc.cs

示例4: GenerateDocComment

        //
        // Fixes full type name of each documented types/members up.
        //
        public void GenerateDocComment(Report r)
        {
            TypeContainer root = RootContext.ToplevelTypes;

            if (root.Types != null)
                foreach (TypeContainer tc in root.Types)
                    DocUtil.GenerateTypeDocComment (tc, null, r);
        }
開發者ID:speier,項目名稱:shake,代碼行數:11,代碼來源:doc.cs

示例5: Parse

        public static void Parse(SeekableStreamReader reader, SourceFile sourceFile, ModuleContainer module, ParserSession session, Report report)
        {
            var file = new CompilationSourceFile(module, sourceFile);
            module.AddTypeContainer(file);

            CSharpParser parser = new CSharpParser(reader, file, report, session);
            parser.parse();
        }
開發者ID:Nystul-the-Magician,項目名稱:daggerfall-unity,代碼行數:8,代碼來源:CustomDynamicDriver.cs

示例6: Error_InvalidConstantType

 public static void Error_InvalidConstantType(TypeSpec t, Location loc, Report Report)
 {
     if (t.IsGenericParameter) {
         Report.Error (1959, loc,
             "Type parameter `{0}' cannot be declared const", TypeManager.CSharpName (t));
     } else {
         Report.Error (283, loc,
             "The type `{0}' cannot be declared const", TypeManager.CSharpName (t));
     }
 }
開發者ID:speier,項目名稱:shake,代碼行數:10,代碼來源:const.cs

示例7: Runner

        /// <summary>
        /// Initializes the evaluator and includes a few basic System libraries
        /// </summary>
        public Runner()
        {
            _report   = new Report(new Printer(this));
            _settings = new CommandLineParser(_report).ParseArguments(new string[] {});
            _eval     = new Evaluator(_settings, _report);

            _eval.Run("using System;");
            _eval.Run("using System.Linq;");
            _eval.Run("using System.Collections.Generic;");
        }
開發者ID:RainsSoft,項目名稱:MonoCompilerAsAService,代碼行數:13,代碼來源:Runner.cs

示例8: GenerateCode

		public static void GenerateCode (ModuleContainer module, ParserSession session, Report report)
		{
			GenerateDynamicPartialClasses(module, session, report);
			if (report.Errors > 0)
				return;

			GenerateEmbedClasses(module, session, report);
			if (report.Errors > 0)
				return;

		}
開發者ID:rlfqudxo,項目名稱:playscript-mono,代碼行數:11,代碼來源:ps-codegen.cs

示例9: Runner

        /// <summary>
        /// Initializes the evaluator and includes a few basic System libraries
        /// </summary>
        public Runner()
        {
            _report = new Report(new Printer(this));
            _settings = new CommandLineParser(_report).ParseArguments (new string[] {});
            _eval = new Evaluator(_settings, _report);

            _eval.ReferenceAssembly(typeof(System.Linq.Enumerable).Assembly);

            _eval.Run("using System;");
            _eval.Run("using System.Collections.Generic;");
            _eval.Run("using System.Linq;");
        }
開發者ID:jorik041,項目名稱:runcs,代碼行數:15,代碼來源:Runner.cs

示例10: Evaluator

		public Evaluator (CompilerSettings settings, Report report)
		{
			ctx = new CompilerContext (settings, report);

			module = new ModuleContainer (ctx);
			module.Evaluator = this;

			// FIXME: Importer needs this assembly for internalsvisibleto
			module.SetDeclaringAssembly (new AssemblyDefinitionDynamic (module, "evaluator"));
			importer = new ReflectionImporter (module, ctx.BuildinTypes);

			InteractiveBaseClass = typeof (InteractiveBase);
			fields = new Dictionary<string, Tuple<FieldSpec, FieldInfo>> ();
		}
開發者ID:famousthom,項目名稱:monodevelop,代碼行數:14,代碼來源:eval.cs

示例11: InvokeCompiler

        public static bool InvokeCompiler(string [] args, TextWriter error)
        {
            try {
                var r = new Report (new StreamReportPrinter (error));
                CommandLineParser cmd = new CommandLineParser (r, error);
                var setting = cmd.ParseArguments (args);
                if (setting == null || r.Errors > 0)
                    return false;

                var d = new Driver (new CompilerContext (setting, r));
                return d.Compile ();
            } finally {
                Reset ();
            }
        }
開發者ID:RainsSoft,項目名稱:MonoCompilerAsAService,代碼行數:15,代碼來源:driver.cs

示例12: GenerateTypeDocComment

		// TypeContainer

		//
		// Generates xml doc comments (if any), and if required,
		// handle warning report.
		//
		internal static void GenerateTypeDocComment (TypeContainer t,
			DeclSpace ds, Report Report)
		{
			GenerateDocComment (t, ds, Report);

			if (t.DefaultStaticConstructor != null)
				t.DefaultStaticConstructor.GenerateDocComment (t);

			if (t.InstanceConstructors != null)
				foreach (Constructor c in t.InstanceConstructors)
					c.GenerateDocComment (t);

			if (t.Types != null)
				foreach (TypeContainer tc in t.Types)
					tc.GenerateDocComment (t);

			if (t.Delegates != null)
				foreach (Delegate de in t.Delegates)
					de.GenerateDocComment (t);

			if (t.Constants != null)
				foreach (Const c in t.Constants)
					c.GenerateDocComment (t);

			if (t.Fields != null)
				foreach (FieldBase f in t.Fields)
					f.GenerateDocComment (t);

			if (t.Events != null)
				foreach (Event e in t.Events)
					e.GenerateDocComment (t);

			if (t.Indexers != null)
				foreach (Indexer ix in t.Indexers)
					ix.GenerateDocComment (t);

			if (t.Properties != null)
				foreach (Property p in t.Properties)
					p.GenerateDocComment (t);

			if (t.Methods != null)
				foreach (MethodOrOperator m in t.Methods)
					m.GenerateDocComment (t);

			if (t.Operators != null)
				foreach (Operator o in t.Operators)
					o.GenerateDocComment (t);
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:54,代碼來源:doc.cs

示例13: Check

        // <summary>
        //   Checks the object @mod modifiers to be in @allowed.
        //   Returns the new mask.  Side effect: reports any
        //   incorrect attributes.
        // </summary>
        public static Modifiers Check(Modifiers allowed, Modifiers mod, Modifiers def_access, Location l, Report Report)
        {
            int invalid_flags = (~(int) allowed) & ((int) mod & ((int) Modifiers.TOP - 1));
            int i;

            if (invalid_flags == 0){

                if ((mod & Modifiers.UNSAFE) != 0){
                    RootContext.CheckUnsafeOption (l, Report);
                }

                //
                // If no accessibility bits provided
                // then provide the defaults.
                //
                if ((mod & Modifiers.AccessibilityMask) == 0) {
                    mod |= def_access;
                    if (def_access != 0)
                        mod |= Modifiers.DEFAULT_ACCESS_MODIFER;
                    return mod;
                }

                //
                // Make sure that no conflicting accessibility
                // bits have been set.  Protected+Internal is
                // allowed, that is why they are placed on bits
                // 1 and 4 (so the shift 3 basically merges them)
                //
                int a = (int) mod;
                a &= 15;
                a |= (a >> 3);
                a = ((a & 2) >> 1) + (a & 5);
                a = ((a & 4) >> 2) + (a & 3);
                if (a > 1)
                    Report.Error (107, l, "More than one protection modifier specified");

                return mod;
            }

            for (i = 1; i <= (int) Modifiers.TOP; i <<= 1) {
                if ((i & invalid_flags) == 0)
                    continue;

                Error_InvalidModifier (l, Name ((Modifiers) i), Report);
            }

            return allowed & mod;
        }
開發者ID:speier,項目名稱:shake,代碼行數:53,代碼來源:modifiers.cs

示例14: ParseFile

        public static CompilerCompilationUnit ParseFile(string[] args, Stream input, string inputFile, ReportPrinter reportPrinter)
        {
            lock (parseLock) {
                try {
                    //                                     Driver d = Driver.Create (args, false, null, reportPrinter);
                    //                                     if (d == null)
                    //                                             return null;

                    var r = new Report (reportPrinter);
                    CommandLineParser cmd = new CommandLineParser (r, Console.Out);
                    var setting = cmd.ParseArguments (args);
                    if (setting == null || r.Errors > 0)
                        return null;
                    setting.Version = LanguageVersion.V_5;

                    CompilerContext ctx = new CompilerContext (setting, r);

                    var files = new List<CompilationSourceFile> ();
                    var unit = new CompilationSourceFile (inputFile, inputFile, 0);
                    var module = new ModuleContainer (ctx);
                    unit.NamespaceContainer = new NamespaceContainer (null, module, null, unit);
                    files.Add (unit);
                    Location.Initialize (files);

                    // TODO: encoding from driver
                    SeekableStreamReader reader = new SeekableStreamReader (input, Encoding.UTF8);

                    RootContext.ToplevelTypes = module;

                    CSharpParser parser = new CSharpParser (reader, unit);
                    parser.Lexer.TabSize = 1;
                    parser.Lexer.sbag = new SpecialsBag ();
                    parser.LocationsBag = new LocationsBag ();
                    parser.UsingsBag = new UsingsBag ();
                    parser.parse ();

                    return new CompilerCompilationUnit () {
                        ModuleCompiled = RootContext.ToplevelTypes,
                        LocationsBag = parser.LocationsBag,
                        UsingsBag = parser.UsingsBag,
                        SpecialsBag = parser.Lexer.sbag,
                        LastYYValue = parser.LastYYVal
                    };
                } finally {
                    Reset ();
                }
            }
        }
開發者ID:holmak,項目名稱:NRefactory,代碼行數:48,代碼來源:driver.cs

示例15: CreateContext

        private CompilerContext CreateContext([NotNull] string source)
        {
            var settings = new CompilerSettings
            {
                Target = Target.Library,
                TargetExt = ".dll",
                LoadDefaultReferences = true,
                ShowFullPaths = false,
                StdLib = true,
            };

            var context = new CompilerContext(settings, new ConsoleReportPrinter(_logger));
            context.SourceFiles.Add(new SourceFile("Source", source, 0));

            _report = new Report(context, new ConsoleReportPrinter(_logger));

            return context;
        }
開發者ID:Tauron1990,項目名稱:Radio-Streamer,代碼行數:18,代碼來源:StyleScriptCompiler.cs


注:本文中的Mono.CSharp.Report類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。