Next: , Previous: , Up: Software Evolution Library Index   [Contents][Index]


A.50 SOFTWARE-EVOLUTION-LIBRARY/SOFTWARE/STYLEABLE

Variable: *clang-c-ast-classes* [sel/sw/styleable]

List of clang C ast-class types.

Variable: *clang-c-keywords* [sel/sw/styleable]

List of clang C keywords

Variable: *feature-extractors* [sel/sw/styleable]

List of feature-extractors to use as the default set during feature extraction.

Generic Function: all-ast-node-types [sel/sw/styleable] software

Return a list of all possible types of AST nodes for ASTs in software.

Method: all-ast-node-types [sel/sw/styleable] (clang clang)

Return a list of all possible types of AST nodes for ASTs in clang. Uses ‘*clang-c-ast-classes*’.

Generic Function: all-keywords [sel/sw/styleable] software

Return the list of possible keywords that may appear in software.

Method: all-keywords [sel/sw/styleable] (clang clang)

Return the list of possible keywords that may appear in clang. Uses ‘*clang-c-keywords*’.

Generic Function: ast-bi-grams [sel/sw/styleable] software &key bi-grams-ht

Update and return data structure bi-grams with counts of bi-grams in the ASTs of all statements in software.

Method: ast-bi-grams [sel/sw/styleable] (clang clang) &key (bi-grams-ht (make-hash-table test (function equal)))

Update and return hash-table bi-grams-ht with counts of bi-grams in the ASTs of all statements in clang.

Generic Function: ast-bi-grams-extractor [sel/sw/styleable] software

Return a feature vector counting AST node type bi-grams.

Variable: ast-bi-grams-feature [sel/sw/styleable]

Number of occurrences of AST node type bi-grams in an AST.

Generic Function: ast-depth [sel/sw/styleable] software ast

Depth of AST in software. The root node has a depth of 0.

Method: ast-depth [sel/sw/styleable] (clang clang) ast

Depth of AST in clang. The root node has a depth of 0

Generic Function: ast-full-stmt-bi-grams [sel/sw/styleable] software &key bi-grams-ht

Update and return data structure bi-grams with counts of bi-grams in the ASTs of full statements in software.

Method: ast-full-stmt-bi-grams [sel/sw/styleable] (clang clang) &key (bi-grams-ht (make-hash-table test (function equal)))

Update and return hash-table bi-grams-ht with counts of bi-grams in the ASTs of full statements in clang.

Generic Function: ast-full-stmt-bi-grams-extractor [sel/sw/styleable] software

Return a feature vector counting AST node type bi-grams for full statements.

Variable: ast-full-stmt-bi-grams-feature [sel/sw/styleable]

Number of occurrences of AST node type bi-grams in each full statement in an AST.

Generic Function: ast-keyword-tf [sel/sw/styleable] keyword ast

Count term frequency of keyword in an AST.

Method: ast-keyword-tf [sel/sw/styleable] (keyword string) ast

Count term frequency of keyword in an AST of clang. Uses ‘auto-count-keyword’ and ‘search-keyword’.

Generic Function: ast-keyword-tf-extractor [sel/sw/styleable] software

Return a vector containing term frequencies for all possible keywords in software (see also ‘all-keywords’).

The returned feature vector will have one entry for each keyword listed in ‘*clang-c-keywords*’.

Variable: ast-keyword-tf-feature [sel/sw/styleable]

Term frequency of keywords in an AST.

Generic Function: ast-node-type-avg-depth [sel/sw/styleable] software node-type

Average depth of nodes with type node-type in the ASTs in software.

Method: ast-node-type-avg-depth [sel/sw/styleable] (clang clang) (node-type symbol)

Average depth of nodes with type node-type in the ASTs in clang.

Generic Function: ast-node-type-avg-depth-extractor [sel/sw/styleable] software

Returns a feature vector of average depth of AST nodes by type. The length is the number of possible AST node tyes (as determined by ‘all-ast-node-types’). Each element is the average depth of nodes of the corresponding type in the AST of software.

Variable: ast-node-type-avg-depth-feature [sel/sw/styleable]

Average depth of each possible node type in the AST.

Generic Function: ast-node-type-tf-extractor [sel/sw/styleable] software

Return a vector with counts of occurrences of each possible AST node type.

The returned vector will have one entry for each ast class listed in ‘clang-c-ast-classes’.

Variable: ast-node-type-tf-feature [sel/sw/styleable]

Term frequency of AST node types.

Generic Function: ast-node-types [sel/sw/styleable] software

Return a list of the node types present in the ASTs in software.

Method: ast-node-types [sel/sw/styleable] (clang clang)

Return a list of the ast classes that occur in clang

Generic Function: auto-count-keyword [sel/sw/styleable] keyword ast

Return 1 if AST is a statement matching keyword, 0 otherwise.

Method: auto-count-keyword [sel/sw/styleable] (keyword string) ast

Return 1 if AST is a statement matching keyword, 0 otherwise. * keyword a string, to be compared against the ‘ast-class’ of AST. See also ‘*clang-c-ast-keywords-auto-count*’. * AST a clang ast

Generic Function: avg-depth-ast-extractor [sel/sw/styleable] software

Return 1-element feature vector of the average depth of ASTs in software.

Variable: avg-depth-ast-feature [sel/sw/styleable]

Average depth of nodes in the AST.

Generic Function: bi-grams [sel/sw/styleable] items &key key bi-grams-ht

Update and return bi-grams-ht of counts of bi-gram occurrences in items. Use key to specify a function applied to each item to get a value which will be paired with another such value to create a key.

Method: bi-grams [sel/sw/styleable] (items list) &key (key (function identity)) (bi-grams-ht (make-hash-table test (function equal)))

Update and return hash table bi-grams-ht with counts of bi-gram occurrences in items. Use key to specify a function applied to each item to get a value which will be paired with another such value to create a key.

used as keys in the hash-table * bi-grams-ht a hash table mapping pairs of keys to numbers of occurrences

Generic Function: bi-grams-hashtable-to-feature [sel/sw/styleable] software bi-grams

Return a feature-vector containing counts of bi-grams in software stored in bi-grams.

Method: bi-grams-hashtable-to-feature [sel/sw/styleable] (clang clang) (bi-grams hash-table)

Return a feature-vector containing counts of bi-grams in clang stored in hash-table bi-grams.

Function: diff-feature-vectors [sel/sw/styleable] vec1 vec2

Return a vector of the absolute differences between items in VEC1 and VEC2.

Generic Function: extract-baseline-features [sel/sw/styleable] styleable &key features

For a styleable, extract features to establish baseline feature vectors. Returns two values: a vector of feature vectors and a vector of metadata.

Method: extract-baseline-features [sel/sw/styleable] (style styleable) &key (features *feature-extractors*)

For a styleable style, extract features to establish baseline feature vectors. Return two values: a vector of feature vectors and a vector of metadata.

Generic Function: extract-feature [sel/sw/styleable] styleable style-feature

For a styleable object, extract a single style-feature. Updates the corresponding feature-vector and feature-vec-meta data in styleable and returns two values: the extracted feature vector and its metadata.

Method: extract-feature [sel/sw/styleable] (style styleable) (feature style-feature)

For a styleable style object, extract a single style-feature feature. Updates the corresponding feature-vector and feature-vec-meta data in style and returns two values: the extracted feature vector and its metadata.

Generic Function: extract-features [sel/sw/styleable] software &key features files &allow-other-keys

For a software object, extract a set of features. Returns two values: a vector of feature vectors and a vector of metadata (used by feature merge functions).

Method: extract-features [sel/sw/styleable] (project style-project) &key (features *feature-extractors*) (files (all-files project))

For a project object, extract a set of features for each software object in the project and merge the results. Return two values: a vector of feature vectors and a vector of metadata (used by feature merge functions).

Method: extract-features [sel/sw/styleable] (style styleable) &key (features nil)

For a styleable style, extract a list of style-features features. Returns two values: a vector of feature vectors and a vector of metadata (used by feature merge functions).

Generic Function: max-depth-ast [sel/sw/styleable] software asts

Return the maximum depth of the asts in software.

Method: max-depth-ast [sel/sw/styleable] (clang clang) asts

Return the maximum depth of the asts in clang. All depths are relative to the top-level of the clang software object (not relative to elements in the list of ASTs).

Generic Function: max-depth-ast-extractor [sel/sw/styleable] software

Return 1-element feature vector of the max depth of any AST in software.

Function: merge-max [sel/sw/styleable] vec1 meta1 vec2 meta2

Return a new vector of the pair-wise maximums for values in VEC1 and VEC2. Metadata, META1 and META2 is ignored.

Function: merge-means [sel/sw/styleable] means1 lens1 means2 lens2

Return a new vector merging vectors MEANS1 and MEANS2 whose elements are means. Each element of MEANS1 and MEANS2 represents the mean of a set whose size is the corresponding element in vector LENS1 or LENS2, respectively. The result is two values: a vector of the combined means, and a vector of the pair-wise sums of LENS1 and LENS2 (i.e., the sizes of the combined sets each combined mean represents).

Function: merge-normalized [sel/sw/styleable] vec1 denom1 vec2 denom2

Merge two vectors VEC1 and VEC2 which have been normalized using the denominators DENOM1 and DENOM2, respectively

Generic Function: merge-styleables [sel/sw/styleable] styleable1 styleable2 &key result

Merge all feature vectors from STYLEABLE1 and STYLEABLE2. Update and return result to be a ‘styleable’ object containing the merged feature vectors and metadata.

Method: merge-styleables [sel/sw/styleable] (style1 styleable) (style2 styleable) &key (result (make-instance (quote styleable)))

Merge all feature vectors from STYLE1 and STYLE2. Update and return result to be a ‘styleable’ object containing the merged feature vectors and metadata.

‘eq’ to STYLE1 or STYLE2.

Generic Function: search-keyword [sel/sw/styleable] keyword ast

Return 1 if keyword occurs anywhere in the text of an AST in software, 0 otherwise.

Method: search-keyword [sel/sw/styleable] (keyword string) ast

Return 1 if keyword occurs anywhere in the source text of an AST in clang, 0 otherwise. Only searches ASTs whose ‘ast-class’ is in ‘*clang-c-ast-keywords-search-count*’.

Class: style-feature [sel/sw/styleable]

Class precedence list: style-feature, standard-object, slot-object, t

Slots:

Type of style feature, including a feature extractor and an accompanying merge function for combining feature vectors.

Class: style-project [sel/sw/styleable]

Class precedence list: style-project, styleable, project, software, oid-object, standard-object, slot-object, t

A project with style-features.

Class: styleable [sel/sw/styleable]

Class precedence list: styleable, software, oid-object, standard-object, slot-object, t

Slots:

Type of software objects that can have style features extracted.

Variable: max-depth-ast-feature [sel/sw/styleable]

Maximum depth of any node in the AST.

Macro: define-feature [sel/sw/styleable] feature-name feature-desc (extractor-fn eargs extractor-desc &rest ebody) (merge-fn &optional margs &rest mbody)

A macro for defining feature extractors.

If the function doesn’t exist, margs and mbody should be provided. Otherwise, they should not be provided. * margs arguments to the merge function (should be 4: vector1, metadata1, vector2, metadata2). Not required if merge-fn is already a defined function. * mbody body of the merge function. Not required if merge-fn is already a defined function.

Function: normalize-vector [sel/sw/styleable] vec

Return a copy of vec whose elements have been normalized to sum to 1.

* vec a vector of numeric values.

Generic Function: to-feature-vector [sel/sw/styleable] feature-values sorted-keys

Convert a set of feature-values into a feature vector. The elements of the vector are the values corresponding to sorted-keys.

Method: to-feature-vector [sel/sw/styleable] (feature-values hash-table) (sorted-keys list)

Convert a set of feature-values into a feature vector. Return a vector whose elements are the values from feature-values that are mapped to the keys in sorted-keys.

Generic Function: uni-grams [sel/sw/styleable] items &key key uni-grams-ht

Update uni-grams-ht with counts of uni-gram occurrences in items. Use key to specify a function applied to each item to generate a value used as a key. The data structure uni-grams-ht is both updated and returned as the result.

Method: uni-grams [sel/sw/styleable] (items list) &key (key (function identity)) (uni-grams-ht (make-hash-table test (function equal)))

Update uni-grams-ht with counts of uni-gram occurrences in items. Use key to specify a function applied to each item to generate a value used as the hash-table key. The hash-table uni-grams-ht is both updated and returned as the result

Function: update-project-features [sel/sw/styleable] project &key features files

Update feature values for features in project by re-merging feature-vectors and metadata for all software objects in the project.

May be a subset of the features tracked in project. * files a list of files on which to extract features (default: ‘all-files’)


Next: , Previous: , Up: Software Evolution Library Index   [Contents][Index]