本文整理汇总了C#中ICSharpCode.NRefactory.Ast.CompilationUnit.AcceptChildren方法的典型用法代码示例。如果您正苦于以下问题:C# CompilationUnit.AcceptChildren方法的具体用法?C# CompilationUnit.AcceptChildren怎么用?C# CompilationUnit.AcceptChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.NRefactory.Ast.CompilationUnit
的用法示例。
在下文中一共展示了CompilationUnit.AcceptChildren方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitCompilationUnit
public object VisitCompilationUnit(CompilationUnit compilationUnit, object data)
{
module = new B.Module();
module.LexicalInfo = new B.LexicalInfo(fileName, 1, 1);
compilationUnit.AcceptChildren(this, data);
if (entryPointMethod != null) {
bool allMembersAreStatic = true;
foreach (B.TypeMember member in entryPointMethod.DeclaringType.Members) {
allMembersAreStatic &= member.IsStatic;
}
if (allMembersAreStatic) {
entryPointMethod.DeclaringType.Attributes.Add(MakeAttribute(("module")));
} else {
lastLexicalInfo = entryPointMethod.LexicalInfo;
B.Expression expr = MakeReferenceExpression(entryPointMethod.DeclaringType.Name + ".Main");
B.MethodInvocationExpression mie = new B.MethodInvocationExpression(lastLexicalInfo, expr);
if (entryPointMethod.Parameters.Count > 0) {
mie.Arguments.Add(MakeReferenceExpression("argv"));
}
B.SimpleTypeReference ret = entryPointMethod.ReturnType as B.SimpleTypeReference;
if (ret.Name == "void" || ret.Name == "System.Void")
module.Globals.Add(new B.ExpressionStatement(mie));
else
module.Globals.Add(new B.ReturnStatement(lastLexicalInfo, mie, null));
}
}
B.Module tmp = module;
module = null;
return tmp;
}
示例2: VisitCompilationUnit
public override object VisitCompilationUnit(CompilationUnit compilationUnit, object data)
{
Contract.Requires(compilationUnit != null);
// Visit children (E.g. TypeDcelarion objects)
compilationUnit.AcceptChildren(this, data);
return null;
}
示例3: VisitCompilationUnit
public override object VisitCompilationUnit(CompilationUnit compilationUnit, object data)
{
Contract.Requires(compilationUnit != null);
DictClass = new Dictionary<string, ClassStructure>();
// Visit children (E.g. TypeDcelarion objects)
compilationUnit.AcceptChildren(this, data);
return null;
}
示例4: TrackedVisitCompilationUnit
public override object TrackedVisitCompilationUnit(CompilationUnit compilationUnit, object data)
{
compilationUnit.AcceptChildren(this, data);
return null;
}
示例5: VisitCompilationUnit
public override object VisitCompilationUnit(CompilationUnit compilationUnit, object data)
{
if (compilationUnit == null) {
throw new ArgumentNullException("compilationUnit");
}
CodeNamespace globalNamespace = new CodeNamespace("Global");
//namespaces.Add(globalNamespace);
namespaceDeclarations.Push(globalNamespace);
compilationUnit.AcceptChildren(this, data);
codeCompileUnit.Namespaces.Add(globalNamespace);
return globalNamespace;
}
示例6: TrackedVisitCompilationUnit
public override object TrackedVisitCompilationUnit(CompilationUnit compilationUnit, object data)
{
// Visit the child items of the compilation unit.
compilationUnit.AcceptChildren(this, data);
return null;
}
示例7: VisitCompilationUnit
public virtual object VisitCompilationUnit(CompilationUnit compilationUnit, object data)
{
Debug.Assert((compilationUnit != null));
return compilationUnit.AcceptChildren(this, data);
}
示例8: VisitCompilationUnit
public virtual bool VisitCompilationUnit(CompilationUnit compilationUnit, object d)
{
if ((compilationUnit == null)) {
return SetFailure();
}
if ((d == null)) {
return SetFailure();
}
if(compilationUnit.GetType() != d.GetType()) {return SetFailure();}
var data = (CompilationUnit)d;
if (!IsMatch(compilationUnit, data)) {
return SetFailure();
}
return compilationUnit.AcceptChildren(this, d);
}
示例9: VisitCompilationUnit
public override object VisitCompilationUnit (CompilationUnit node, object data)
{
node.AcceptChildren (this, null);
return null;
}