CodeQL library for Ruby
codeql/ruby-all 0.8.15-dev (changelog, source)
Search

Module printAst

Provides queries to pretty-print a Ruby abstract syntax tree as a graph.

By default, this will print the AST for all nodes in the database. To change this behavior, extend PrintASTConfiguration and override shouldPrintNode to hold for only the AST nodes you wish to view.

Import path

import codeql.ruby.printAst

Predicates

edges

Holds if target is a child of source in the AST, and property key of the edge has the given value.

graphProperties

Holds if property key of the graph has the given value.

nodes

Holds if node belongs to the output tree, and its property key has the given value.

Classes

PrintAstConfiguration

The query can extend this class to control which nodes are printed.

PrintAstNode

A node in the output tree.

PrintRegExpNode

A parsed regexp node in the output tree.

PrintRegularAstNode

An AstNode in the output tree.

Datatypes