What Sampling Outside a Texture Taught Me About SPIR-V
Vulkan sampler border colors hide a surprising number of pitfalls. Here's how I used SPIR-V shader reflection to avoid them entirely.
Vulkan sampler border colors hide a surprising number of pitfalls. Here's how I used SPIR-V shader reflection to avoid them entirely.
One of the most important features of a language are its keywords. This post provides a brief overview of the libclang C API and explores two different methods for annotating language keywords.
Annotating preprocessor directives requires hooking into Clang's preprocessing stage before the AST is generated. This post explains how to annotate common directives like `#define`, `#include`, and conditional blocks before they're stripped out of the AST.
Similar to type names, qualifiers on functions and types (such as namespaces and other class names) are annotated as plain tokens in browser-based syntax highlighters. This post introduces a technique to traverse the qualifier chain of an AST node and addresses the challenges of adding annotations for each qualifier.
Earlier posts in this series focused only on the declarations of types. References to types, such as in variable declarations, function parameters, and return statements, often appear as plain text in browser-based syntax highlighters. This post implements a dedicated visitor to annotate these type references, ensuring every type name is styled consistently.
Templates are ubiquitous in modern C++ code and pose unique challenges for implementing accurate syntax highlighting. This post dives into the intricacies of visiting and annotating template functions, classes, and C++20 concepts.
Classes in C++ are comprised of many elements: constructors, destructors, class methods, member variables (both static and instance), and (optionally) nested types. This post shows how to implement visitors that traverse and annotate each component of a complex class definition.
C++ function come in many forms, each requiring a different approach for proper syntax highlighting. This post covers the implementation of visitors for annotating function declarations, calls, and several kinds of operators, including operator overloads and user-defined literals.
This post builds on the previous post by adding new AST visitors for namespace declarations, aliases, and `using namespace` directives.
Enum definitions and constants can be hard to distinguish in complex C++ code, often going completely overlooked in browser syntax highlighting. This post introduces the basic structure of a visitor for the Clang AST and implements several visitors for annotating enums and their values.
Ever wondered why modern syntax highlighting for browsers struggles with C++? This post introduces a new method for context-aware syntax highlighting for browsers by leveraging Clang's LibTooling API and AST to inject semantic hints into C++ code snippets.
No posts found.