// Path: src/main/java/trabe/AbeSettings.java
// public class AbeSettings {
//     public final static boolean DEBUG                     = false;
//     public final static String  STRINGS_LOCALE            = "US-ASCII";
//     public final static String  ELEMENT_HASHING_ALGORITHM = "SHA-1";
//     public final static String  curveParams               = "type a\n"
//             + "q 87807107996633125224377819847540498158068831994142082"
//             + "1102865339926647563088022295707862517942266222142315585"
//             + "8769582317459277713367317481324925129998224791\n"
//             + "h 12016012264891146079388821366740534204802954401251311"
//             + "822919615131047207289359704531102844802183906537786776\n"
//             + "r 730750818665451621361119245571504901405976559617\n"
//             + "exp2 159\n" + "exp1 107\n"
//             + "sign1 1\n" + "sign0 1\n";
//     public final static boolean USE_TREE = true; // otherwise LSSS matrix
// 
//     public static boolean PREPROCESSING = true;
//     public static int PREPROCESSING_THRESHOLD = 6; // how many exponentiations with the same basis are needed for pre-processing to make sense
// 
//     // currently broken:
//     public final static boolean USE_THRESHOLD_MATRIX = false; // otherwise LSSS matrix from boolean formula
// }


import java.math.BigInteger;
import java.util.List;
import ch.hsr.geohash.BoundingBox;
import ch.hsr.geohash.GeoHash;
import trabe.AbeSettings;
import trabe.policyparser.*;

        if (current instanceof ASTExpression) {
            handleExpression((ASTExpression) current, retVal);
        } else if (current instanceof ASTOf) {
            handleOf((ASTOf) current, retVal);
        } else if (current instanceof ASTAttribute) {
            handleAttribute((ASTAttribute) current, retVal);
        } else if (current instanceof ASTNumericalAttribute) {
            handleNumericalAttribute((ASTNumericalAttribute) current, retVal);
        } else if (current instanceof ASTGeoHashAttribute) {
        	ASTGeoHashAttribute currentChild = (ASTGeoHashAttribute) current;
            handleGeoHashAttributeNeighbourly(currentChild, retVal);
        } else if (!(current instanceof ASTStart)) {
            throw new ParseException("Unknown node found in tree.");
        }

        return retVal.append(' ');
    }

	private static void handleGeoHashAttributeNaive(ASTGeoHashAttribute current, StringBuffer retVal) throws ParseException {
        if (current.getPrecision() > Util.GEOHASH_MAXBITS || current.getPrecision() <= 0) {
            throw new ParseException("(GeoHash precision) Only values between 1 and " + Util.GEOHASH_MAXBITS + " are supported.");
        }
        GeoHash target;
        try {
            target = GeoHash.withBitPrecision(current.getLatitude(), current.getLongitude(), current.getPrecision());
        } catch (IllegalArgumentException e) {
            throw new ParseException(e.getMessage());
        }
        handleGeoHash(target, retVal, current.getName());


// Path: src/main/java/trabe/AbeSettings.java
// public class AbeSettings {
//     public final static boolean DEBUG                     = false;
//     public final static String  STRINGS_LOCALE            = "US-ASCII";
//     public final static String  ELEMENT_HASHING_ALGORITHM = "SHA-1";
//     public final static String  curveParams               = "type a\n"
//             + "q 87807107996633125224377819847540498158068831994142082"
//             + "1102865339926647563088022295707862517942266222142315585"
//             + "8769582317459277713367317481324925129998224791\n"
//             + "h 12016012264891146079388821366740534204802954401251311"
//             + "822919615131047207289359704531102844802183906537786776\n"
//             + "r 730750818665451621361119245571504901405976559617\n"
//             + "exp2 159\n" + "exp1 107\n"
//             + "sign1 1\n" + "sign0 1\n";
//     public final static boolean USE_TREE = true; // otherwise LSSS matrix
// 
//     public static boolean PREPROCESSING = true;
//     public static int PREPROCESSING_THRESHOLD = 6; // how many exponentiations with the same basis are needed for pre-processing to make sense
// 
//     // currently broken:
//     public final static boolean USE_THRESHOLD_MATRIX = false; // otherwise LSSS matrix from boolean formula
// }


// Path: src/main/java/trabe/policy/PolicyParsing.java
import java.math.BigInteger;
import java.util.List;
import ch.hsr.geohash.BoundingBox;
import ch.hsr.geohash.GeoHash;
import trabe.AbeSettings;
import trabe.policyparser.*;

        if (current instanceof ASTExpression) {
            handleExpression((ASTExpression) current, retVal);
        } else if (current instanceof ASTOf) {
            handleOf((ASTOf) current, retVal);
        } else if (current instanceof ASTAttribute) {
            handleAttribute((ASTAttribute) current, retVal);
        } else if (current instanceof ASTNumericalAttribute) {
            handleNumericalAttribute((ASTNumericalAttribute) current, retVal);
        } else if (current instanceof ASTGeoHashAttribute) {
        	ASTGeoHashAttribute currentChild = (ASTGeoHashAttribute) current;
            handleGeoHashAttributeNeighbourly(currentChild, retVal);
        } else if (!(current instanceof ASTStart)) {
            throw new ParseException("Unknown node found in tree.");
        }

        return retVal.append(' ');
    }

	private static void handleGeoHashAttributeNaive(ASTGeoHashAttribute current, StringBuffer retVal) throws ParseException {
        if (current.getPrecision() > Util.GEOHASH_MAXBITS || current.getPrecision() <= 0) {
            throw new ParseException("(GeoHash precision) Only values between 1 and " + Util.GEOHASH_MAXBITS + " are supported.");
        }
        GeoHash target;
        try {
            target = GeoHash.withBitPrecision(current.getLatitude(), current.getLongitude(), current.getPrecision());
        } catch (IllegalArgumentException e) {
            throw new ParseException(e.getMessage());
        }
        handleGeoHash(target, retVal, current.getName());


        if (AbeSettings.DEBUG) {
