aboutsummaryrefslogtreecommitdiffstatsci
path: root/Samples/CrowIDE/src/Editors/CodeBuffer/Node.cs
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2019-05-06 00:37:48 +0200
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2019-05-06 00:37:48 +0200
commit09abcce174f8dc4e612f5cd98b07dffced5b38cd (patch)
treef7c1c60b81cba6e05fafc5719dc9a21f9f4ed50e /Samples/CrowIDE/src/Editors/CodeBuffer/Node.cs
parente2f434f35a86a30962f2aebb36fcf59c9250838d (diff)
wip
Diffstat (limited to 'Samples/CrowIDE/src/Editors/CodeBuffer/Node.cs')
-rw-r--r--Samples/CrowIDE/src/Editors/CodeBuffer/Node.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/Samples/CrowIDE/src/Editors/CodeBuffer/Node.cs b/Samples/CrowIDE/src/Editors/CodeBuffer/Node.cs
new file mode 100644
index 00000000..9db55428
--- /dev/null
+++ b/Samples/CrowIDE/src/Editors/CodeBuffer/Node.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+
+namespace Crow.Coding
+{
+ public class Node
+ {
+ public Node Parent;
+ public string Name;
+ public string Type;
+ public CodeLine StartLine;
+ public CodeLine EndLine;
+ public Dictionary<string,string> Attributes = new Dictionary<string, string> ();
+
+ public List<Node> Children = new List<Node>();
+
+ public Node ()
+ {
+ }
+
+ public void AddChild (Node child) {
+ child.Parent = this;
+ Children.Add (child);
+ }
+
+ public int Level {
+ get { return Parent == null ? 1 : Parent.Level + 1; }
+ }
+
+ public override string ToString ()
+ {
+ return string.Format ("Name:{0}, Type:{1}\n\tparent:{2}", Name, Type, Parent);
+ }
+ }
+}
+