Class BslDocCommentParser
java.lang.Object
com.e1c.langtool.v8.dt.bsl.translator.BslDocCommentParser
A class prepares a comment and parses it
-
Constructor Summary
ConstructorsConstructorDescriptionBslDocCommentParser(org.eclipse.xtext.naming.IQualifiedNameConverter qualifiedNameConverter, ITranslationFeatureKeyProvider featureKeyProvider, IResourceLookup resourceLookup, BslPreferences preferences) Instantiates a new bsl doc comment parser. -
Method Summary
Modifier and TypeMethodDescriptiongetVariableFeatureKey(org.eclipse.emf.ecore.EObject owner, org.eclipse.emf.ecore.EObject variable, Map<Variable, Block> blockVariables, String keyPreffix) Gets the variable feature key.booleanisCommentHasIncorrectReturnTypes(BslDocumentationComment comment, org.eclipse.emf.ecore.EObject context) Checks if is comment has incorrect return types.booleanisCommentStartsWithAtSymbol(List<String> text, int contentIdx) Checks if is comment starts with @ symbol.booleanisCommentStartWithDash(List<String> commentContent) Returntrueif comment start with dash.Prepares and parses comment nodesvoidremoveReturnsStatement(List<String> text) Removes the returns statement.voidrestoreCommentDescription(BslDocumentationComment comment, List<String> text, org.eclipse.emf.ecore.EObject context) Restores comment description.
-
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 benullfeatureKeyProvider- the feature key provider, cannot benullresourceLookup- the resource lookup service, cannot benullpreferences- the bsl preferences service, cannot benull
-
-
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 benullisOldCommentFormat- the is old comment format- Returns:
- the parsed bsl documentation comment, can be
null
-
isCommentStartsWithAtSymbol
Checks if is comment starts with @ symbol.- Parameters:
text- the comments text, cannot benullcontentIdx- starting index of the comment body in the text collection- Returns:
true, if is comment starts with at symbol
-
removeReturnsStatement
Removes the returns statement.- Parameters:
text- the comment lines collection, cannot benull
-
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 benullcontext- the context, cannot benull- 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 benulltext- the text, cannot benullcontext- the context, cannot benull
-
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 benullvariable- the variable, cannot benullblockVariables- the block variables, cannot benullkeyPreffix- , cannot benull- Returns:
- the variable feature key, can be
null
-
isCommentStartWithDash
Returntrueif comment start with dash.- Parameters:
commentContent- the comment content, cannot benull- Returns:
true, if is comment start with dash
-