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


C# Boo類代碼示例

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


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

示例1: OnModule

 public override void OnModule(Boo.Lang.Compiler.Ast.Module module)
 {
     EnterNamespace((INamespace)TypeSystemServices.GetEntity(module));
     Visit(module.Members);
     Visit(module.Globals);
     LeaveNamespace();
 }
開發者ID:w4x,項目名稱:boolangstudio,代碼行數:7,代碼來源:ExpandMacros.cs

示例2: OnReferenceExpression

        /// <summary>
        /// Called when visting a reference expression.
        /// Will turn reference expressions with initial @ to string literals
        /// </summary>
        /// <param name="node">The node.</param>
        public override void OnReferenceExpression(Boo.Lang.Compiler.Ast.ReferenceExpression node)
        {
            if(node.Name.StartsWith("@")==false)
                return;

            ReplaceCurrentNode(new StringLiteralExpression(node.Name.Substring(1)));
        }
開發者ID:JackWangCUMT,項目名稱:rhino-dsl,代碼行數:12,代碼來源:UseSymbolsStep.cs

示例3: OnTypeMemberStatement

		public virtual void OnTypeMemberStatement(Boo.Lang.Compiler.Ast.TypeMemberStatement node)
		{	
			if (EnterTypeMemberStatement(node))
			{
				StatementModifier currentModifierValue = node.Modifier;
				if (null != currentModifierValue)
				{			
					StatementModifier newValue = (StatementModifier)VisitNode(currentModifierValue);
					if (!object.ReferenceEquals(newValue, currentModifierValue))
					{
						node.Modifier = newValue;
					}
				}
				TypeMember currentTypeMemberValue = node.TypeMember;
				if (null != currentTypeMemberValue)
				{			
					TypeMember newValue = (TypeMember)VisitNode(currentTypeMemberValue);
					if (!object.ReferenceEquals(newValue, currentTypeMemberValue))
					{
						node.TypeMember = newValue;
					}
				}

				LeaveTypeMemberStatement(node);
			}
		}
開發者ID:HaKDMoDz,項目名稱:GNet,代碼行數:26,代碼來源:DepthFirstTransformer.cs

示例4: CustomizeCompiler

        protected override void CustomizeCompiler(Boo.Lang.Compiler.BooCompiler compiler, Boo.Lang.Compiler.CompilerPipeline pipeline, string[] urls)
        {
            compiler.Parameters.Ducky = true;

            pipeline.Insert(1, new ImplicitBaseClassCompilerStep(
                _baseType, "Prepare", _namespaces));
        }
開發者ID:alasdairhurst,項目名稱:nginn,代碼行數:7,代碼來源:NGinnDslEngine.cs

示例5: CustomizeCompiler

        protected override void CustomizeCompiler(Boo.Lang.Compiler.BooCompiler compiler, Boo.Lang.Compiler.CompilerPipeline pipeline, string[] urls)
        {
            compiler.Parameters.Ducky = true;

            List<Assembly> asmss = new List<Assembly>();
            if (RefAllLoadedAssemblies)
            {
                asmss.AddRange(AppDomain.CurrentDomain.GetAssemblies());
            }
            if (ReferencedAssemblies != null) asmss.AddRange(ReferencedAssemblies);

            foreach (Assembly asm in asmss)
            {
                try
                {
                    string loc = asm.Location;
                    if (!compiler.Parameters.References.Contains(asm)) compiler.Parameters.References.Add(asm);
                }
                catch (Exception) { log.Debug("Error adding assembly dependency: {0}", asm.FullName); }
            }

            pipeline.Insert(1, new ImplicitBaseClassCompilerStep(typeof(ScriptDSLBase), "Prepare", Namespaces));
            var st2 = new AutoReferenceFilesCompilerStep(_baseDir + "\\include");
            pipeline.Insert(2, st2);
        }
開發者ID:lafar6502,項目名稱:cogmon,代碼行數:25,代碼來源:ScriptDSLEngine.cs

示例6: EnterModule

 /// <summary>
 /// Enters the module.
 /// </summary>
 /// <param name="node">The node.</param>
 /// <returns></returns>
 public override bool EnterModule(Boo.Lang.Compiler.Ast.Module node)
 {
     currentModule = node.Name;
     if (moduleNameToContainedTypes.ContainsKey(currentModule) == false)
         moduleNameToContainedTypes[currentModule] = new List<string>();
     return base.EnterModule(node);
 }
開發者ID:f4i2u1,項目名稱:rhino-etl,代碼行數:12,代碼來源:CorrelateTypesToModuleName.cs

示例7: OnArrayTypeReference

 public override void OnArrayTypeReference(Boo.Lang.Compiler.Ast.ArrayTypeReference node)
 {
     MethodInvocationExpression mie = new MethodInvocationExpression(
             node.LexicalInfo,
             CreateReference(node, "Boo.Lang.Compiler.Ast.ArrayTypeReference"));
     mie.Arguments.Add(Serialize(node.LexicalInfo));
     if (ShouldSerialize(node.IsPointer))
     {
         mie.NamedArguments.Add(
             new ExpressionPair(
                 CreateReference(node, "IsPointer"),
                 Serialize(node.IsPointer)));
     }
     if (ShouldSerialize(node.ElementType))
     {
         mie.NamedArguments.Add(
             new ExpressionPair(
                 CreateReference(node, "ElementType"),
                 Serialize(node.ElementType)));
     }
     if (ShouldSerialize(node.Rank))
     {
         mie.NamedArguments.Add(
             new ExpressionPair(
                 CreateReference(node, "Rank"),
                 Serialize(node.Rank)));
     }
     Push(mie);
 }
開發者ID:BITechnologies,項目名稱:boo,代碼行數:29,代碼來源:CodeSerializer.cs

示例8: OnModule

 public override void OnModule(Boo.Lang.Compiler.Ast.Module module)
 {
     EnterNamespace(InternalModule.ScopeFor(module));
     VisitTypeDefinitionBody(module);
     Visit(module.AssemblyAttributes);
     LeaveNamespace();
 }
開發者ID:neonux,項目名稱:boo,代碼行數:7,代碼來源:AbstractNamespaceSensitiveVisitorCompilerStep.cs

示例9: reply_with_one_of

 protected void reply_with_one_of(Boo.Lang.List replies)
 {
     var random = new Random();
     var indexToUse = random.Next(replies.Count);
     Console.WriteLine("replies.Count = {0}, using index {1}", replies.Count, indexToUse);
     reply(replies[indexToUse] as string);
 }
開發者ID:tormaroe,項目名稱:codename_mokolo,代碼行數:7,代碼來源:ResponseStrategy.cs

示例10: CreateParser

		public static WSABooParser CreateParser(int tabSize, string readerName, TextReader reader, Boo.Lang.Parser.ParserErrorHandler errorHandler)
		{
			var parser = new WSABooParser(CreateBooLexer(tabSize, readerName, reader));
			parser.setFilename(readerName);
			parser.Error += errorHandler;
			return parser;
		}
開發者ID:0xb1dd1e,項目名稱:boo,代碼行數:7,代碼來源:WSABooParser.cs

示例11: OnCompileUnit

		public virtual void OnCompileUnit(Boo.Lang.Compiler.Ast.CompileUnit node)
		{				
			if (EnterCompileUnit(node))
			{
				Visit(node.Modules);
				LeaveCompileUnit(node);
			}
		}
開發者ID:HaKDMoDz,項目名稱:GNet,代碼行數:8,代碼來源:DepthFirstVisitor.cs

示例12: AttributeApplicationError

 public static CompilerError AttributeApplicationError(Exception error, Boo.Lang.Compiler.Ast.Attribute attribute, Type attributeType)
 {
     return new CompilerError("BCE0009",
                               attribute.LexicalInfo,
                               error,
                               attributeType,
                               error.Message);
 }
開發者ID:w4x,項目名稱:boolangstudio,代碼行數:8,代碼來源:CompilerErrorFactory.cs

示例13: LeaveEnumDefinition

		public override void LeaveEnumDefinition(Boo.Lang.Compiler.Ast.EnumDefinition node)
		{
			var designator=new StringBuilder();
			designator.Append("T:");
			designator.Append(node.FullName);
			this.ProcessDocumentation(designator.ToString(), node);
			base.LeaveEnumDefinition(node);
		}
開發者ID:hlizard,項目名稱:boo,代碼行數:8,代碼來源:CreateAndSaveDocs.cs

示例14: Prepare

 public static void Prepare(Boo.Lang.Compiler.Pipelines.Parse result)
 {
     if(-1!=result.Find(typeof(BooParsingStep))){
         result.InsertAfter(typeof (BooParsingStep), new IncludeAstMacroExpandStep());
     }else if (-1!=result.Find(typeof(WSABooParsingStep))){
         result.InsertAfter(typeof(WSABooParsingStep), new IncludeAstMacroExpandStep());
     }
 }
開發者ID:Qorpent,項目名稱:comdiv.oldcore,代碼行數:8,代碼來源:IncludeAstMacroExpandStep.cs

示例15: OnExplicitMemberInfo

		public virtual void OnExplicitMemberInfo(Boo.Lang.Compiler.Ast.ExplicitMemberInfo node)
		{				
			if (EnterExplicitMemberInfo(node))
			{
				Visit(node.InterfaceType);
				LeaveExplicitMemberInfo(node);
			}
		}
開發者ID:HaKDMoDz,項目名稱:GNet,代碼行數:8,代碼來源:DepthFirstVisitor.cs


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