Follow the links below to browse sample Javadoc for MJ classes and tools, including the MJ Runtime Library.

 

Package: com.arsi.mj.maprpt.lexer.outarea  previous next contents

Package com.arsi.mj.maprpt.lexer.outarea contains the following classes and interfaces.
Classes and Interfaces
DefaultOutputAreaVariableLookup Does lookup of named and numbered variables and array based on variable table created by control-flow-graph (CFG) analysis.
IOutputAreaVariableLookup Provide lookup mechanism for output area parser to determine if what appears to be a variable or array name in an output area line has actually been defined as a variable or array.
OutputAreaParser Parses a Mapper output area into into Mapper expressions.
OutputAreaParserState Provides a tracking mechanism for the metadata used during output area parsing.

Class: DefaultOutputAreaVariableLookup   next package

Does lookup of named and numbered variables and array based on variable table created by control-flow-graph (CFG) analysis. TO DO: implement
public class com.arsi.mj.maprpt.lexer.outarea.DefaultOutputAreaVariableLookup
  extends java.lang.Object
  implements com.arsi.mj.maprpt.lexer.outarea.IOutputAreaVariableLookup
Constructors
public DefaultOutputAreaVariableLookup()
Methods
public boolean isNumberedArray(int anArrayNumber)
public boolean isNumberedVariable(int aVariableNumber)
public java.util.List lookupNamedArray(java.lang.String anArrayName)
public java.util.List lookupNamedVariable(java.lang.String aVariableName)

Interface: IOutputAreaVariableLookup   previous next package

Provide lookup mechanism for output area parser to determine if what appears to be a variable or array name in an output area line has actually been defined as a variable or array.
public interface com.arsi.mj.maprpt.lexer.outarea.IOutputAreaVariableLookup
Methods
Lookup candidate array number to determine if such an array has been defined.
Parameters:
anArrayNumber - a candidate array number.
Returns:
true if the array is defined, false otherwise.
public boolean isNumberedArray(int anArrayNumber)
Lookup candidate variable number to determine if such a variable has been defined.
Parameters:
aVariableNumber - a candidate variable number.
Returns:
true if the variable is defined, false otherwise.
public boolean isNumberedVariable(int aVariableNumber)
Lookup candidate array name to determine if such an array has been defined.
Parameters:
anArrayName - a candidate array name, without leading character such as $ or *.
Returns:
scopes in which array is defined, an empty collection if no such variable.
public java.util.List lookupNamedArray(java.lang.String anArrayName)
Lookup candidate variable name to determine if such a variable has been defined.
Parameters:
aVariableName - a candidate variable name, without leading character such as $ or *.
Returns:
scopes in which variable is defined, an empty collection if no such variable.
public java.util.List lookupNamedVariable(java.lang.String aVariableName)

Class: OutputAreaParser   previous next package

Parses a Mapper output area into into Mapper expressions.
Treat this class as "thread-hostile" as it needs to retain state between invocations.
public class com.arsi.mj.maprpt.lexer.outarea.OutputAreaParser
  extends java.lang.Object
Constructors
Initializes an instance of this class.
Parameters:
aTreatReservedWordAsLiteralFlag - if true, treat reserved words as literal text (e.g., DATE1$ is treated as the string "DATE1$" instead of current date in YYMMDD format).
aWebscriptFlag - determines if Web scripting is in effect, such that text outside <% and %> is always treated literally.
aVariableLookup - provides lookup mechanism to determine if candidate variable or array name in output area line is in fact a defined variable or array.
aCabinetNumber - number of cabinet of Mapper report.
aDrawerLetter - letter of drawer of Mapper report.
aReportNumber - number of Mapper report.
public OutputAreaParser(boolean aTreatReservedWordAsLiteralFlag, boolean aWebscriptFlag, com.arsi.mj.maprpt.lexer.outarea.IOutputAreaVariableLookup aVariableLookup, int aCabinetNumber, char aDrawerLetter, int aReportNumber)
Methods
Converts a format string into format types for use in expression construction.
Parameters:
aFormatList - the input formats
Returns:
the converted types
public static java.util.EnumSet getFormats(java.lang.String aFormatList)
Parse a text line from output area into expressions that capture references to variables, arrays, string bounds, reserved words and literal text.
Parameters:
someText - text content (as opposed to Mapper command or data tuple) from the Mapper report identified in the constructor. It should be assumed that token replacement (i.e., substitution of :DEFINEd constants) has already been performed on the text.
Throws:
MJTranslateException - if a parsing error occurs.
Returns:
a concatenation expression for each line in the text.
public java.util.List parseText(com.arsi.mj.maprpt.lexer.tokens.content.TextContent someText)
    throws com.arsi.mj.MJTranslateException
Parse a single a text line from output area into expressions that capture references to variables, arrays, string bounds, reserved words and literal text.
Parameters:
aTextLine - text line from the Mapper report identified in the constructor. It should be assumed that token replacement (i.e., substitution of :DEFINEd constants) has already been performed on the text.
aLineNumber - line number of text line in Mapper report.
Throws:
MJTranslateException - if a parsing error occurs.
Returns:
a concatenation expression that contains component expressions (e.g., variable, reserved word, text) that comprise the text line.
public com.arsi.mj.maprpt.lexer.ptree.expr.ConcatExpr parseTextLine(java.lang.String aTextLine, int aLineNumber)
    throws com.arsi.mj.MJTranslateException

Class: OutputAreaParserState   previous package

Provides a tracking mechanism for the metadata used during output area parsing.
public class com.arsi.mj.maprpt.lexer.outarea.OutputAreaParserState
  extends java.lang.Object
Constructors
Initializes an instance of this class.
Parameters:
outputLine - the contents to parse expressions from
public OutputAreaParserState(java.lang.String outputLine)
Methods
Removes unmatched text from the state buffer.
public void clearUnmatched()
Creates a regular expression matcher based on the content starting at the current character position. Only the remaining text is considered.
Parameters:
anExpression - the regular expression to match
Returns:
the instantiated matcher
public java.util.regex.Matcher matchContent(java.lang.String anExpression)
Creates a regular expression matcher based on the currently unmatched content. All text is considered.
Parameters:
anExpression - the regular expression to match
Returns:
the instantiated matcher
public java.util.regex.Matcher matchUnmatchedContent(java.lang.String anExpression)
Appends the pre-parsed text as unmatched for any case where a parsed expression needs to be discarded as text (invalid string bounds, white space preceding array subscript closure, etc.)
Parameters:
anExpression - the parsed content to discard
Throws:
MJTranslateException - if there is a problem restoring the text that was previously parsed
public void restoreOriginalText(com.arsi.mj.maprpt.lexer.ptree.expr.IMaprptExpr anExpression)