Package mireka.address.parser.ast

Examples of mireka.address.parser.ast.MailboxAST


        accept('<');
        if (currentToken.ch == '@') {
            sourceRouteAST = parseSourceRoute();
            accept(':');
        }
        MailboxAST mailboxAST = parseMailbox();
        accept('>');
        return new PathAST(popPosition(), sourceRouteAST, mailboxAST);
    }
View Full Code Here


        return domainAST;
    }

    private MailboxAST parseMailbox() throws ParseException {
        scanner.pushBack(currentToken);
        MailboxAST mailboxAST = new MailboxParser(scanner).parseLeft();
        currentToken = scanner.scan();
        return mailboxAST;
    }
View Full Code Here

    public MailboxParser(CharScanner scanner) {
        super(scanner);
    }

    public MailboxAST parse() throws ParseException {
        MailboxAST mailboxAST = parseMailbox();
        if (currentToken.ch != -1)
            throw currentToken
                    .otherSyntaxException("Superfluous characters after mailbox: {0}");
        return mailboxAST;
    }
View Full Code Here

                    .otherSyntaxException("Superfluous characters after mailbox: {0}");
        return mailboxAST;
    }

    public MailboxAST parseLeft() throws ParseException {
        MailboxAST mailboxAST = parseMailbox();
        scanner.pushBack(currentToken);
        return mailboxAST;
    }
View Full Code Here

        pushPosition();
        pushSpelling();
        LocalPartAST localPartAST = parseLocalPart();
        accept('@');
        RemotePartAST remotePartAST = parseRemotePart();
        return new MailboxAST(popPosition(), popSpelling(), localPartAST,
                remotePartAST);
    }
View Full Code Here

        assertSyntaxError("john@[IPv6::::]");
    }

    @Test
    public void testCompleteSpelling() throws Exception {
        MailboxAST mailboxAST = parse("john@example.com");
        assertEquals("john@example.com", mailboxAST.spelling);
    }
View Full Code Here

        assertEquals("john@example.com", mailboxAST.spelling);
    }

    @Test
    public void testLocalPartSpelling() throws Exception {
        MailboxAST mailboxAST = parse("john@example.com");
        assertEquals("john", mailboxAST.localPartAST.spelling);
    }
View Full Code Here

        assertEquals("john", mailboxAST.localPartAST.spelling);
    }

    @Test
    public void testDomainSpelling() throws Exception {
        MailboxAST mailboxAST = parse("john@example.com");
        assertEquals("example.com", mailboxAST.remotePartAST.spelling);
    }
View Full Code Here

        assertEquals("example.com", mailboxAST.remotePartAST.spelling);
    }

    @Test
    public void testIpv4Spelling() throws Exception {
        MailboxAST mailboxAST = parse("john@[192.0.2.0]");
        assertEquals("[192.0.2.0]", mailboxAST.remotePartAST.spelling);
    }
View Full Code Here

        assertEquals("[192.0.2.0]", mailboxAST.remotePartAST.spelling);
    }

    @Test
    public void testIpv6Spelling() throws Exception {
        MailboxAST mailboxAST = parse("john@[IPv6:2001:DB8::]");
        assertEquals("[IPv6:2001:DB8::]", mailboxAST.remotePartAST.spelling);
    }
View Full Code Here

TOP

Related Classes of mireka.address.parser.ast.MailboxAST

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.