uk.ac.umist.co.brailletrans.utils
Class MakeAll

java.lang.Object
  |
  +--uk.ac.umist.co.brailletrans.utils.Maker
        |
        +--uk.ac.umist.co.brailletrans.utils.MakeAll

public class MakeAll
extends uk.ac.umist.co.brailletrans.utils.Maker

Creates machine-format language files from data files for all types, by calling in turn the MakeLanguageUnicode and MakeLegacy classes. Assumes, therefore, the existence of both a CON and UCN file for the provided language filename.


Field Summary
static int DISK_ERROR
          Error code for a failure to complete a program caused by a I/O fault.
static int ESCAPE_CHARACTER_1
          Character indicating the start of an escape character for encoding characters of values 128 - 255 in ASCII language files.
static int ESCAPE_CHARACTER_2
          Character indicating the second part of an escape character for encoding characters of values 128 - 255 in ASCII language files.
static int LANGUAGE_ERROR
          Error code for a failure using a Language.
static int SUCCESS
          Error code for successful completion of a Maker program.
static char TABLE_DELIMITER
          The ASCII character indicating the end of the translation rules.
 
Constructor Summary
MakeAll()
           
 
Method Summary
static int[] getEscapedCharacter(java.io.BufferedInputStream inFile)
          If a '\x' character is encountered in a language human file it might be an escape sequence for
static void main(java.lang.String[] args)
          Provides command-line functionality for language process
static int skipComments(java.io.BufferedInputStream fileIn)
          Skips over comment lines in the language files.
static java.lang.String skipComments(java.io.BufferedReader fileIn)
          Skips over comment lines in the language files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ESCAPE_CHARACTER_1

public static final int ESCAPE_CHARACTER_1
Character indicating the start of an escape character for encoding characters of values 128 - 255 in ASCII language files.

ESCAPE_CHARACTER_2

public static final int ESCAPE_CHARACTER_2
Character indicating the second part of an escape character for encoding characters of values 128 - 255 in ASCII language files.

SUCCESS

public static final int SUCCESS
Error code for successful completion of a Maker program.

DISK_ERROR

public static final int DISK_ERROR
Error code for a failure to complete a program caused by a I/O fault.

LANGUAGE_ERROR

public static final int LANGUAGE_ERROR
Error code for a failure using a Language.

TABLE_DELIMITER

public static final char TABLE_DELIMITER
The ASCII character indicating the end of the translation rules.
Constructor Detail

MakeAll

public MakeAll()
Method Detail

main

public static void main(java.lang.String[] args)
Provides command-line functionality for language process
Parameters:
args - Takes the String args[0] as the filename (full path and filename) of the language files to convert.

skipComments

public static int skipComments(java.io.BufferedInputStream fileIn)
Skips over comment lines in the language files. The human-readable files can have comment lines, indicated by the ':' colon character, or the COMMENT constant in MakeLanguage256. This should return first non-comment character of the first non-comment line as an int.

To be explicit: the method halts only when one of the following is met:

  1. A carriage return is followed by a non-comment non-linefeed character or
  2. A linefeed followed by a non-comment non-carriage return character.
In both cases, the ASCII/Unicode characters for CR, LF are used. This should work for Apple Macintosh, Windows and Unix systems.
Parameters:
fileIn - BufferedInputStream to the file being read from.
Returns:
readBuffer[1] An int, the first character of the next non-comment line.

skipComments

public static java.lang.String skipComments(java.io.BufferedReader fileIn)
Skips over comment lines in the language files. The human-readable files can have comment lines, indicated by the ':' colon character, or the COMMENT constant in MakeLanguage256. This should return first non-comment character of the first non-comment line as an int.
Parameters:
fileIn - BufferedInputStream for the file being read.
Returns:
toReturn String containing the first non-comment line.

getEscapedCharacter

public static int[] getEscapedCharacter(java.io.BufferedInputStream inFile)
If a '\x' character is encountered in a language human file it might be an escape sequence for