Class Statement

    • Constructor Detail

      • Statement

        public Statement​(TokenType tokenType,
                         int start,
                         int end)
    • Method Detail

      • getTokenType

        public TokenType getTokenType()
      • getTokenStart

        public int getTokenStart()
      • getTokenEnd

        public int getTokenEnd()
      • preserveMaskedOutSpace

        protected void preserveMaskedOutSpace​(StringBuilder result,
                                              CharSequence source,
                                              int tokenStart,
                                              int tokenEnd)
        Replaces preprocessor directives and masked out source with whitespace. Retains newline characters.

        Note, a more efficient approach would involve only preserving newline chars for debug purposes and omitting masked out source. However, since javac determines compile error line numbers from the error offset into the original file, we must preserve the full length and structure of the original source.

        Parameters:
        result - The resulting preprocessed source.
        source - The original source.
      • hasPreprocessorDirectives

        public abstract boolean hasPreprocessorDirectives()