Ejemplo n.º 1
0
        public Rule(TItem name, AstNode body, string ovr)
        {
            this.Name = name;
            this.Body = body;
            this.Override = ovr;

            Items = new List<TItem> { name };
            Children = new List<AstNode> { body };
        }
Ejemplo n.º 2
0
        public Star(AstNode body)
        {
            this.Body = body;

            Children = new List<AstNode> { body };
        }
Ejemplo n.º 3
0
        public GrammarFile(AstNode preamble, AstNode grammar)
        {
            this.Preamble = preamble as Preamble;
            this.Grammar = grammar as Grammar;

            Children = new List<AstNode> { grammar };
        }
Ejemplo n.º 4
0
        public Or(AstNode left, AstNode right)
        {
            this.Left = left;
            this.Right = right;

            Children = new List<AstNode> { left, right };
        }
Ejemplo n.º 5
0
 public Fail(AstNode message)
 {
     if (message != null)
         this.Message = message.GetText().Trim();
 }
Ejemplo n.º 6
0
        public Cond(AstNode body, TItem exp)
        {
            this.Body = body;
            this.Expression = exp;

            Children = new List<AstNode> { body };
            Items = new List<TItem> { exp };
        }
Ejemplo n.º 7
0
 public static char GetChar(AstNode node)
 {
     if (node != null)
     {
         string str = node.GetText().Trim('\'').Trim();
         str = Regex.Unescape(str);
         foreach (char ch in str)
             return ch;
     }
     return (char)0;
 }
Ejemplo n.º 8
0
        public Bind(AstNode body, TItem varname)
        {
            this.Body = body;
            this.VarName = varname;

            Children = new List<AstNode> { body };
            Items = new List<TItem> { varname };
        }
Ejemplo n.º 9
0
        public Args(AstNode parms, AstNode body)
        {
            this.Parms = parms;
            this.Body = body;

            Children = new List<AstNode> { body };
        }