Design#
The fundamental building block of Stylist is the “Rule.” Each rule implements a single check which the source code must pass.
UML class diagram showing “rule” module classes.#
Rules are collected into “Styles” allowing different sets of rules to be used for different purposes.
UML class diagram showing “style” module classes.#
Source is presented either line-by-line as strings from the text file or as an abstract syntax tree, gained by parsing the source.
UML class diagram showing “source” module classes.#
The line based SourceText
can come from either a file or a string buffer.
This text can have preprocessors applied to it using the decorator pattern.
Operation is orchestrated through the Engine
class. It makes use of a
factory class to create the correct source object from a file.
UML class diagram showing various orchestration classes.#
Sample operation is shown in the following sequence diagram:
UML sequence diagram showing example operation.#