gate.yam
Class YamCommand

java.lang.Object
  extended by gate.yam.YamCommand

public class YamCommand
extends Object

Command-line programme for YAM translation. NOTE: this class uses an outdated implementation of the top-level YAM API which should not be used by API clients. See YamFile for the real deal.

Author:
Hamish Cunningham

Constructor Summary
YamCommand()
          Construction.
 
Method Summary
 String getVersion()
          Get the language version number.
static void main(String[] args)
          Main function.
 String printErrors(YamParseTree parseTree)
          Print errors and warnings from parsing.
 YamParseTree translate(Reader yamReader, Writer outputWriter, YamFile.FileType outputType, File sourceDir)
          Translate to a particular target language.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YamCommand

public YamCommand()
Construction.

Method Detail

translate

public YamParseTree translate(Reader yamReader,
                              Writer outputWriter,
                              YamFile.FileType outputType,
                              File sourceDir)
                       throws gate.util.GateException
Translate to a particular target language.

Parameters:
yamReader - A reader which sources the YAM document.
outputWriter - A writer to which the translation is streamed.
outputType - A flag signalling which target to produce.
sourceDir - A file pointing to the directory in which the source YAM document lives (used to find included files that are relative paths).
Returns:
the parse tree.
Throws:
gate.util.GateException - if parsing or translation fails, or if the outputType is invalid.

getVersion

public String getVersion()
Get the language version number. Version 1 was derived from Terrence Parr's TML language (thanks Ter! See the ANTLR site). Version 2 was the first version of YAM proper. Version 3 added various new facilities and was the basis for the first version of CLIE. Version 4 was a complete rewrite, for GATE version 4 and for use in CoW. Version 5 is intended to be stable and backwards-compatible with future versions.


printErrors

public String printErrors(YamParseTree parseTree)
Print errors and warnings from parsing.


main

public static void main(String[] args)
Main function.