public IntellisenseIcon Resolve(IBooParseTreeNode node) { Type nodeType = node.GetType(); if (treeNodeIconMap.ContainsKey(nodeType)) return treeNodeIconMap[nodeType]; return 0; }
private IBooParseTreeNode GetScopeByLine(IBooParseTreeNode node, int line) { foreach (IBooParseTreeNode child in node.Children) { IBooParseTreeNode foundNode = GetScopeByLine(child, line); if (foundNode != null) return foundNode; } bool isScopable = AttributeHelper.Has<ScopableAttribute>(node.GetType()); if (isScopable && node.ContainsLine(line)) return node; return null; }
private static string Output(IBooParseTreeNode node, int indentLevel) { string indent = ""; for (int i = 0; i < indentLevel; i++) { indent += " "; } string output = indent + node.GetType().Name + ": " + node.Name + "(" + node.StartLine + "," + node.EndLine + ")" + Environment.NewLine; foreach (IBooParseTreeNode child in node.Children) { output += Output(child, indentLevel + 1); } return output; }