use of edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.EvidenceLLexer in project bayou by capergroup.
the class EvidenceLLexerTests method testLexAlternating.
@Test
public void testLexAlternating() {
EvidenceLLexer lexer = makeLexer();
Iterator<Token> tokens = lexer.lex("ident1:ident2:ident3").iterator();
Assert.assertTrue(tokens.hasNext());
Token token = tokens.next();
Assert.assertEquals("ident1", token.getLexeme());
Assert.assertTrue(token.getType() instanceof TokenTypeIdentifier);
token = tokens.next();
Assert.assertEquals(":", token.getLexeme());
Assert.assertTrue(token.getType() instanceof TokenTypeColon);
token = tokens.next();
Assert.assertEquals("ident2", token.getLexeme());
Assert.assertTrue(token.getType() instanceof TokenTypeIdentifier);
token = tokens.next();
Assert.assertEquals(":", token.getLexeme());
Assert.assertTrue(token.getType() instanceof TokenTypeColon);
token = tokens.next();
Assert.assertEquals("ident3", token.getLexeme());
Assert.assertTrue(token.getType() instanceof TokenTypeIdentifier);
}
use of edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.EvidenceLLexer in project bayou by capergroup.
the class EvidenceLLexerTests method testLexMixed1.
@Test
public void testLexMixed1() {
EvidenceLLexer lexer = makeLexer();
Iterator<Token> tokens = lexer.lex("ident1: ident2, ident3").iterator();
Assert.assertTrue(tokens.hasNext());
Token token = tokens.next();
Assert.assertEquals("ident1", token.getLexeme());
Assert.assertTrue(token.getType() instanceof TokenTypeIdentifier);
token = tokens.next();
Assert.assertEquals(":", token.getLexeme());
Assert.assertTrue(token.getType() instanceof TokenTypeColon);
token = tokens.next();
Assert.assertEquals("ident2", token.getLexeme());
Assert.assertTrue(token.getType() instanceof TokenTypeIdentifier);
token = tokens.next();
Assert.assertEquals(",", token.getLexeme());
Assert.assertTrue(token.getType() instanceof TokenTypeComma);
token = tokens.next();
Assert.assertEquals("ident3", token.getLexeme());
Assert.assertTrue(token.getType() instanceof TokenTypeIdentifier);
}
use of edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.EvidenceLLexer in project bayou by capergroup.
the class EvidenceLLexerTests method testLexColon.
@Test
public void testLexColon() {
EvidenceLLexer lexer = makeLexer();
Iterator<Token> tokens = lexer.lex(":").iterator();
Assert.assertTrue(tokens.hasNext());
Token token = tokens.next();
Assert.assertEquals(":", token.getLexeme());
Assert.assertTrue(token.getType() instanceof TokenTypeColon);
}
use of edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.EvidenceLLexer in project bayou by capergroup.
the class EvidenceLLexerTests method testLexIdents.
@Test
public void testLexIdents() {
EvidenceLLexer lexer = makeLexer();
Iterator<Token> tokens = lexer.lex("ident1 ident2").iterator();
Assert.assertTrue(tokens.hasNext());
Token token = tokens.next();
Assert.assertEquals("ident1", token.getLexeme());
Assert.assertTrue(token.getType() instanceof TokenTypeIdentifier);
token = tokens.next();
Assert.assertEquals("ident2", token.getLexeme());
Assert.assertTrue(token.getType() instanceof TokenTypeIdentifier);
}
use of edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.EvidenceLLexer in project bayou by capergroup.
the class EvidenceLLexerTests method testLexIdent.
@Test
public void testLexIdent() {
EvidenceLLexer lexer = makeLexer();
Iterator<Token> tokens = lexer.lex("ident").iterator();
Assert.assertTrue(tokens.hasNext());
Token token = tokens.next();
Assert.assertEquals("ident", token.getLexeme());
Assert.assertTrue(token.getType() instanceof TokenTypeIdentifier);
}
Aggregations