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


A.45 SOFTWARE-EVOLUTION-LIBRARY/SOFTWARE/PARSEABLE

Generic Function: ancestor-of-p [sel/sw/parseable] obj target-ast ancestor

Returns t if ancestor is an ancestor of target-ast in obj.

Generic Function: append-text-to-genome [sel/sw/parseable] software text

Append non-AST text to obj genome.

Generic Function: append-text-to-genome-preamble [sel/sw/parseable] software text

Append non-AST text to OBJ’s genome preamble.

Generic Function: ast-source-ranges [sel/sw/parseable] obj

Return (ast . source-range) for each AST in obj.

Generic Function: asts-contained-in-source-range [sel/sw/parseable] software range

Return a list of ASTs in software contained in range.

Generic Function: bad-asts [sel/sw/parseable] software

Return a list of all bad asts in software.

Method: bad-asts [sel/sw/parseable] (obj parseable)

Return a list of all bad asts in obj

Generic Function: combine-all-conflict-asts [sel/sw/parseable] parent child-list

Replace parent with a conflict node obtained by combining the conflict nodes of child-list, and whose elements are version of parent with those various combinations.

Class: conflict-ast [sel/sw/parseable]

Class precedence list: conflict-ast, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, standard-object, slot-object, t

Slots:

Node representing several possibilities for an AST. The mapping from a conflicted AST into a regular AST is as follows: for a given conflict key, and for each conflict node, get the list of children corresponding to that key (default if the key is not present), and splice that list of children in place of the conflict node in its parent’s children list.

Variable: *indent-with-tabs-p* [sel/sw/parseable]

A boolean value that indicates whether tabs should be used instead of spaces. This can be set to modify the behavior of #’source-text and #’convert

Generic Function: ast-annotation [sel/sw/parseable] ast annotation

Return given AST annotation.

Generic Function: (setf ast-annotation [sel/sw/parseable]) v ast annotation

Set the given AST annotation to v.

Function: ast-combine-hash-values [sel/sw/parseable] &rest args

Invoke ‘ast-combine-list-hash-values’ on args.

Generic Function: ast-path [sel/sw/parseable] obj ast

Return the path to AST in obj.

Function: ast-start+end [sel/sw/parseable] software ast

Return the start and end of AST in software (if any) as source locations.

Generic Function: asts [sel/sw/parseable] obj

Deprecated: Return a list of all non-root ASTs in obj.

Method: before asts [sel/sw/parseable] (obj clang)

Ensure the ‘asts‘ field is set on obj prior to access.

Method: asts [sel/sw/parseable] (clang clang)

Deprecated: List of all ASTs.

Method: asts [sel/sw/parseable] (obj parseable-project)

Return a list of all ASTs in the project obj.

Generic Function: asts-containing-source-location [sel/sw/parseable] software location

Return a list of ASTs in software containing loc.

Generic Function: bad-mutation-targets [sel/sw/parseable] software &key filter

Return a list of all bad mutation targets in software matching filter.

Method: bad-mutation-targets [sel/sw/parseable] (obj parseable) &key filter

Return a list of all bad mutation targets in obj matching filter.

Method: bad-mutation-targets [sel/sw/parseable] (clang clang) &key filter

Return a list of all bad statement ASTs in clang matching filter.

Generic Function: enclosing-scope [sel/sw/parseable] software ast

Returns enclosing scope of AST.

Method: enclosing-scope [sel/sw/parseable] (obj tree-sitter) (ast ast)

Return the enclosing scope of AST in obj.

Method: enclosing-scope [sel/sw/parseable] (obj javascript) (ast javascript-ast)

Return the enclosing scope of AST in obj. obj javascript software object AST ast to return the enclosing scope for

Method: enclosing-scope [sel/sw/parseable] (obj python) (ast python-ast)

Return the enclosing scope of AST in obj. obj python software object AST ast to return the enclosing scope for

Method: enclosing-scope [sel/sw/parseable] (software clang) (ast clang-ast)

docfixme

Generic Function: find-deepest [sel/sw/parseable] function ast

Find the deepest node in AST satisfying function.

Generic Function: find-if-in-parents [sel/sw/parseable] predicate obj ast

Search through the parents of AST for the first one that satisfies predicate.

Generic Function: from-alist [sel/sw/parseable] symbol alist

Convert alist to struct representation.

Class: functional-tree-ast [sel/sw/parseable]

Class precedence list: functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, standard-object, slot-object, t

Slots:

Base class for sel functional tree ASTs. An applicative tree structure is used to hold the ASTs.

Generic Function: get-ast-types [sel/sw/parseable] software ast

Types directly referenced within AST.

Method: get-ast-types [sel/sw/parseable] (software clang) (ast clang-ast)

Compute all the types mentioned in AST. ast-types is the types used at a node; this function closes over all the nodes in the AST. software is the software object to which AST belongs.

Generic Function: get-default-indentation [sel/sw/parseable] ast parents

Get a sane indent-children default for AST.

Generic Function: get-function-from-function-call [sel/sw/parseable] obj funcall-ast

Return the function ast associated with the funcall-ast if it exists in obj.

Method: get-function-from-function-call [sel/sw/parseable] (obj c) (callexpr c-ast)

Given a c software object and a call-expression, return the function definition.

Generic Function: get-parent-ast [sel/sw/parseable] obj ast

Return the parent node of AST in obj

Generic Function: get-parent-asts* [sel/sw/parseable] obj ast

Return the parent nodes of AST in obj not including AST.

Generic Function: get-parent-full-stmt [sel/sw/parseable] software ast

Return the first ancestor of AST in software which is a full statement. Returns nil if no full statement parent is found.

Method: get-parent-full-stmt [sel/sw/parseable] (clang clang) (ast clang-ast)

Return the first ancestor of AST in software which is a full stmt. Returns nil if no full-stmt is found.

Generic Function: get-unbound-funs [sel/sw/parseable] software ast

Functions used (but not defined) within the AST.

Method: get-unbound-funs [sel/sw/parseable] (obj javascript) (ast javascript-ast) &aux (children (remove nil (children ast))) (callee (first children))

Return all functions used (but not defined) within AST.

Method: get-unbound-funs [sel/sw/parseable] (obj python) (ast python-ast) &aux (children (remove nil (children ast)))

Return all functions used (but not defined) within AST. The returned value will be of the form (list FUNCTION-ATTRS) where function-attrs is a list of form (function-name unused unused num-params).

Method: get-unbound-funs [sel/sw/parseable] (software clang) (ast clang-ast)

Compute all the unbound funs in AST. ast-unbound-funs is the unbound funs at a node; this function closes over all the nodes in the AST. software is the software object to which AST belongs.

Generic Function: get-unbound-vals [sel/sw/parseable] software ast

Variables used (but not defined) within the AST.

Method: get-unbound-vals [sel/sw/parseable] (obj javascript) (ast javascript-ast)

Return all variables used (but not defined) within AST.

Method: get-unbound-vals [sel/sw/parseable] (obj python) (ast python-ast)

Return all variables used (but not defined) within AST.

Method: get-unbound-vals [sel/sw/parseable] (software clang) (ast clang-ast)

docfixme

Generic Function: get-vars-in-scope [sel/sw/parseable] software ast &optional keep-globals

Return all variables in enclosing scopes.

Method: get-vars-in-scope [sel/sw/parseable] (obj parseable) (ast ast) &optional (keep-globals t)

Return all variables in enclosing scopes.

Method: around get-vars-in-scope [sel/sw/parseable] (obj clang) (ast clang-ast) &optional (keep-globals t)

Return all variables in enclosing scopes.

Generic Function: good-mutation-targets [sel/sw/parseable] software &key filter

Return a list of all good mutation targets in software matching filter.

Method: good-mutation-targets [sel/sw/parseable] (obj parseable) &key filter

Return a list of all good mutation targets in obj matching filter.

Method: good-mutation-targets [sel/sw/parseable] (clang clang) &key filter

Return a list of all good statement ASTs in clang matching filter.

Generic Function: indentablep [sel/sw/parseable] ast

Return t if AST is indentable. This is useful for ASTs that may have newline literals.

Generic Function: is-stmt-p [sel/sw/parseable] ast

Returns t if the AST is a full statement, nil otherwise.

Generic Function: parent-ast-p [sel/sw/parseable] software possible-parent-ast ast

Return true if possible-parent-ast is a parent of AST in obj, nil otherwise.

Generic Function: parse-asts [sel/sw/parseable] software &optional source-text

Parse genome of software into an AST representation. There are some requirements for the ASTs constructed by this method:

Other methods in on parseable objects, specifically ‘ast-can-recurse’ and ‘equal?' depend on these invariants.

Optional argument source-text holds the source code string to parse into ASTs. If not supplied it is generally assumed to already be set in the software’s genome.

Class: parseable [sel/sw/parseable]

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

Slots:

Parsed AST tree software representation.

Class: parseable-cut [sel/sw/parseable]

Class precedence list: parseable-cut, parseable-mutation, mutation, oid-object, standard-object, slot-object, t

Slots:

Perform a cut operation on a parseable software object.

Class: parseable-move [sel/sw/parseable]

Class precedence list: parseable-move, parseable-mutation, mutation, oid-object, standard-object, slot-object, t

Slots:

Perform a move operation on a parseable software object.

Class: parseable-mutation [sel/sw/parseable]

Class precedence list: parseable-mutation, mutation, oid-object, standard-object, slot-object, t

Specialization of the mutation interface for parseable software objects.

Class: parseable-nop [sel/sw/parseable]

Class precedence list: parseable-nop, parseable-mutation, mutation, oid-object, standard-object, slot-object, t

Slots:

Perform a nop on a parseable software object.

Class: parseable-swap [sel/sw/parseable]

Class precedence list: parseable-swap, parseable-mutation, mutation, oid-object, standard-object, slot-object, t

Slots:

Perform a swap operation on a parseable software object.

Variable: *spaces-per-tab* [sel/sw/parseable]

The number of spaces per tab. This can be set to modify the behavior of #’source-text and #’convert

Generic Function: assign-to-var-p [sel/sw/parseable] ast var

Return true if AST represents an assignment to var.

Class: ast [sel/sw/parseable]

Class precedence list: ast, standard-object, slot-object, t

Base class for all ASTs in sel. This class acts as a tag for objects to allow method dispatch on generic AST objects regardless of whether they inherit from the functional trees library.

Function: ast-end [sel/sw/parseable] software ast

Return the end of AST in software, as a source location.

Function: ast-start [sel/sw/parseable] software ast

Return the start of AST in software, as a source location.

Function: combine-conflict-asts-in-list [sel/sw/parseable] child-list

Combine a list of conflict-asts and other things into the components of a single conflict-ast

Generic Function: good-asts [sel/sw/parseable] software

Return a list of all good asts in software.

Method: good-asts [sel/sw/parseable] (obj parseable)

Return a list of all good asts in obj

Generic Function: rebind-vars [sel/sw/parseable] ast var-replacements fun-replacements

Replace variable and function references, returning a new AST.

Method: rebind-vars [sel/sw/parseable] (ast tree-sitter-ast) var-replacements fun-replacements

Replace variable and function references, returning a new AST.

the rebinding

Generic Function: recontextualize [sel/sw/parseable] parseable ast pt

Perform any modifications to AST (e.g. variable rebinding) to allow for successful mutation of software at pt.

Method: recontextualize [sel/sw/parseable] (software parseable) ast pt

Perform any modifications to AST (e.g. variable rebinding) to allow for successful mutation of software at pt.

Method: recontextualize [sel/sw/parseable] (clang clang) (ast clang-ast) (pt clang-ast)

Bind free variables and function in AST to concrete values required for successful mutation in clang at pt

Generic Function: roots [sel/sw/parseable] obj

Return all top-level ASTs in obj.

Method: roots [sel/sw/parseable] (obj parseable)

Return all top-level ASTs in obj. * obj software object to search for roots

Generic Function: scopes [sel/sw/parseable] software ast

Return lists of variables in each enclosing scope. Each variable is represented by an alist containing :name, :decl, :type, and :scope.

Scopes are returned innermost-first.

Method: scopes [sel/sw/parseable] (obj python) (target-ast python-ast) &aux (enclosing-scope (enclosing-scope obj target-ast))

Return lists of variables in each enclosing scope of AST. Each variable is represented by an alist containing :name, :decl, and :scope. obj python software object AST ast to return the scopes for

Method: scopes [sel/sw/parseable] (software clang) (ast clang-ast)

docfixme

Generic Function: select-crossover-points [sel/sw/parseable] a b

Select suitable crossover point in A and b. The point is represented as a path which refers to a node in both software objects. If no suitable point is found the returned point may be nil.

Method: select-crossover-points [sel/sw/parseable] (a clang) (b clang)

docfixme

Generic Function: shares-path-of-p [sel/sw/parseable] obj target-ast shared-path-ast

Returns t if target-ast has the same path or a super-path of SHARED-PATH-AST’s path in obj.

Generic Function: sorted-children [sel/sw/parseable] ast

Return the children of AST sorted in textual order.

Generic Function: source-text [sel/sw/parseable] ast &key stream parents indent-p indentation-ast trim &allow-other-keys

Return the source code corresponding to an AST, optionally writing to stream.

Class: stored-hash [sel/sw/parseable]

Class precedence list: stored-hash, standard-object, slot-object, t

Slots:

Mixin for stored-hash slot

Variable: *parseable-mutation-types* [sel/sw/parseable]

Cumulative distribution of normalized probabilities of weighted mutations.

Generic Function: ast-at-index [sel/sw/parseable] software index

Deprecated: Return the AST in obj at index. If possible, only use when dealing with legacy code.

Generic Function: ast-hash [sel/sw/parseable] ast

A hash value for the AST, which is a nonnegative integer. It should be the case that (equal? x y) implies (eql (ast-hash x) (ast-hash y)), and that if (not (equal? x y)) then the equality of the hashes is unlikely.

Generic Function: asts-intersecting-source-range [sel/sw/parseable] software range

Return a list of ASTs in obj intersecting range.

Generic Function: built-ins [sel/sw/parseable] software

Return a list of built-in identifiers available in software.

Generic Function: child-asts [sel/sw/parseable] ast &key recursive

Return the AST children of AST. If the keyword recursive is passed, recursive AST children will also be returned.

Generic Function: collect-if [sel/sw/parseable] predicate tree

Traverse tree collecting every node that satisfies predicate.

Generic Function: combine-conflict-asts [sel/sw/parseable] ca1 ca2

Merge conflict ast nodes CA1 and CA2, their alists and default values.

Generic Function: find-if-in-scope [sel/sw/parseable] predicate obj ast &key reference-ast

Walk up the genome in obj starting at AST, searching for an AST that satisfies predicate that occurs before reference-ast.

Generic Function: get-indentation-at [sel/sw/parseable] ast parents

Get the indentation for AST given parents.

Method: get-indentation-at [sel/sw/parseable] (ast inner-whitespace) (parents list) &aux (parent (car parents))

Get the indentation at AST when it is an inner-whitespace AST. This is handled differently than other ASTs because it should be considered part of the parent.

Generic Function: get-parent-asts [sel/sw/parseable] obj ast

Return the parent nodes of AST in obj including AST.

Generic Function: index-of-ast [sel/sw/parseable] software ast

Deprecated: Return the index of AST in obj. If possible, only use when dealing with legacy code.

Generic Function: interleaved-text [sel/sw/parseable] obj

Get the interleaved text for obj.

Generic Function: map-arguments-to-parameters [sel/sw/parseable] obj funcall-ast

Return an alist mapping parameters of a function in obj to its arguments in funcall-ast.

Method: map-arguments-to-parameters [sel/sw/parseable] (obj lisp) (funcall-ast lisp-ast)

Map the arguments of funcall-ast to its relevant function call in obj. The mapping will be from argument ast to parameter ast in an alist.

Class: parseable-insert [sel/sw/parseable]

Class precedence list: parseable-insert, parseable-mutation, mutation, oid-object, standard-object, slot-object, t

Slots:

Perform an insertion operation on a parseable software object.

Class: parseable-replace [sel/sw/parseable]

Class precedence list: parseable-replace, parseable-mutation, mutation, oid-object, standard-object, slot-object, t

Slots:

Perform a replace operation on a parseable software object.

Function: pick-general [sel/sw/parseable] software first-pool &key second-pool filter

Pick ASTs from first-pool and optionally second-pool. first-pool and second-pool are methods on software which return a list of ASTs. An optional filter function having the signature ’f ast &optional first-pick’, may be passed, returning true if the given AST should be included as a possible pick or false (nil) otherwise.

Generic Function: prepend-text-to-genome [sel/sw/parseable] software text

Prepend non-AST text to obj genome.

Generic Function: recontextualize-mutation [sel/sw/parseable] parseable mutation

Bind free variables and functions in the mutation to concrete values. Additionally perform any updates to the software object required for successful mutation.

Method: recontextualize-mutation [sel/sw/parseable] (software parseable) (ops list)

Bind free variables and functions in the mutation to concrete values. Additionally perform any updates to the software object required for successful mutation (e.g. adding includes/types/macros), returning the mutation operations to be performed as an association list.

Method: recontextualize-mutation [sel/sw/parseable] (software parseable) (mutation mutation)

Bind free variables and functions in the mutation to concrete values. Additionally perform any updates to the software object required for successful mutation (e.g. adding includes/types/macros), returning the mutation operations to be performed as an association list.

Method: around recontextualize-mutation [sel/sw/parseable] (obj clang-w-fodder) mutation

Wrapper around ‘recontextualize-mutation’ to allow for parsing and rebinding of variables and functions in fodder snippets prior to fodder mutations.

Generic Function: to-alist [sel/sw/parseable] struct

Convert struct to alist representation.


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