Groovy Documentation

java.gate.yam
Class YamCommand

java.lang.Object
  java.gate.yam.YamCommand

class YamCommand

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


Field Summary
private static String BIB_ANCHOR_PREFIX

The anchor prefix used for citations in tests

private static String BIB_URL

The URL of the bibliography file used for citations in tests

static boolean DEBUG

private static int STATUS_ERROR

Status flag for error exit.

private static int STATUS_NORMAL

Status flag for normal exit.

static boolean gateMainFrameIsOn

static Logger slgr

SInS (plain) logger

 
Constructor Summary
YamCommand()

Construction.

 
Method Summary
static void errorExit(String message)

Display an error message and exit

String getVersion()

Get the language version number.

static void help()

Display a help message

static void main(String[] args)

Main function.

String printErrors(YamParseTree parseTree)

Print errors and warnings from parsing.

YamParseTree translate(Reader yamReader, Writer outputWriter, def outputType, File sourceDir)

Translate to a particular target language.

void translate(def outputType, Writer outputWriter, YamParseTree parseTree, IOHandler ioHandler)

Construct an appropriate translator for the target language and run it.

static void usage()

Display a usage message

 
Methods inherited from class Object
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll
 

Field Detail

BIB_ANCHOR_PREFIX

private static String BIB_ANCHOR_PREFIX
The anchor prefix used for citations in tests


BIB_URL

private static String BIB_URL
The URL of the bibliography file used for citations in tests


DEBUG

static final boolean DEBUG


STATUS_ERROR

private static final int STATUS_ERROR
Status flag for error exit.


STATUS_NORMAL

private static final int STATUS_NORMAL
Status flag for normal exit.


gateMainFrameIsOn

static boolean gateMainFrameIsOn


slgr

static Logger slgr
SInS (plain) logger


 
Constructor Detail

YamCommand

public YamCommand()
Construction.


 
Method Detail

errorExit

public static void errorExit(String message)
Display an error message and exit


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.


help

public static void help()
Display a help message


main

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


printErrors

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


translate

public YamParseTree translate(Reader yamReader, Writer outputWriter, def outputType, File sourceDir)
Translate to a particular target language.
param:
yamReader A reader which sources the YAM document.
param:
outputWriter A writer to which the translation is streamed.
param:
outputType A flag signalling which target to produce.
param:
sourceDir A file pointing to the directory in which the source YAM document lives (used to find included files that are relative paths).
return:
the parse tree.
throws:
GateException if parsing or translation fails, or if the outputType is invalid.


translate

public void translate(def outputType, Writer outputWriter, YamParseTree parseTree, IOHandler ioHandler)
Construct an appropriate translator for the target language and run it.


usage

public static void usage()
Display a usage message


 

Groovy Documentation