Skip to content

PR-research-data-tools/Smalltalk-class-comment-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smalltalk-class-comment-generator

  • This tool attempts to generate a Smalltalk class comment as shown in this figure:

  • The comment contains information types based on the default Pharo template:

Overview

1. Requirements
2. Installation
3. Usage
4. Development
5. References
6. License

Requirements

  • Pharo > 8.0

Installation

Metacello new
baseline: 'CommentGenerator';
repository: 'github://PR-research-data-tools/Smalltalk-class-comment-generator:main/src';
load.

Usage

|cg|
cg := CommentGenerator new.
cg targetClass: RSShape.
cg generateDocument.

Development

There are various classes used to achieve class comment generation.

Comment Generator classes

CommentGenerator class is one of the important classes. The user can pass a class of interest in targetClass and pass generateDocument message to generate class comment for the class. It has two more important classes CGIdentifier and CGFormatter where the former contains most of the logic and latter formats the writestream output.

Visitor classes

These classes are used to extract important or relevant information about a method. The visitor is set up by passing a method name (aSymbol).

| method visitor |
   method := targetClass >> aSymbol.
   visitor := CGAccessorVisitor new.
   method ast acceptVisitor: visitor.
   visitor result

Get Class Stereotypes

|ci|
ci := CGIdentifier new.
ci targetClass: RSShape.
ci getClassStereotype.

Get Method Stereotypes

|ci|
ci := CGIdentifier new.
ci targetClass: RSShape.
ci getMethodStereotypes.

References

License

MIT License

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors