Class StandardStringifier

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static int checkLineFinished​(java.util.List<IndexedString> output, java.lang.StringBuilder active, int lineCount, org.antlr.v4.runtime.Token t)
      Method to check if a line has been finished, if it has it adds the line to the output and moves onto the next
      static int preserveCommentLines​(java.util.List<IndexedString> output, java.lang.StringBuilder active, int lineCount, org.antlr.v4.runtime.Token t)
      Method to split a comment out into its component lines if it spans more than one line to preserve the sourcefile line structure
      java.util.List<IndexedString> processTokens​(java.util.List<? extends org.antlr.v4.runtime.Token> tokens, org.antlr.v4.runtime.Vocabulary vocab)
      Stringifies a file in the form of a list of tokens
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StandardStringifier

        public StandardStringifier()
    • Method Detail

      • processTokens

        public java.util.List<IndexedString> processTokens​(java.util.List<? extends org.antlr.v4.runtime.Token> tokens,
                                                           org.antlr.v4.runtime.Vocabulary vocab)
        Stringifies a file in the form of a list of tokens
        Specified by:
        processTokens in interface ITokenStringifier
        Parameters:
        tokens - the file as a list of tokens
        vocab - the lexer vocab
        Returns:
        indexed lines of the file, stringified
      • checkLineFinished

        public static int checkLineFinished​(java.util.List<IndexedString> output,
                                            java.lang.StringBuilder active,
                                            int lineCount,
                                            org.antlr.v4.runtime.Token t)
        Method to check if a line has been finished, if it has it adds the line to the output and moves onto the next
        Parameters:
        output - list of output strings
        active - current string
        lineCount - current lineCount
        t - next token
        Returns:
        new lineCount
      • preserveCommentLines

        public static int preserveCommentLines​(java.util.List<IndexedString> output,
                                               java.lang.StringBuilder active,
                                               int lineCount,
                                               org.antlr.v4.runtime.Token t)
        Method to split a comment out into its component lines if it spans more than one line to preserve the sourcefile line structure
        Parameters:
        output - list of output strings
        active - current string
        lineCount - current lineCount
        t - token containing comment
        Returns:
        new lineCount