Next: SOFTWARE-EVOLUTION-LIBRARY/SOFTWARE/C, Previous: SOFTWARE-EVOLUTION-LIBRARY/SOFTWARE/SUPER-MUTANT-PROJECT, Up: Software Evolution Library Index [Contents][Index]
Class precedence list: arguments-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are lists of arguments.
Compile-time validity checking for AST templates.
Return t
if AST is of a type where its variables/functions
should be rebound.
Class precedence list: bash, bash-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, standard-object, slot-object, t
bash
tree-sitter software representation.
Class precedence list: binary-ast, expression-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are binary expressions.
Class precedence list: boolean-ast, literal-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are booleans.
Class precedence list: boolean-false-ast, boolean-ast, literal-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are false booleans.
Class precedence list: boolean-true-ast, boolean-ast, literal-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are true booleans.
Class precedence list: c, tree-sitter, software-indentation, parseable, compilable, normal-scope, c-slash-cpp, include-paths-mixin, software, oid-object, file, standard-object, slot-object, t
C tree-sitter software representation.
Class precedence list: c-source-text-fragment, c-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, source-text-fragment, standard-object, slot-object, t
Generated for source text fragments.
Class precedence list: c-slash-cpp, include-paths-mixin, software, oid-object, standard-object, slot-object, t
Mix-in class for tree-sitter c and cpp classes
Class precedence list: c-slash-cpp-exclamationpoint, ast, standard-object, slot-object, t
Mix-in for c/cpp !
AST classes.
Class precedence list: c-slash-cpp-exclamationpoint-equals, ast, standard-object, slot-object, t
Mix-in for c/cpp !=
AST classes.
Class precedence list: c-slash-cpp-%, ast, standard-object, slot-object, t
Mix-in for c/cpp % AST classes.
Class precedence list: c-slash-cpp-ampersand, ast, standard-object, slot-object, t
Mix-in for c/cpp &
AST classes.
Class precedence list: c-slash-cpp-ampersand-ampersand, ast, standard-object, slot-object, t
Mix-in for c/cpp &&
AST classes.
Class precedence list: c-slash-cpp-star, ast, standard-object, slot-object, t
Mix-in for c/cpp * AST classes.
Class precedence list: c-slash-cpp-plus, ast, standard-object, slot-object, t
Mix-in for c/cpp +
AST classes.
Class precedence list: c-slash-cpp-plus-plus, ast, standard-object, slot-object, t
Mix-in for c/cpp ++
AST classes.
Class precedence list: c-slash-cpp-_-, ast, standard-object, slot-object, t
Mix-in for c/cpp AST classes.
Class precedence list: c-slash-cpp-_-_-, ast, standard-object, slot-object, t
Mix-in for c/cpp AST classes.
Class precedence list: c-slash-cpp-slash, ast, standard-object, slot-object, t
Mix-in for c/cpp /
AST classes.
Class precedence list: c-slash-cpp-lt, ast, standard-object, slot-object, t
Mix-in for c/cpp <
AST classes.
Class precedence list: c-slash-cpp-lt-lt, ast, standard-object, slot-object, t
Mix-in for c/cpp <<
AST classes.
Class precedence list: c-slash-cpp-lt-equals, ast, standard-object, slot-object, t
Mix-in for c/cpp <=
AST classes.
Class precedence list: c-slash-cpp-equals-equals, ast, standard-object, slot-object, t
Mix-in for c/cpp ==
AST classes.
Class precedence list: c-slash-cpp-gt, ast, standard-object, slot-object, t
Mix-in for c/cpp >
AST classes.
Class precedence list: c-slash-cpp-gt-equals, ast, standard-object, slot-object, t
Mix-in for c/cpp >=
AST classes.
Class precedence list: c-slash-cpp-gt-gt, ast, standard-object, slot-object, t
Mix-in for c/cpp >>
AST classes.
Class precedence list: c-slash-cpp-array-declarator, ast, standard-object, slot-object, t
Mix-in for c/cpp array declarator AST classes.
Class precedence list: c-slash-cpp-binary-expression, ast, standard-object, slot-object, t
Mix-in for c/cpp binary expression AST classes.
Class precedence list: c-slash-cpp-break-statement, ast, standard-object, slot-object, t
Mix-in for c/cpp break statement AST classes.
Class precedence list: c-slash-cpp-call-expression, ast, standard-object, slot-object, t
Mix-in for c/cpp call expression AST classes.
Class precedence list: c-slash-cpp-case-statement, ast, standard-object, slot-object, t
Mix-in for c/cpp case statement AST classes.
Class precedence list: c-slash-cpp-char-literal, ast, standard-object, slot-object, t
Mix-in for c/cpp char literal AST classes.
Class precedence list: c-slash-cpp-comment, ast, standard-object, slot-object, t
Mix-in for c/cpp comment AST classes.
Class precedence list: c-slash-cpp-compound-statement, ast, standard-object, slot-object, t
Mix-in for c/cpp compound statement AST classes.
Class precedence list: c-slash-cpp-condition-clause, ast, standard-object, slot-object, t
Mix-in for c/cpp condition clause AST classes.
Class precedence list: c-slash-cpp-continue-statement, ast, standard-object, slot-object, t
Mix-in for c/cpp continue statement AST classes.
Class precedence list: c-slash-cpp-declaration, ast, standard-object, slot-object, t
Mix-in for c/cpp declaration AST classes.
Class precedence list: c-slash-cpp-declarator, ast, standard-object, slot-object, t
Mix-in for c/cpp declarator AST classes.
Class precedence list: c-slash-cpp-do-statement, ast, standard-object, slot-object, t
Mix-in for c/cpp do statement AST classes.
Class precedence list: c-slash-cpp-enum-specifier, ast, standard-object, slot-object, t
Mix-in for c/cpp enum specifier AST classes.
Class precedence list: c-slash-cpp-enumerator, ast, standard-object, slot-object, t
Mix-in for c/cpp enumerator AST classes.
Class precedence list: c-slash-cpp-error, ast, standard-object, slot-object, t
Mix-in for c/cpp error AST classes.
Class precedence list: c-slash-cpp-expression-statement, ast, standard-object, slot-object, t
Mix-in for c/cpp expression statement AST classes.
Class precedence list: c-slash-cpp-field-declaration, ast, standard-object, slot-object, t
Mix-in for c/cpp field declaration AST classes.
Class precedence list: c-slash-cpp-function-declarator, ast, standard-object, slot-object, t
Mix-in for c/cpp function declarator AST classes.
Class precedence list: c-slash-cpp-function-definition, ast, standard-object, slot-object, t
Mix-in for c/cpp function definition AST classes.
Class precedence list: c-slash-cpp-identifier, ast, standard-object, slot-object, t
Mix-in for c/cpp identifier AST classes.
Class precedence list: c-slash-cpp-if-statement, ast, standard-object, slot-object, t
Mix-in for c/cpp if statement AST classes.
Class precedence list: c-slash-cpp-number-literal, ast, standard-object, slot-object, t
Mix-in for c/cpp number literal AST classes.
Class precedence list: c-slash-cpp-parameter-declaration, ast, standard-object, slot-object, t
Mix-in for c/cpp parameter declaration AST classes.
Class precedence list: c-slash-cpp-parenthesized-declarator, ast, standard-object, slot-object, t
Mix-in for c/cpp parenthesized declarator AST classes.
Class precedence list: c-slash-cpp-pointer-declarator, ast, standard-object, slot-object, t
Mix-in for c/cpp pointer declarator AST classes.
Class precedence list: c-slash-cpp-preproc-arg, ast, standard-object, slot-object, t
Mix-in for c/cpp preproc arg AST classes.
Class precedence list: c-slash-cpp-preproc-def, ast, standard-object, slot-object, t
Mix-in for c/cpp preproc def AST classes.
Class precedence list: c-slash-cpp-preproc-function-def, ast, standard-object, slot-object, t
Mix-in for c/cpp preproc function def AST classes.
Class precedence list: c-slash-cpp-preproc-include, ast, standard-object, slot-object, t
Mix-in for c/cpp preproc include AST classes.
Class precedence list: c-slash-cpp-preproc-params, ast, standard-object, slot-object, t
Mix-in for c/cpp preproc params AST classes.
Class precedence list: c-slash-cpp-primitive-type, ast, standard-object, slot-object, t
Mix-in for c/cpp primitive type AST classes.
Class precedence list: c-slash-cpp-return-statement, ast, standard-object, slot-object, t
Mix-in for c/cpp return statement AST classes.
Class precedence list: c-slash-cpp-string-literal, ast, standard-object, slot-object, t
Mix-in for c/cpp string literal AST classes.
Class precedence list: c-slash-cpp-struct-specifier, ast, standard-object, slot-object, t
Mix-in for c/cpp struct specifier AST classes.
Class precedence list: c-slash-cpp-switch-statement, ast, standard-object, slot-object, t
Mix-in for c/cpp switch statement AST classes.
Class precedence list: c-slash-cpp-type-definition, ast, standard-object, slot-object, t
Mix-in for c/cpp type definition AST classes.
Class precedence list: c-slash-cpp-type-identifier, ast, standard-object, slot-object, t
Mix-in for c/cpp type identifier AST classes.
Class precedence list: c-slash-cpp-union-specifier, ast, standard-object, slot-object, t
Mix-in for c/cpp union specifier AST classes.
Class precedence list: c-slash-cpp-while-statement, ast, standard-object, slot-object, t
Mix-in for c/cpp while statement AST classes.
Class precedence list: c-slash-cpp-^, ast, standard-object, slot-object, t
Mix-in for c/cpp ^ AST classes.
Class precedence list: c-slash-cpp-pipe, ast, standard-object, slot-object, t
Mix-in for c/cpp | AST classes.
Class precedence list: c-slash-cpp-pipe-pipe, ast, standard-object, slot-object, t
Mix-in for c/cpp || AST classes.
Class precedence list: c-slash-cpp-~, ast, standard-object, slot-object, t
Mix-in for c/cpp ~ AST classes.
Class precedence list: call-ast, expression-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are calls.
Return the name of call-ast
.
Class precedence list: catch-ast, statement-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are error catch clauses.
Class precedence list: char-ast, literal-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are literal chars.
Class precedence list: class-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are classes.
Class precedence list: comment-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are comments.
Superclass of every generated LANGUAGE-comment class.
Return the comments for AST in software
.
Is AST a comparison?
Class precedence list: compound-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are compounds.
Class precedence list: conditional-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that have a conditional.
Class precedence list: control-flow-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that have control flow.
Return the condition from a control-flow-ast
.
Class precedence list: cpp, tree-sitter, software-indentation, parseable, compilable, normal-scope, c-slash-cpp, include-paths-mixin, software, oid-object, file, standard-object, slot-object, t
cpp
tree-sitter software representation.
Class precedence list: cpp-source-text-fragment, cpp-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, source-text-fragment, standard-object, slot-object, t
Generated for source text fragments.
Returns a string that is the name of a things
declared in a declarator, or in the first element of a list of declarators.
Return nil
on the empty list.
Class precedence list: definition-ast, ast, standard-object, slot-object, t
AST for something that associates a name with a thing.
The name string is obtained by by definition-name
Class precedence list: ecma, software, oid-object, standard-object, slot-object, t
Mix-in class for tree-sitter ECMAScript variants.
Class precedence list: ecma-comment, ast, standard-object, slot-object, t
Mix-in for ecma comment AST classes.
Class precedence list: ecma-error, ast, standard-object, slot-object, t
Mix-in for ecma error AST classes.
Find the enclosing definition AST in which AST resides,
or nil
if none.
Find the end position of the parameters of function-node
.
Class precedence list: expression-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are expressions.
Return any siblings of type
following AST in software
.
Return any siblings of type
preceding AST in software
.
Class precedence list: float-ast, number-ast, literal-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are literal floats.
Class precedence list: function-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are functions.
Return the body of AST.
Extract the name of the function from node
.
If node
is not a function node, return nil.
Get the variables that are bound by AST.
Class precedence list: golang, tree-sitter, software-indentation, parseable, software, oid-object, file, standard-object, slot-object, t
golang
tree-sitter software representation.
Class precedence list: goto-ast, statement-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are goto statements.
Class precedence list: identifier-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are identifiers.
Class precedence list: if-ast, control-flow-ast, conditional-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are ifs.
Return a list of the imports of AST. Every element in the list has the following form: (full-name alias/nickname . named-imports)
Class precedence list: integer-ast, number-ast, literal-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are literal integers.
Class precedence list: java, tree-sitter, software-indentation, parseable, software, oid-object, file, standard-object, slot-object, t
java
tree-sitter software representation.
Class precedence list: javascript, tree-sitter, software-indentation, parseable, normal-scope, ecma, software, oid-object, file, standard-object, slot-object, t
javascript
tree-sitter software representation.
Class precedence list: json, tree-sitter, software-indentation, parseable, software, oid-object, file, standard-object, slot-object, t
JSON tree-sitter software representation.
Class precedence list: json-doublequote, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, terminal-symbol, standard-object, slot-object, t
Generated for terminal symbol ’"’
Class precedence list: json-,, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, terminal-symbol, standard-object, slot-object, t
Generated for terminal symbol '
,'
Class precedence list: json-_-value, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, standard-object, slot-object, t
Generated for _value.
Class precedence list: json-:, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, terminal-symbol, standard-object, slot-object, t
Generated for terminal symbol ':'
Class precedence list: json-array, json-_-value, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, standard-object, slot-object, t
Slots:
json-rule
— reader: software-evolution-library/software/tree-sitter::json-rule
A rule used to determine where inner ASTs are assigned.
slot-usage
— reader: software-evolution-library/software/tree-sitter::slot-usage
; writer: (setf software-evolution-library/software/tree-sitter::slot-usage)
A set of slots that are used in the pruned-rule.
pruned-rule
— reader: software-evolution-library/software/tree-sitter::pruned-rule
; writer: (setf software-evolution-library/software/tree-sitter::pruned-rule)
A rule used to order the children of this class.
Generated for array.
Class precedence list: json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, standard-object, slot-object, t
Slots:
children
— initargs: :direct-children
, :children
; readers: software-evolution-library/software/tree-sitter:direct-children
, software-evolution-library/software/tree-sitter:json-children
; writers: (setf software-evolution-library/software/tree-sitter:direct-children)
, (setf software-evolution-library/software/tree-sitter:json-children)
Returns all language-specific children. Unlike the ‘children‘ methods which collects all children of an AST from any slot.
AST for JSON from input via tree-sitter.
Class precedence list: json-comment, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, comment-ast, ast, stored-hash, standard-object, slot-object, t
Generated for parsed comments.
Class precedence list: json-document, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, standard-object, slot-object, t
Slots:
json-rule
— reader: software-evolution-library/software/tree-sitter::json-rule
A rule used to determine where inner ASTs are assigned.
slot-usage
— reader: software-evolution-library/software/tree-sitter::slot-usage
; writer: (setf software-evolution-library/software/tree-sitter::slot-usage)
A set of slots that are used in the pruned-rule.
pruned-rule
— reader: software-evolution-library/software/tree-sitter::pruned-rule
; writer: (setf software-evolution-library/software/tree-sitter::pruned-rule)
A rule used to order the children of this class.
Generated for document.
Class precedence list: json-error, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, parse-error-ast, ast, stored-hash, standard-object, slot-object, t
Generated for parsing errors.
Class precedence list: json-escape-sequence, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, standard-object, slot-object, t
Generated for escape_sequence.
Class precedence list: json-false, json-_-value, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, standard-object, slot-object, t
Generated for false.
Class precedence list: json-inner-whitespace, json-ast, inner-whitespace, text-fragment, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, standard-object, slot-object, t
Generated for inner whitespace.
Class precedence list: json-mutation, parseable-mutation, mutation, oid-object, standard-object, slot-object, t
Slots:
targeter
— initarg: :targeter
; reader: software-evolution-library/software-evolution-library:targeter
A function from software ->
targets.
picker
— initarg: :picker
; reader: software-evolution-library/software-evolution-library:picker
A function from software ->
random target.
Mutation interface for JSON software objects.
Class precedence list: json-number, json-_-value, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, standard-object, slot-object, t
Generated for number.
Class precedence list: json-object, json-_-value, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, standard-object, slot-object, t
Slots:
json-rule
— reader: software-evolution-library/software/tree-sitter::json-rule
A rule used to determine where inner ASTs are assigned.
slot-usage
— reader: software-evolution-library/software/tree-sitter::slot-usage
; writer: (setf software-evolution-library/software/tree-sitter::slot-usage)
A set of slots that are used in the pruned-rule.
pruned-rule
— reader: software-evolution-library/software/tree-sitter::pruned-rule
; writer: (setf software-evolution-library/software/tree-sitter::pruned-rule)
A rule used to order the children of this class.
Generated for object.
Class precedence list: json-pair, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, standard-object, slot-object, t
Slots:
json-rule
— reader: software-evolution-library/software/tree-sitter::json-rule
A rule used to determine where inner ASTs are assigned.
slot-usage
— reader: software-evolution-library/software/tree-sitter::slot-usage
; writer: (setf software-evolution-library/software/tree-sitter::slot-usage)
A set of slots that are used in the pruned-rule.
pruned-rule
— reader: software-evolution-library/software/tree-sitter::pruned-rule
; writer: (setf software-evolution-library/software/tree-sitter::pruned-rule)
A rule used to order the children of this class.
Generated for pair.
Class precedence list: json-source-text-fragment, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, source-text-fragment, standard-object, slot-object, t
Generated for source text fragments.
Class precedence list: json-string, json-_-value, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, standard-object, slot-object, t
Generated for string.
Class precedence list: json-string-content, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, standard-object, slot-object, t
Generated for string_content.
Class precedence list: json-true, json-_-value, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, standard-object, slot-object, t
Generated for true.
Class precedence list: json-square-brace-left, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, terminal-symbol, standard-object, slot-object, t
Generated for terminal symbol '
['
Class precedence list: json-square-brace-right, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, terminal-symbol, standard-object, slot-object, t
Generated for terminal symbol '
]'
Class precedence list: json-curly-brace-left, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, terminal-symbol, standard-object, slot-object, t
Generated for terminal symbol ’{’
Class precedence list: json-curly-brace-right, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, terminal-symbol, standard-object, slot-object, t
Generated for terminal symbol ’}’
Class precedence list: lambda-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are lambdas.
Class precedence list: literal-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are literals.
Class precedence list: loop-ast, control-flow-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are loops.
Class precedence list: number-ast, literal-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are literal numbers.
Class precedence list: parameters-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are parameter lists.
Class precedence list: parenthesized-expression-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are parenthesized expressions.
Class precedence list: parse-error-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that represent tree-sitter parsing errors.
Superclass of every generated LANGUAGE-error class.
Class precedence list: python, tree-sitter, software-indentation, parseable, software, oid-object, file, standard-object, slot-object, t
python
tree-sitter software representation.
Class precedence list: return-ast, statement-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are return statements.
Class precedence list: string-ast, literal-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are literal strings.
Class precedence list: typescript, ecma, software, oid-object, standard-object, slot-object, t
Mix-in class for tree-sitter TypeScript variants.
Class precedence list: unary-ast, expression-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are unary expressions.
Class precedence list: while-ast, control-flow-ast, conditional-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are whiles.
A list of directories that hold directories of json files defining supported tree-sitter languages. These directories are searched to populate ‘*tree-sitter-language-files*’.
Files defining tree sitter languages.
In one step, build and destructure a template into ASTs.
Must use the positional syntax of ‘ast-template’. Returns one value per metavariable, in numeric order (‘$1’, ‘$2’, etc.).
This is useful because not every kind of AST node can be parsed
directly as a template. e
.g. in Python a tuple, an argument list, and
a parameter list all use the same syntax and can only be distinguished
in context. Or (at the time of writing) the C and C++ parsers for
tree-sitter cannot correctly parse unterminated statements. Using
‘ast-from-template’ lets you provide throwaway context to the parser
while pulling out only the particular nodes that you want.
Return a list of AST classes for language
that inherit from class
.
Create an AST of class
from template
usings args
.
You probably don’t want to use this function directly; supported languages allow you to use a function with the same name as shorthand for creating a template:
(python "$ID = 1" :id "x") ≡ (ast-template "$ID = 1" 'python-ast :id "x") |
By default metavariables look like ‘$X’, where the name can contain only uppercase characters, digits, or underscores. (Syntax can vary by language; see ‘template-metavariable’.)
Metavariables can also look like ‘@ARGS’. In this case they stand for a list of ASTs, rather than a single AST.
(ast-template "fn(@ARGS)" :args '(1 2 3)) => <python-call "fn(1, 2, 3)"> |
There are two syntaxes for args
.
args
can be keyword arguments, defaults for the corresponding
metavariables (converting dashes to underscores):
(ast-template "$LEFT_HAND_SIDE = $RIGHT_HAND_SIDE" 'python-ast :left-hand-side "x" :right-hand-side 1) => <python-assignment "x = 1"> |
args
can be positional (keywords not allowed!). In this case
metavariables must be numbered (‘$1’, ‘$2’, etc.):
(ast-template "$1 = $2" 'python-ast "x" 1) ≡ (ast-template "$1 = $2" 'python-ast :1 "x" :2 1) ;; Also works for list arguments. (ast-template "fn(@1)" '(1 2 3)) => <python-call "fn(1, 2, 3)"> |
Values in args
must be ASTs, literals, or lists. Lists are processed
recursively (but only to one level). Atoms that are not ASTs or
literals are converted into ASTs using ‘template-subtree’, a generic
function. Atoms that are ASTs are copied into the resulting tree.
Atoms that are literals (such as strings or integers) are inlined into
the string and parsed in place. (This is necessary as the AST that
corresponds to a string may only be parseable in context.)
(ast-template "$1 = value" 'python-ast "x") ≡ (ast-template "$1 = value" 'python-ast (convert "x" 'python-ast :deepest t)) |
Both keyword and positional syntaxes (as well as list metavariables with ‘@’) can also be used as Trivia patterns for destructuring.
(match (python "x = 2 + 2") ((python "$1 = $2" var (python "$X + $Y" :x x :y y)) (list x y))) => (#<python-identifier "x"> #<python-integer "2"> #<python-integer "2">) |
Short for (ast-template template
python-ast args
...).
Returns the list of c functions in the C software object. Each returned function is a cons of the form (<function-name> . <ast>) where <function-name> is a string, and <ast> is a c-function-definition.
Return the arguments of AST.
automatically generated reader method
automatically generated reader method
automatically generated reader method
Collect uses of AST in obj
.
Short for (ast-template template
python-ast args
...).
Return a string that is the name of the things
defined by a definition. Return nil
if AST is not a definition.
Return the nearest enclosing AST of type
in software
.
Return the first binding in scopes
that satisfies predicate
.
Return the parameters of AST.
Class precedence list: json-null, json-_-value, json-ast, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, standard-object, slot-object, t
Generated for null.
Get all of the ASTs in AST which are considered to be in the same namespace.
Short for (ast-template template
python-ast args
...).
Return t
if the IDs of NAME1 and NAME2 are the same.
Return the class definition if AST is inside one.
Short for (ast-template template
python-ast args
...).
Short for (ast-template template
python-ast args
...).
Return the left-hand side of an AST.
automatically generated reader method
automatically generated reader method
automatically generated reader method
automatically generated reader method
automatically generated reader method
automatically generated reader method
automatically generated reader method
automatically generated reader method
automatically generated reader method
Return t if AST will never fall through.
Return the operator from an AST as a keyword.
automatically generated reader method
automatically generated reader method
automatically generated reader method
Return the name of parameter-ast
.
Destructively patch whitespace on AST by adding a space to the before-text and after-text slots that need it.
Return the library, package, or system in software
providing AST.
Short for (ast-template template
python-ast args
...).
Return the right-hand side of an AST.
automatically generated reader method
automatically generated reader method
automatically generated reader method
automatically generated reader method
automatically generated reader method
automatically generated reader method
automatically generated reader method
automatically generated reader method
automatically generated reader method
Class precedence list: source-text-fragment, standard-object, slot-object, t
A mixin for ASTs that represent fragments of source text.
Class precedence list: statement-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are statements.
Generate a placeholder for name
.
The user should never see the placeholder; it is simply a string that AST’s language can parse as a valid identifier.
Generic so a different syntax can be used per-language.
Convert thing
into a subtree.
Class precedence list: terminal-symbol, standard-object, slot-object, t
Mix-in for terminal symbols. Note that this won’t fully cover every terminal symbol, only the ones that aren’t named.
Class precedence list: text-fragment, tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, standard-object, slot-object, t
A wrapper class for text fragments in computed text ASTs.
Class precedence list: tree-sitter, software-indentation, parseable, software, oid-object, file, standard-object, slot-object, t
tree-sitter software representation.
Class precedence list: tree-sitter-ast, indentation, structured-text, functional-tree-ast, node, identity-ordering-mixin, ast, stored-hash, standard-object, slot-object, t
AST for input from tree-sitter.
Short for (ast-template template
python-ast args
...).
Return the type of AST in software
.
Class precedence list: variable-declaration-ast, ast, standard-object, slot-object, t
Mix-in for AST classes that are variable declarations.
Short for (ast-template template
python-ast args
...).
Return a representation of the type
of parameter-ast
.
Return format is (base-type pointer-depth . qualifiers)
.
Generate the corresponding valid metavariable for symbol
.
By default this substitutes underscores for dashes and prepends a sigil.
Generic so a different syntax can be used per-language.
Return the name of variable-ast
.
Is node
a wildcard (symbol that starts with WILD_)?