Class RubyTemplatePrinter
- java.lang.Object
-
- ru.ispras.microtesk.tools.templgen.printers.RubyTemplatePrinter
-
- All Implemented Interfaces:
TemplatePrinter
public final class RubyTemplatePrinter extends java.lang.Object implements TemplatePrinter
TheRubyTemplatePrinter
class prints data of template into a ruby file.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]
RUBY_KEYWORDS
static java.lang.String
RUBY_TAB
-
Constructor Summary
Constructors Constructor Description RubyTemplatePrinter(java.lang.String templateName, java.lang.String modelName, java.lang.String baseTemplateName, java.lang.String baseTemplatePath)
Constructs a ruby printer with the specified template name.RubyTemplatePrinter(java.lang.String templateName, java.lang.String modelName, java.lang.String baseTemplateName, java.lang.String baseTemplatePath, java.nio.file.Path outputDirectory, boolean dataRegion)
Constructs a ruby printer with the specified template name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAlignedText(java.lang.String addText)
Adds the aligned (in accordance of the text structure) text to template file.void
addComment(java.lang.String addText)
Adds the comment to template file.void
addDataRegion()
Adds the data region to template file.void
addHeader()
Adds a header to template file.void
addOperation(java.lang.String operation)
Adds the operation to template file.void
addOperation(java.lang.String opName, java.lang.String opArguments)
Adds the operation to template file.void
addString(java.lang.String addString)
Adds the string to template file.void
addText(java.lang.String addText)
Adds the text to template file.void
closeBlock()
Closes the block in template file.void
closeSequence(java.lang.String addText)
Closes the sequence in template file.java.lang.String
formattingOperation(java.lang.String operationName)
Checks for a match with the keywords and returns not a keyword for the printer with the same value.java.lang.String
getDataLabel()
Returns the data region label of the template file.java.lang.String
getModelName()
void
startBlock()
Opens the block in template file.void
startSequence(java.lang.String addText)
Opens the sequence in template file.void
templateBegin()
Adds a title to template file.void
templateClose()
Closes the template file.void
templateEnd()
Adds end title for template.
-
-
-
Field Detail
-
RUBY_KEYWORDS
public static final java.lang.String[] RUBY_KEYWORDS
-
RUBY_TAB
public static final java.lang.String RUBY_TAB
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RubyTemplatePrinter
public RubyTemplatePrinter(java.lang.String templateName, java.lang.String modelName, java.lang.String baseTemplateName, java.lang.String baseTemplatePath, java.nio.file.Path outputDirectory, boolean dataRegion)
Constructs a ruby printer with the specified template name.- Parameters:
templateName
- the template name.modelName
- the model name.baseTemplateName
- the base template name.baseTemplatePath
- the base template path.outputDirectory
- the output directory for template file.dataRegion
- flag indicating whether to print region with data
-
RubyTemplatePrinter
public RubyTemplatePrinter(java.lang.String templateName, java.lang.String modelName, java.lang.String baseTemplateName, java.lang.String baseTemplatePath)
Constructs a ruby printer with the specified template name.- Parameters:
templateName
- the template name.modelName
- the model name.baseTemplateName
- the base template name.baseTemplatePath
- the base template path.
-
-
Method Detail
-
formattingOperation
public java.lang.String formattingOperation(java.lang.String operationName)
Description copied from interface:TemplatePrinter
Checks for a match with the keywords and returns not a keyword for the printer with the same value. Example: add - keyword, ADD - not keyword for some languages.- Specified by:
formattingOperation
in interfaceTemplatePrinter
- Parameters:
operationName
- name of the operation.- Returns:
- not keyword name of the operation for the printer.
-
templateBegin
public void templateBegin()
Description copied from interface:TemplatePrinter
Adds a title to template file.- Specified by:
templateBegin
in interfaceTemplatePrinter
-
addHeader
public void addHeader()
Description copied from interface:TemplatePrinter
Adds a header to template file.- Specified by:
addHeader
in interfaceTemplatePrinter
-
addDataRegion
public void addDataRegion()
Description copied from interface:TemplatePrinter
Adds the data region to template file.- Specified by:
addDataRegion
in interfaceTemplatePrinter
-
getDataLabel
public java.lang.String getDataLabel()
Description copied from interface:TemplatePrinter
Returns the data region label of the template file.- Specified by:
getDataLabel
in interfaceTemplatePrinter
- Returns:
- label of the data region.
-
addOperation
public void addOperation(java.lang.String operation)
Adds the operation to template file.- Parameters:
operation
- Operation syntax.
-
addOperation
public void addOperation(java.lang.String opName, java.lang.String opArguments)
Description copied from interface:TemplatePrinter
Adds the operation to template file.- Specified by:
addOperation
in interfaceTemplatePrinter
- Parameters:
opName
- Operation name.opArguments
- Operation arguments.
-
addString
public void addString(java.lang.String addString)
Description copied from interface:TemplatePrinter
Adds the string to template file.- Specified by:
addString
in interfaceTemplatePrinter
- Parameters:
addString
- string.
-
addText
public void addText(java.lang.String addText)
Description copied from interface:TemplatePrinter
Adds the text to template file.- Specified by:
addText
in interfaceTemplatePrinter
- Parameters:
addText
- text.
-
addAlignedText
public void addAlignedText(java.lang.String addText)
Description copied from interface:TemplatePrinter
Adds the aligned (in accordance of the text structure) text to template file.- Specified by:
addAlignedText
in interfaceTemplatePrinter
- Parameters:
addText
- text.
-
addComment
public void addComment(java.lang.String addText)
Description copied from interface:TemplatePrinter
Adds the comment to template file.- Specified by:
addComment
in interfaceTemplatePrinter
- Parameters:
addText
- text.
-
templateEnd
public void templateEnd()
Description copied from interface:TemplatePrinter
Adds end title for template.- Specified by:
templateEnd
in interfaceTemplatePrinter
-
templateClose
public void templateClose()
Description copied from interface:TemplatePrinter
Closes the template file.- Specified by:
templateClose
in interfaceTemplatePrinter
-
startSequence
public void startSequence(java.lang.String addText)
Description copied from interface:TemplatePrinter
Opens the sequence in template file.- Specified by:
startSequence
in interfaceTemplatePrinter
- Parameters:
addText
- sequence title.
-
closeSequence
public void closeSequence(java.lang.String addText)
Description copied from interface:TemplatePrinter
Closes the sequence in template file.- Specified by:
closeSequence
in interfaceTemplatePrinter
- Parameters:
addText
- sequence end title.
-
startBlock
public void startBlock()
Description copied from interface:TemplatePrinter
Opens the block in template file.- Specified by:
startBlock
in interfaceTemplatePrinter
-
closeBlock
public void closeBlock()
Description copied from interface:TemplatePrinter
Closes the block in template file.- Specified by:
closeBlock
in interfaceTemplatePrinter
-
getModelName
public java.lang.String getModelName()
- Specified by:
getModelName
in interfaceTemplatePrinter
-
-