Search in sources :

Example 6 with Token

use of edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.Token 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);
}
Also used : TokenTypeColon(edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.TokenTypeColon) Token(edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.Token) EvidenceLLexer(edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.EvidenceLLexer) Test(org.junit.Test)

Example 7 with Token

use of edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.Token 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);
}
Also used : TokenTypeIdentifier(edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.TokenTypeIdentifier) Token(edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.Token) EvidenceLLexer(edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.EvidenceLLexer) Test(org.junit.Test)

Example 8 with Token

use of edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.Token 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);
}
Also used : TokenTypeIdentifier(edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.TokenTypeIdentifier) Token(edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.Token) EvidenceLLexer(edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.EvidenceLLexer) Test(org.junit.Test)

Example 9 with Token

use of edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.Token in project bayou by capergroup.

the class EvidenceLLexerTests method testLexEmpty.

@Test
public void testLexEmpty() {
    EvidenceLLexer lexer = makeLexer();
    Iterator<Token> tokens = lexer.lex("").iterator();
    Assert.assertFalse(tokens.hasNext());
}
Also used : Token(edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.Token) EvidenceLLexer(edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.EvidenceLLexer) Test(org.junit.Test)

Aggregations

Token (edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.Token)7 EvidenceLLexer (edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.EvidenceLLexer)6 Test (org.junit.Test)6 TokenTypeIdentifier (edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.TokenTypeIdentifier)4 TokenTypeColon (edu.rice.cs.caper.bayou.core.lexer.evidencel._1_0.TokenTypeColon)3 Access (org.openstack.docs.identity.api.v2.Access)1 Token (org.openstack.docs.identity.api.v2.Token)1 KeystoneAuthenticationToken (org.openstack.keystone.auth.client.KeystoneAuthenticationToken)1 Token (org.openstack4j.model.identity.v3.Token)1 Auth (org.openstack4j.openstack.common.Auth)1 KeystoneAccess (org.openstack4j.openstack.identity.v2.domain.KeystoneAccess)1 KeystoneAuth (org.openstack4j.openstack.identity.v3.domain.KeystoneAuth)1 KeystoneToken (org.openstack4j.openstack.identity.v3.domain.KeystoneToken)1 TokenAuth (org.openstack4j.openstack.identity.v3.domain.TokenAuth)1 OSClientSessionV3 (org.openstack4j.openstack.internal.OSClientSession.OSClientSessionV3)1