Class DocCommentExtractor

java.lang.Object
org.ek9lang.compiler.support.DocCommentExtractor

final class DocCommentExtractor extends Object
Extracts doc comment text from HIDDEN channel tokens. Doc comments use the syntax <?- ... -?> in EK9. This utility strips the delimiters and normalizes the content.
  • Constructor Details

    • DocCommentExtractor

      DocCommentExtractor()
  • Method Details

    • extract

      String extract(List<org.antlr.v4.runtime.Token> hiddenTokens)
      Extract the doc comment text from the most recent HIDDEN channel token. Takes the last doc comment token if multiple are present (closest to the construct).
      Parameters:
      hiddenTokens - The list of HIDDEN channel tokens to the left of a construct.
      Returns:
      The extracted doc comment text with delimiters stripped, or null if no doc comment found.