Module pipeline

Module pipeline 

Source
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

  1. Platform Detection - Identify target platform (Linux, FreeBSD, Darwin)
  2. Header Stub Injection - Inject type definitions for known headers
  3. Conditional Evaluation - Strip #if 0 blocks, optionally evaluate simple conditions
  4. GCC Neutralization - Remove/replace GCC extensions
  5. Attribute Stripping - Remove platform-specific attributes

After these stages, the code is ready for tree-sitter parsing.

Structs§

GccNeutralizer
GCC extension neutralizer
MacroNeutralizer
Macro neutralizer for kernel code
MacroStats
Statistics about macro transformations
NeutralizedSource
Result of neutralization
Pipeline
The processing pipeline
PipelineConfig
Configuration for the processing pipeline
PipelineResult
Result of pipeline processing
PipelineStats
Statistics about pipeline processing
Transformation
Record of a transformation

Enums§

ConditionalStrategy
Strategy for handling preprocessor conditionals
TransformKind
Type of transformation applied

Functions§

evaluate_conditionals
Evaluate preprocessor conditionals in source code