本文整理汇总了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();
}
示例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)));
}
示例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);
}
}
示例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));
}
示例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);
}
示例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);
}
示例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);
}
示例8: OnModule
public override void OnModule(Boo.Lang.Compiler.Ast.Module module)
{
EnterNamespace(InternalModule.ScopeFor(module));
VisitTypeDefinitionBody(module);
Visit(module.AssemblyAttributes);
LeaveNamespace();
}
示例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);
}
示例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;
}
示例11: OnCompileUnit
public virtual void OnCompileUnit(Boo.Lang.Compiler.Ast.CompileUnit node)
{
if (EnterCompileUnit(node))
{
Visit(node.Modules);
LeaveCompileUnit(node);
}
}
示例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);
}
示例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);
}
示例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());
}
}
示例15: OnExplicitMemberInfo
public virtual void OnExplicitMemberInfo(Boo.Lang.Compiler.Ast.ExplicitMemberInfo node)
{
if (EnterExplicitMemberInfo(node))
{
Visit(node.InterfaceType);
LeaveExplicitMemberInfo(node);
}
}