Class BslDocCommentParser

java.lang.Object
com.e1c.langtool.v8.dt.bsl.translator.BslDocCommentParser

public class BslDocCommentParser extends Object
A class prepares a comment and parses it
  • Constructor Details

    • BslDocCommentParser

      @Inject public BslDocCommentParser(org.eclipse.xtext.naming.IQualifiedNameConverter qualifiedNameConverter, ITranslationFeatureKeyProvider featureKeyProvider, IResourceLookup resourceLookup, BslPreferences preferences)
      Instantiates a new bsl doc comment parser.
      Parameters:
      qualifiedNameConverter - the qualified name converter, cannot be null
      featureKeyProvider - the feature key provider, cannot be null
      resourceLookup - the resource lookup service, cannot be null
      preferences - the bsl preferences service, cannot be null
  • Method Details

    • parse

      public BslDocumentationComment parse(List<org.eclipse.xtext.nodemodel.INode> nodes, boolean isOldCommentFormat)
      Prepares and parses comment nodes
      Parameters:
      nodes - the comments nodes, cannot be null
      isOldCommentFormat - the is old comment format
      Returns:
      the parsed bsl documentation comment, can be null
    • isCommentStartsWithAtSymbol

      public boolean isCommentStartsWithAtSymbol(List<String> text, int contentIdx)
      Checks if is comment starts with @ symbol.
      Parameters:
      text - the comments text, cannot be null
      contentIdx - starting index of the comment body in the text collection
      Returns:
      true, if is comment starts with at symbol
    • removeReturnsStatement

      public void removeReturnsStatement(List<String> text)
      Removes the returns statement.
      Parameters:
      text - the comment lines collection, cannot be null
    • isCommentHasIncorrectReturnTypes

      public boolean isCommentHasIncorrectReturnTypes(BslDocumentationComment comment, org.eclipse.emf.ecore.EObject context)
      Checks if is comment has incorrect return types.
      Parameters:
      comment - the comment, cannot be null
      context - the context, cannot be null
      Returns:
      true, if is comment has incorrect return types
    • restoreCommentDescription

      public void restoreCommentDescription(BslDocumentationComment comment, List<String> text, org.eclipse.emf.ecore.EObject context)
      Restores comment description.
      Parameters:
      comment - the comment, cannot be null
      text - the text, cannot be null
      context - the context, cannot be null
    • getVariableFeatureKey

      public FeatureKey getVariableFeatureKey(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EObject variable, Map<Variable,Block> blockVariables, String keyPreffix)
      Gets the variable feature key.
      Parameters:
      owner - the owner, cannot be null
      variable - the variable, cannot be null
      blockVariables - the block variables, cannot be null
      keyPreffix - , cannot be null
      Returns:
      the variable feature key, can be null
    • isCommentStartWithDash

      public boolean isCommentStartWithDash(List<String> commentContent)
      Return true if comment start with dash.
      Parameters:
      commentContent - the comment content, cannot be null
      Returns:
      true, if is comment start with dash