Package mireka.address.parser.Ipv4Parser

Examples of mireka.address.parser.Ipv4Parser.Ipv4


    }

    @Test
    public void testSpelling() throws Exception {
        String address = "192.0.2.0";
        Ipv4 ipv4AST = new Ipv4Parser(new CharScanner(address)).parse();
        assertEquals(address, ipv4AST.spelling);
    }
View Full Code Here


        assertEquals(address, ipv4AST.spelling);
    }

    private void parse(String address) throws ParseException,
            UnknownHostException {
        Ipv4 ipv4AST = new Ipv4Parser(new CharScanner(address)).parse();
        assertEquals(InetAddress.getByName(address), ipv4AST.address);
    }
View Full Code Here

        addressLiteralTagScanner.finish();
        currentToken = scanner.scan();
        spelling.append(tagToken.spelling);
        switch (tagToken.kind) {
        case DIGIT:
            Ipv4 ipv4AST = parseIpv4AddressLiteral();
            accept(']');
            return new Ipv4RemotePartAST(popPosition(), popSpelling(), ipv4AST);
        case IPv6:
            accept(':');
            Ipv6 ipv6AST = parseIpv6AddressLiteral();
View Full Code Here

        }
    }

    private Ipv4 parseIpv4AddressLiteral() throws ParseException {
        scanner.pushBack(currentToken);
        Ipv4 ipv4 = new Ipv4Parser(scanner).parseLeft();
        currentToken = scanner.scan();
        spelling.append(ipv4.spelling);
        return ipv4;
    }
View Full Code Here

TOP

Related Classes of mireka.address.parser.Ipv4Parser.Ipv4

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.