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()); }
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()); }
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()); }