Expand description
Layered processing pipeline for C source code
This module provides a multi-stage processing pipeline that transforms C source code to make it more parseable by tree-sitter, while preserving semantic information.
§Pipeline Stages
- Platform Detection - Identify target platform (Linux, FreeBSD, Darwin)
- Header Stub Injection - Inject type definitions for known headers
- Conditional Evaluation - Strip
#if 0blocks, optionally evaluate simple conditions - GCC Neutralization - Remove/replace GCC extensions
- Attribute Stripping - Remove platform-specific attributes
After these stages, the code is ready for tree-sitter parsing.
Structs§
- GccNeutralizer
- GCC extension neutralizer
- Macro
Neutralizer - Macro neutralizer for kernel code
- Macro
Stats - Statistics about macro transformations
- Neutralized
Source - Result of neutralization
- Pipeline
- The processing pipeline
- Pipeline
Config - Configuration for the processing pipeline
- Pipeline
Result - Result of pipeline processing
- Pipeline
Stats - Statistics about pipeline processing
- Transformation
- Record of a transformation
Enums§
- Conditional
Strategy - Strategy for handling preprocessor conditionals
- Transform
Kind - Type of transformation applied
Functions§
- evaluate_
conditionals - Evaluate preprocessor conditionals in source code