// Path: src/io/Preface.java
// public class Preface {
// 	public static void readPreface(BufferedReader in) throws IOException {
// 		String line = in.readLine();
// 
// 		if (line == null || line.charAt(0) != '#') {
// 			throw new IllegalArgumentException("File does not start with the mandatory preface.");
// 		}
// 
// 		while ((line = in.readLine()) != null) {
// 			if (line.isEmpty()) {
// 				break;
// 			}
// 			if (line.charAt(0) != '#') {
// 				throw new IllegalArgumentException("Uncommented line within preface.");
// 			}
// 		}
// 	}
// 
// 	public static void printPreface(PrintWriter out) {
// 		out.println("# mandatory preface");
// 		out.println("# mandatory preface");
// 		out.println();
// 	}
// }
// 
// Path: src/utils/ByteWrapper.java
// public class ByteWrapper {
// 	public byte value;
// 
// 	public ByteWrapper(byte value) {
// 		this.value = value;
// 	}
// }
// 
// Path: src/utils/ShortWrapper.java
// public class ShortWrapper {
// 	public short value;
// 
// 	public ShortWrapper(short value) {
// 		this.value = value;
// 	}
// }


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import io.Preface;
import utils.ByteWrapper;
import utils.ShortWrapper;
	 * is already a dependency in the category being type-raised; varString
	 * indicates what the variable is associated with the dependency, which
	 * needs carrying over
	 */
	private void readTRcategories(String trFile, ArrayList<TypeRaisedCategory> trList) throws IOException {
		try ( BufferedReader in = new BufferedReader(new FileReader(trFile)) ) {

			String markedupCatString = "";
			String varString = "";
			byte[] seenVariables = new byte[VarID.NUM_VARS];

			// Preface.readPreface(in);

			String line = "";
			while ( (line = in.readLine()) != null ) {
				String[] tokens = line.split("\\s");
				if ( tokens.length != 2 ) {
					throw new Error("expecting 2 items per line in the TR file!");
				}

				markedupCatString = tokens[0];
				varString = tokens[1];
				Category cat = parse(markedupCatString);
				/*
				 * typically the varString is the sentinel "+" - this gets
				 * converted to NONE by VarID.convert
				 */
				byte depVar = VarID.convert(varString);

				Arrays.fill(seenVariables, VarID.NONE);
// Path: src/io/Preface.java
// public class Preface {
// 	public static void readPreface(BufferedReader in) throws IOException {
// 		String line = in.readLine();
// 
// 		if (line == null || line.charAt(0) != '#') {
// 			throw new IllegalArgumentException("File does not start with the mandatory preface.");
// 		}
// 
// 		while ((line = in.readLine()) != null) {
// 			if (line.isEmpty()) {
// 				break;
// 			}
// 			if (line.charAt(0) != '#') {
// 				throw new IllegalArgumentException("Uncommented line within preface.");
// 			}
// 		}
// 	}
// 
// 	public static void printPreface(PrintWriter out) {
// 		out.println("# mandatory preface");
// 		out.println("# mandatory preface");
// 		out.println();
// 	}
// }
// 
// Path: src/utils/ByteWrapper.java
// public class ByteWrapper {
// 	public byte value;
// 
// 	public ByteWrapper(byte value) {
// 		this.value = value;
// 	}
// }
// 
// Path: src/utils/ShortWrapper.java
// public class ShortWrapper {
// 	public short value;
// 
// 	public ShortWrapper(short value) {
// 		this.value = value;
// 	}
// }


// Path: src/lexicon/Categories.java
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import io.Preface;
import utils.ByteWrapper;
import utils.ShortWrapper;

	 * is already a dependency in the category being type-raised; varString
	 * indicates what the variable is associated with the dependency, which
	 * needs carrying over
	 */
	private void readTRcategories(String trFile, ArrayList<TypeRaisedCategory> trList) throws IOException {
		try ( BufferedReader in = new BufferedReader(new FileReader(trFile)) ) {

			String markedupCatString = "";
			String varString = "";
			byte[] seenVariables = new byte[VarID.NUM_VARS];

			// Preface.readPreface(in);

			String line = "";
			while ( (line = in.readLine()) != null ) {
				String[] tokens = line.split("\\s");
				if ( tokens.length != 2 ) {
					throw new Error("expecting 2 items per line in the TR file!");
				}

				markedupCatString = tokens[0];
				varString = tokens[1];
				Category cat = parse(markedupCatString);
				/*
				 * typically the varString is the sentinel "+" - this gets
				 * converted to NONE by VarID.convert
				 */
				byte depVar = VarID.convert(varString);

				Arrays.fill(seenVariables, VarID.NONE);
				cat.reorderVariables(seenVariables, new ByteWrapper((byte) (0)));