// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/exception/ACLException.java
// public class ACLException extends Exception {
// 
//     public ACLException(final String msg) {
//         super(msg);
//     }
// 
// }
// 
// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/exception/InvalidAddressException.java
// public class InvalidAddressException extends Exception {
// 
//     public InvalidAddressException(final String msg) {
//         super(msg);
//     }
// 
// }


import com.vecsight.dragonite.proxy.acl.item.*;
import com.vecsight.dragonite.proxy.exception.ACLException;
import com.vecsight.dragonite.proxy.exception.InvalidAddressException;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
import java.util.LinkedList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/*
 * The Dragonite Project
 * -------------------------
 * See the LICENSE file in the root directory for license information.
 */


package com.vecsight.dragonite.proxy.acl;



public final class ACLFileParser {

    private static final Pattern INFO_PATTERN = Pattern.compile("(\\w+?):(.+)");

    private static final Pattern RULE_PATTERN = Pattern.compile("([a-zA-Z0-9\\-]+?),([a-zA-Z0-9\\-.:/]+),([a-zA-Z]+)");

// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/exception/ACLException.java
// public class ACLException extends Exception {
// 
//     public ACLException(final String msg) {
//         super(msg);
//     }
// 
// }
// 
// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/exception/InvalidAddressException.java
// public class InvalidAddressException extends Exception {
// 
//     public InvalidAddressException(final String msg) {
//         super(msg);
//     }
// 
// }


// Path: dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/acl/ACLFileParser.java
import com.vecsight.dragonite.proxy.acl.item.*;
import com.vecsight.dragonite.proxy.exception.ACLException;
import com.vecsight.dragonite.proxy.exception.InvalidAddressException;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
import java.util.LinkedList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/*
 * The Dragonite Project
 * -------------------------
 * See the LICENSE file in the root directory for license information.
 */


package com.vecsight.dragonite.proxy.acl;



public final class ACLFileParser {

    private static final Pattern INFO_PATTERN = Pattern.compile("(\\w+?):(.+)");

    private static final Pattern RULE_PATTERN = Pattern.compile("([a-zA-Z0-9\\-]+?),([a-zA-Z0-9\\-.:/]+),([a-zA-Z]+)");

    public static ParsedACL parse(final Reader reader) throws IOException, ACLException {