nextToken() public method

public nextToken ( ) : Token
return AIMA.Core.Logic.Common.Token
Example #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());
 }
Example #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());
 }
Example #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());
        }