fc.util.pagetemplate
Class TemplateParser

java.lang.Object
  extended by fc.util.pagetemplate.TemplateParser

public final class TemplateParser
extends Object

Parses a template page and writes out the corresponding java file to the specified output. The parser and scanner is combined into one class here for simplicity (a seperate scanner is overkill for a simple LL(1) grammar such as page templates).


Field Summary
static String d_remove_all_emptylines
          The name of the ("remove-all-emptylines") directive
static String d_remove_initial_emptylines
          The name of the ("remove-initial-whitespace") directive
 
Constructor Summary
TemplateParser(File input, File output, String classname, Log log)
          Creates a new page parser.
 
Method Summary
static void main(String[] args)
           
 void parse()
          Parses the page.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

d_remove_initial_emptylines

public static String d_remove_initial_emptylines
The name of the ("remove-initial-whitespace") directive


d_remove_all_emptylines

public static String d_remove_all_emptylines
The name of the ("remove-all-emptylines") directive

Constructor Detail

TemplateParser

public TemplateParser(File input,
                      File output,
                      String classname,
                      Log log)
               throws IOException
Creates a new page parser.

Parameters:
contextRoot - absolute path to the webapp context root directory
input - absolute path to the input page file
output - absolute path to the output file (to be written to).
classname - classname to give to the generated java class.
Throws:
IOException
Method Detail

parse

public void parse()
           throws IOException
Parses the page. If the parse is successful, the java source will be generated.

Throws:
IOException - a parse failure occurred. The java source file may or may not be properly generated or written in this case.

main

public static void main(String[] args)
                 throws IOException
Throws:
IOException