XDC - v. 0.6.1

net.sf.xdc.util
Class FileTokenizer

java.lang.Object
  extended bynet.sf.xdc.util.FileTokenizer

public class FileTokenizer
extends java.lang.Object

A FileTokenizer is used to parse an options file for the XDC tool (which is specified with the '@' notation as a command line argument).

Since:
0.5
Version:
0.5
Author:
Jens Voß

Constructor Summary
FileTokenizer(java.io.File file)
          Public constructor.
 
Method Summary
 java.lang.String[] getContents()
          This method does the actual parsing of the XDC options file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileTokenizer

public FileTokenizer(java.io.File file)
Public constructor.

Parameters:
file - The file containing the XDC options
Method Detail

getContents

public java.lang.String[] getContents()
                               throws java.io.IOException
This method does the actual parsing of the XDC options file. It breaks up the contents into tokens. The following rules apply:
  1. Every character may be escaped by placing a backslash ('\') in front of it.
  2. Text starting with an (not escaped) hash sign ('#') and ending with a line terminator is considered a comment and is ignored.
  3. Text enclosed by double quotes is considered a single token. (The quotes will be stripped by this method.)
  4. All whitespace characters (i.e. spaces, tabs, line terminators etc.) which are neither escaped nor part of a comment nor part of a quoted token are treated as token delimiters.

Returns:
An array of the individual tokens contained in this file
Throws:
java.io.IOException

XDC - v. 0.6.1