Skip to content

Gnimuc/ClangCompiler.jl

Repository files navigation

ClangCompiler

CI TagBot codecov

ClangCompiler.jl provides a Julia interface to the Clang C++ API, and can be used for tasks such as declaration lookup, parsing, code analysis, etc.

Installation

pkg> add ClangCompiler

Examples

Decl Lookup

The following example demonstrates how to perform a declaration lookup:

import ClangCompiler as CC

# Create an interpreter
I = CC.create_interpreter(["-include", "vector"])

# Initialize a declaration lookup instance
decl_lookup = CC.DeclFinder(I)

# Perform a lookup for the declaration of std::vector
@assert decl_lookup(I, "std::vector")

# Retrieve lookup results and dump AST
decl = CC.get_decl(decl_lookup)
CC.dump(decl)

# Clean up resources
CC.dispose(decl_lookup)
CC.dispose(I)

About

Clang compiler infrastructure for Julia

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •