Ejemplo n.º 1
0
        //Pipe/Alternative
        //New version proposed by the codeplex user bdaugherty
        internal static BnfExpression Op_Pipe(BnfTerm term1, BnfTerm term2)
        {
            BnfExpression expr1 = term1 as BnfExpression;

            if (expr1 == null)
            {
                expr1 = new BnfExpression(term1);
            }
            BnfExpression expr2 = term2 as BnfExpression;

            if (expr2 == null)
            {
                expr2 = new BnfExpression(term2);
            }
            expr1.Data.AddRange(expr2.Data);
            return(expr1);
        }
Ejemplo n.º 2
0
 public NonTerminal(string name, BnfExpression expression)
     : this(name) {
     Rule = expression;
 }
Ejemplo n.º 3
0
 public NonTerminal(string name, BnfExpression expression)
     : this(name)
 {
     Rule   = expression;
     Flags |= TermFlags.NoAstNode;
 }