📄 compilationunit.cs
字号:
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision: 1965 $</version>
// </file>
using System;
using System.Collections;
namespace ICSharpCode.NRefactory.Ast
{
public class CompilationUnit : AbstractNode
{
// Children in C#: UsingAliasDeclaration, UsingDeclaration, AttributeSection, NamespaceDeclaration
// Children in VB: OptionStatements, ImportsStatement, AttributeSection, NamespaceDeclaration
Stack blockStack = new Stack();
public CompilationUnit()
{
blockStack.Push(this);
}
public void BlockStart(INode block)
{
blockStack.Push(block);
}
public void BlockEnd()
{
blockStack.Pop();
}
public INode CurrentBock {
get {
return blockStack.Count > 0 ? (INode)blockStack.Peek() : null;
}
}
public override void AddChild(INode childNode)
{
if (childNode != null) {
INode parent = (INode)blockStack.Peek();
parent.Children.Add(childNode);
childNode.Parent = parent;
}
}
public override object AcceptVisitor(IAstVisitor visitor, object data)
{
return visitor.VisitCompilationUnit(this, data);
}
public override string ToString()
{
return String.Format("[CompilationUnit]");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -