-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExpression.cs
35 lines (31 loc) · 972 Bytes
/
Expression.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
namespace Event_parse
{
class Expression
{
public string name { get; set; }
public string pattern { get; set; }
//public int begin_shift { get; set; }
//public int end_shift { get; set; }
//public bool has_inner_info { get; set; }
//public List<Expression> children { get; set; }
public List<Expression> children = new List<Expression>();
public bool HasChildren()
{
if (children.Count >0)
return true;
else
return false;
}
public void AddChild(Expression child)
{ children.Add(child); }
public void Print()
{
Console.WriteLine(this.name.ToString().PadRight(15) + this.pattern);
if(this.HasChildren())
foreach (Expression chExpr in this.children)
chExpr.Print();
}
}
}