Inheritance: AIMA.Core.Logic.Common.Lexer
Esempio n. 1
0
 public void testLexImpliesExpression()
 {
     PELexer pelexer = new PELexer();
     pelexer.setInput("(P => Q)");
     Assert.AreEqual(new Token((int)LogicTokenTypes.LPAREN, "("), pelexer
             .nextToken());
     Assert.AreEqual(new Token((int)LogicTokenTypes.SYMBOL, "P"), pelexer
             .nextToken());
     Assert.AreEqual(new Token((int)LogicTokenTypes.CONNECTOR, "=>"), pelexer
             .nextToken());
 }
Esempio n. 2
0
 public void testLexBiCOnditionalExpression()
 {
     PELexer pelexer = new PELexer();
     pelexer.setInput("(B11 <=> (P12 OR P21))");
     Assert.AreEqual(new Token((int)LogicTokenTypes.LPAREN, "("), pelexer
             .nextToken());
     Assert.AreEqual(new Token((int)LogicTokenTypes.SYMBOL, "B11"), pelexer
             .nextToken());
     Assert.AreEqual(new Token((int)LogicTokenTypes.CONNECTOR, "<=>"),
             pelexer.nextToken());
 }
Esempio n. 3
0
        public void testLexBasicExpression()
        {
            PELexer pelexer = new PELexer();
            pelexer.setInput("(P)");
            Assert.AreEqual(new Token((int)LogicTokenTypes.LPAREN, "("), pelexer
                    .nextToken());
            Assert.AreEqual(new Token((int)LogicTokenTypes.SYMBOL, "P"), pelexer
                    .nextToken());
            Assert.AreEqual(new Token((int)LogicTokenTypes.RPAREN, ")"), pelexer
                    .nextToken());

            Assert.AreEqual(new Token((int)LogicTokenTypes.EOI, "EOI"), pelexer
                    .nextToken());
        }
Esempio n. 4
0
 public override ParseTreeNode parse(String inputString)
 {
     lexer = new PELexer(inputString);
     fillLookAheadBuffer();
     return parseSentence();
 }
Esempio n. 5
0
 public override ParseTreeNode parse(String inputString)
 {
     lexer = new PELexer(inputString);
     fillLookAheadBuffer();
     return(parseSentence());
 }