fbench.translate
Class STtoJava

java.lang.Object
  extended by fbench.translate.STtoJava
All Implemented Interfaces:
Translator, java.lang.Runnable

public class STtoJava
extends java.lang.Object
implements Translator, java.lang.Runnable


Field Summary
static short Action
           
static short And
           
static short Array
           
static short Assign
           
static short Asterisk
           
static short At
           
static short BooleanLiteral
           
static short By
           
static short Case
           
static short CBrace
           
static short CBracket
           
static short CharLiteral
           
static short Colon
           
static short Comma
           
static short CommentText
           
static short Constant
           
static short CParen
           
static short DirectRep
           
static short Do
           
static short Else
           
static short ElseIf
           
static short En
           
static short EndAction
           
static short EndCase
           
static short EndFor
           
static short EndFunction
           
static short EndIf
           
static short EndProgram
           
static short EndResource
           
static short EndStep
           
static short EndStruct
           
static short EndTransition
           
static short EndType
           
static short EndVar
           
static short EndWhile
           
static short Eno
           
static short Equal
           
static short Error
           
static short Exit
           
static short FEdge
           
static short FloatLiteral
           
static short For
           
static short From
           
static short FSlash
           
static short Function
           
static short GreaterThan
           
static short GreaterThanEqualTo
           
static short Identifier
           
static short If
           
static short InitialStep
           
static short IntegerLiteral
           
static short LessThan
           
static short LessThanEqualTo
           
static short LongLiteral
           
static short Minus
           
static short Mod
           
static short NewLine
           
static short Not
           
static short NotEqual
           
static short NumSeparator
           
static short OBrace
           
static short OBracket
           
static short Of
           
static short OParen
           
static short Or
           
static short Plus
           
static short Point
           
static short Power
           
static short Program
           
static short Range
           
static short ReadOnly
           
static short ReadWrite
           
static short REdge
           
static short Repeat
           
static short Resource
           
static short Retain
           
static short Return
           
static short SemiColon
           
static short Step
           
static short StringLiteral
           
static short Struct
           
static short Task
           
static short Then
           
static short To
           
static short Transition
           
static short Type
           
static short UNARY
           
static short UnclosedStringLiteral
           
static short Until
           
static short VarAccess
           
static short VarExternal
           
static short VarGlobal
           
static short VarInput
           
static short VarInputOutput
           
static short VarOutput
           
static short While
           
static short WhiteSpace
           
static short With
           
static short Xor
           
static short YYERRCODE
           
 
Constructor Summary
STtoJava()
          Default constructor.
STtoJava(boolean debugMe)
          Create a parser, setting the debug to true or false.
 
Method Summary
 void addError(int line, java.lang.String message, boolean critical)
          Adds an error to the result.
 java.util.ArrayList<ParseError> getErrors()
          Returns a list of errors encountered.
 int getLine()
          Returns the current line being parsed.
 ParseResult getResult()
          Gets the parser result.
 java.lang.String getSource()
          Returns the Java source.
 java.lang.String getSourceLanguage()
           
 java.lang.String getTargetLanguage()
           
static void main(java.lang.String[] args)
           
 ParseResult parse(java.io.Reader r)
          Parses a string of Structured Text source code and attempts to translate it into Java.
 void run()
          A default run method, used for operating this parser object in the background.
 void yyerror(java.lang.String error)
          Internal, prints an error message.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NewLine

public static final short NewLine
See Also:
Constant Field Values

WhiteSpace

public static final short WhiteSpace
See Also:
Constant Field Values

Not

public static final short Not
See Also:
Constant Field Values

And

public static final short And
See Also:
Constant Field Values

Or

public static final short Or
See Also:
Constant Field Values

Mod

public static final short Mod
See Also:
Constant Field Values

Xor

public static final short Xor
See Also:
Constant Field Values

Power

public static final short Power
See Also:
Constant Field Values

Type

public static final short Type
See Also:
Constant Field Values

Of

public static final short Of
See Also:
Constant Field Values

Struct

public static final short Struct
See Also:
Constant Field Values

Array

public static final short Array
See Also:
Constant Field Values

EndStruct

public static final short EndStruct
See Also:
Constant Field Values

Function

public static final short Function
See Also:
Constant Field Values

VarInput

public static final short VarInput
See Also:
Constant Field Values

VarOutput

public static final short VarOutput
See Also:
Constant Field Values

VarInputOutput

public static final short VarInputOutput
See Also:
Constant Field Values

EndVar

public static final short EndVar
See Also:
Constant Field Values

EndType

public static final short EndType
See Also:
Constant Field Values

Return

public static final short Return
See Also:
Constant Field Values

EndFunction

public static final short EndFunction
See Also:
Constant Field Values

If

public static final short If
See Also:
Constant Field Values

Then

public static final short Then
See Also:
Constant Field Values

Else

public static final short Else
See Also:
Constant Field Values

ElseIf

public static final short ElseIf
See Also:
Constant Field Values

EndIf

public static final short EndIf
See Also:
Constant Field Values

Case

public static final short Case
See Also:
Constant Field Values

EndCase

public static final short EndCase
See Also:
Constant Field Values

For

public static final short For
See Also:
Constant Field Values

To

public static final short To
See Also:
Constant Field Values

By

public static final short By
See Also:
Constant Field Values

EndFor

public static final short EndFor
See Also:
Constant Field Values

While

public static final short While
See Also:
Constant Field Values

Do

public static final short Do
See Also:
Constant Field Values

EndWhile

public static final short EndWhile
See Also:
Constant Field Values

Repeat

public static final short Repeat
See Also:
Constant Field Values

Until

public static final short Until
See Also:
Constant Field Values

Exit

public static final short Exit
See Also:
Constant Field Values

Comma

public static final short Comma
See Also:
Constant Field Values

Colon

public static final short Colon
See Also:
Constant Field Values

SemiColon

public static final short SemiColon
See Also:
Constant Field Values

OParen

public static final short OParen
See Also:
Constant Field Values

CParen

public static final short CParen
See Also:
Constant Field Values

OBracket

public static final short OBracket
See Also:
Constant Field Values

CBracket

public static final short CBracket
See Also:
Constant Field Values

OBrace

public static final short OBrace
See Also:
Constant Field Values

CBrace

public static final short CBrace
See Also:
Constant Field Values

Point

public static final short Point
See Also:
Constant Field Values

Plus

public static final short Plus
See Also:
Constant Field Values

Minus

public static final short Minus
See Also:
Constant Field Values

Asterisk

public static final short Asterisk
See Also:
Constant Field Values

FSlash

public static final short FSlash
See Also:
Constant Field Values

Equal

public static final short Equal
See Also:
Constant Field Values

NotEqual

public static final short NotEqual
See Also:
Constant Field Values

LessThan

public static final short LessThan
See Also:
Constant Field Values

LessThanEqualTo

public static final short LessThanEqualTo
See Also:
Constant Field Values

GreaterThan

public static final short GreaterThan
See Also:
Constant Field Values

GreaterThanEqualTo

public static final short GreaterThanEqualTo
See Also:
Constant Field Values

Assign

public static final short Assign
See Also:
Constant Field Values

Range

public static final short Range
See Also:
Constant Field Values

Error

public static final short Error
See Also:
Constant Field Values

NumSeparator

public static final short NumSeparator
See Also:
Constant Field Values

DirectRep

public static final short DirectRep
See Also:
Constant Field Values

Action

public static final short Action
See Also:
Constant Field Values

EndAction

public static final short EndAction
See Also:
Constant Field Values

At

public static final short At
See Also:
Constant Field Values

Constant

public static final short Constant
See Also:
Constant Field Values

En

public static final short En
See Also:
Constant Field Values

Eno

public static final short Eno
See Also:
Constant Field Values

FEdge

public static final short FEdge
See Also:
Constant Field Values

InitialStep

public static final short InitialStep
See Also:
Constant Field Values

EndStep

public static final short EndStep
See Also:
Constant Field Values

Program

public static final short Program
See Also:
Constant Field Values

With

public static final short With
See Also:
Constant Field Values

EndProgram

public static final short EndProgram
See Also:
Constant Field Values

REdge

public static final short REdge
See Also:
Constant Field Values

ReadOnly

public static final short ReadOnly
See Also:
Constant Field Values

ReadWrite

public static final short ReadWrite
See Also:
Constant Field Values

Resource

public static final short Resource
See Also:
Constant Field Values

EndResource

public static final short EndResource
See Also:
Constant Field Values

Retain

public static final short Retain
See Also:
Constant Field Values

Step

public static final short Step
See Also:
Constant Field Values

Task

public static final short Task
See Also:
Constant Field Values

Transition

public static final short Transition
See Also:
Constant Field Values

EndTransition

public static final short EndTransition
See Also:
Constant Field Values

From

public static final short From
See Also:
Constant Field Values

VarExternal

public static final short VarExternal
See Also:
Constant Field Values

VarAccess

public static final short VarAccess
See Also:
Constant Field Values

VarGlobal

public static final short VarGlobal
See Also:
Constant Field Values

BooleanLiteral

public static final short BooleanLiteral
See Also:
Constant Field Values

IntegerLiteral

public static final short IntegerLiteral
See Also:
Constant Field Values

LongLiteral

public static final short LongLiteral
See Also:
Constant Field Values

FloatLiteral

public static final short FloatLiteral
See Also:
Constant Field Values

Identifier

public static final short Identifier
See Also:
Constant Field Values

UnclosedStringLiteral

public static final short UnclosedStringLiteral
See Also:
Constant Field Values

CommentText

public static final short CommentText
See Also:
Constant Field Values

StringLiteral

public static final short StringLiteral
See Also:
Constant Field Values

CharLiteral

public static final short CharLiteral
See Also:
Constant Field Values

UNARY

public static final short UNARY
See Also:
Constant Field Values

YYERRCODE

public static final short YYERRCODE
See Also:
Constant Field Values
Constructor Detail

STtoJava

public STtoJava()
Default constructor. Turn off with -Jnoconstruct .


STtoJava

public STtoJava(boolean debugMe)
Create a parser, setting the debug to true or false.

Parameters:
debugMe - true for debugging, false for no debug.
Method Detail

addError

public void addError(int line,
                     java.lang.String message,
                     boolean critical)
Adds an error to the result.


getSource

public java.lang.String getSource()
Returns the Java source.


getErrors

public java.util.ArrayList<ParseError> getErrors()
Returns a list of errors encountered.


getResult

public ParseResult getResult()
Gets the parser result.


yyerror

public void yyerror(java.lang.String error)
Internal, prints an error message.


getLine

public int getLine()
Returns the current line being parsed.


parse

public ParseResult parse(java.io.Reader r)
Parses a string of Structured Text source code and attempts to translate it into Java.

Specified by:
parse in interface Translator
Parameters:
r -

getTargetLanguage

public java.lang.String getTargetLanguage()
Specified by:
getTargetLanguage in interface Translator

getSourceLanguage

public java.lang.String getSourceLanguage()
Specified by:
getSourceLanguage in interface Translator

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException

run

public void run()
A default run method, used for operating this parser object in the background. It is intended for extending Thread or implementing Runnable. Turn off with -Jnorun .

Specified by:
run in interface java.lang.Runnable