GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - hohn/codeql-cpp-ast: Illustrations of codeql's AST

BranchesTags
Open more actions menu

Latest commit

 

History

2 Commits
2 Commits

Folders and files

NameName
Last commit message
Last commit date
queries
queries
 
 
src
src
 
 
README.org
README.org
 
 
cpp.code-workspace
cpp.code-workspace
 
 
license.txt
license.txt
 
 

Repository files navigation

AST Sample for C++ Source

Create dot output from query and db, and then get a rendered graph in SVG.

# 
export PATH=$HOME/local/vmsync/codeql250:"$PATH"

# Build db
cd ~/w/codeql-cpp/src/
codeql database create -j8 -v --language=cpp --command="clang example.cpp" -s . example.db

# Edit printast.ql in editor to select function

# Create dot graph 
cd ~/w/codeql-cpp/queries/
codeql database analyze                         \
       ~/w/codeql-cpp/src/example.db/           \
       ~/w/codeql-cpp/queries/printast.ql       \
       -j8 -v --ram=16000                       \
       --format=dot                             \
       --output=printast.dot

# Query produced .dot file
cd ~/w/codeql-cpp/
ls queries/printast.dot/cpp/print-ast.dot

# Query produced .bqrs file
ls src/example.db/results/ast-queries-cpp/printast.bqrs 

# Generate SVG
cd ~/w/codeql-cpp/queries/printast.dot/cpp
dot -Tsvg < ./print-ast.dot > ./print-ast.svg
open -a safari ./print-ast.svg

./queries/printast.dot/cpp/print-ast.svg

About

Illustrations of codeql's AST

Resources

Readme
License
Activity

Stars

12 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.