Irony Issue

Jan 4 at 10:29 AM
Edited Jan 4 at 10:29 AM
Hello,

I want to create a grammar class for parsing boolean expressions. It can't create the syntax tree. The message is: "Invalid character: 't'." Can anyone find the error in the code?
My Code
 public class grammar : InterpretedLanguageGrammar
    {
        public grammar() : base(caseSensitive: false)
        {
            #region Definitions
            ConstantTerminal boolTe = new ConstantTerminal("b", typeof(LiteralValueNode));
            boolTe.Add("true", true);
            boolTe.Add("false", false);

            var boolexp = new NonTerminal("e");
            var boolT = new NonTerminal("t");
            var bnexp = new NonTerminal("br", typeof(BinaryOperationNode));
            var pexp = new NonTerminal("p");
            var bop = new NonTerminal("b", "operator");

            #endregion

            #region BNF Rules
            boolexp.Rule = boolTe | boolT | bnexp;
            boolT.Rule = pexp;
            pexp.Rule = "(" + boolexp + ")";

            bnexp.Rule = boolexp + bop + boolexp;
            bop.Rule = ToTerm("&") | "|";
            #endregion

            this.Root = boolexp;
            RegisterOperators(2, "&");
            RegisterBracePair("(", ")");
            MarkPunctuation("(", ")");
            MarkTransient(boolT, boolexp, bop, pexp);
            this.LanguageFlags = LanguageFlags.CreateAst;
        }        
    }

 ParseTree parseTree = parser.Parse("true&true");
            ScriptApp app = new ScriptApp(parser.Language);
            Object obj = app.Evaluate(parseTree);
Best regards,
designer