Beispiel #1
0
 /// <summary>
 /// 代码树节点构造器
 /// </summary>
 /// <param name="nname">节点名字</param>
 /// <param name="nt">节点类型</param>
 /// <param name="nodeDepth">节点深度</param>
 /// <param name="nodeIndex">节点广度</param>
 /// <param name="paraParent">节点双亲</param>
 public KagaNode(string nname, NodeType nt, int nodeDepth, int nodeIndex, KagaNode paraParent)
 {
     // 初始化节点信息
     this.atype     = nt;
     this.anodeName = nname;
     this.depth     = nodeDepth;
     this.parent    = paraParent;
     this.children  = new List <KagaNode>();
     // 如果是代码块,那就要生成符号表
     if (nt.ToString().Contains(Consta.prefix_block))
     {
         this.isNewBlock  = true;
         this.symbolTable = new KagaTable(this.depth, this);
     }
 }
Beispiel #2
0
 /// <summary>
 /// 代码树节点构造器
 /// </summary>
 /// <param name="nname">节点名字</param>
 /// <param name="nt">节点类型</param>
 /// <param name="nodeDepth">节点深度</param>
 /// <param name="nodeIndex">节点广度</param>
 /// <param name="paraParent">节点双亲</param>
 public KagaNode(string nname, NodeType nt, int nodeDepth, int nodeIndex, KagaNode paraParent)
 {
     // 初始化节点信息
     this.atype = nt;
     this.anodeName = nname;
     this.depth = nodeDepth;
     this.parent = paraParent;
     this.children = new List<KagaNode>();
     // 如果是代码块,那就要生成符号表
     if (nt.ToString().Contains(Consta.prefix_block))
     {
         this.isNewBlock = true;
         this.symbolTable = new KagaTable(this.depth, this);
     }
 }