public Scanner parseHeader() {
        // this method endows this Header object with all of its instance
        // variables by parsing the header of the source code file

        if (sc.hasNextLine()) {
            this.type = sc.nextLine().substring(0,6);
            if (DEBUG == 1) { System.out.println("Type: " + this.type); }
            // read the FUCKING manual next time
            if (Pattern.matches("^%SXX[+-]E", this.type)) {
                this.oldStyle = (this.type.charAt(4) == '-') ? true : false;
            } else {
                System.err.println("ERROR:  The first line in any SXX " +
                        "executable file must start with `%SXX[+-]E':");
                System.err.println("  " + this.type);
                System.exit(1);
            }
        } else {
            System.err.println("ERROR: Empty file");
            System.exit(1);
        }

        // get the length and entry values of the header
        this.length = returnFirstElement(sc, "length", "int" );
        this.entry  = returnFirstElement(sc, "entry",  "int" );

        if (0 > this.entry || this.entry >= this.length) {
            System.err.println("ERROR: Illegal entry point");
            System.err.println("  " + this.entry);
            System.exit(1);
        }

        char text = (char)returnFirstElement(sc, "text", "char");

        if (text != '%') {
            System.err.println("ERROR: `%' sign indicating start of text " +
                    "missing:");
            System.err.println("  " + text);
            System.exit(1);
        }

        // return the scanner so the rest of the program can pick up where the
        // header leaves off
        return sc;
    }