ilog.rules.brl.translation.codegen

Class IlrAbstractCodeGenerator

  • java.lang.Object
    • ilog.rules.brl.translation.codegen.IlrAbstractCodeGenerator
    • Field Detail

      • currentRuleStatement

        public IlrRuleStatement currentRuleStatement
        Public attribute for the current rule statement cursor.
    • Constructor Detail

      • IlrAbstractCodeGenerator

        public IlrAbstractCodeGenerator()
        Creates a new IlrAbstractCodeGenerator.
    • Method Detail

      • reset

        protected void reset()
        Resets this code generator and prepare it for a new code generation.
      • generateCode

        public void generateCode(IlrIntermediateForm iform,
                        java.io.Writer writer)
        Generates the code for the specified IlrIntermediateForm instance, and into the provided writer.
        Specified by:
        generateCode in interface IlrCodeGenerator
        Parameters:
        iform - The intermediate form.
        writer - The writer.
      • reportDuplicateVariables

        public void reportDuplicateVariables(boolean flag)
        this method set whether this code generator should report duplicate variables
      • reportDuplicateVariables

        public boolean reportDuplicateVariables()
        This method returns whether this code generator should reprot duplicate variables
        Returns:
        true if this code generator reports duplicate variables and false otherwise
      • getTranslationSupport

        public IlrTranslationSupport getTranslationSupport()
        Gets the translation support.
        Returns:
        The translation support.
      • getVocabulary

        public IlrVocabulary getVocabulary()
        Returns the vocabulary.
        Returns:
        The vocabulary.
      • getExtender

        public IlrCodeGeneratorExtender getExtender(IlrSyntaxTree.Node node)
        Returns the extender registered for the grammar node of node.
        Parameters:
        node - The node.
        Returns:
        The code generator extender, or null if no code generator extender has been registered for this node.
      • print

        public void print(java.lang.String text)
        Prints a string.
        Parameters:
        text - The string to print.
      • println

        public void println(java.lang.String str)
        Prints a string followed by a newline.
        Parameters:
        str - The string to print.
      • print

        public void print(char ch)
        Prints a character.
        Parameters:
        ch - The character to print.
      • indent

        public void indent(int count)
        Prints the given number of white spaces.
        Parameters:
        count - The number of white space characters to print.
      • indent

        public void indent()
        Prints getIndent() white spaces.
      • getIndent

        public int getIndent()
        Gets the indentation multiplied by the indent size.
      • addIndent

        public void addIndent(int count)
        Increments the indentation by the given amount.
        Parameters:
        count - The amount by which the indentation is to be increased.
      • setIndentSize

        public void setIndentSize(int size)
        Sets the indent size.
        Parameters:
        size - The size of the indent.
      • getIndentSize

        public int getIndentSize()
        Gets the indent size.
        Returns:
        The size of the indent.
      • newline

        public void newline()
        Prints a newline.
      • ignoreNewline

        public void ignoreNewline(boolean flag)
        Sets the IgnoreNewline flag.

        When true, the newLine property is not taken in account by the printToken() methods.

        Parameters:
        flag - The new value for the IgnoreNewline flag.
      • ignoreNewline

        public boolean ignoreNewline()
        Returns the value of the IgnoreLine flag.
        Returns:
        The value of the IgnoreLine flag.
        See Also:
        ignoreNewline(boolean)
      • flush

        public void flush()
        Flushes the stream.
      • close

        public void close()
        Closes the stream.

© Copyright IBM Corp. 1987, 2017