psychec / README.md
ejschwartz's picture
PsycheC
e491165
metadata
title: PsycheC Type Inference
emoji: πŸ”
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false
license: lgpl-2.1

PsycheC Type Inference

This Space provides a web interface to PsycheC, a compiler frontend for the C programming language that can infer missing type declarations.

What it does

PsycheC analyzes C source code and:

  • Infers types for undeclared identifiers
  • Generates a header file (_gen.h) with the inferred type declarations
  • Produces a fixed C file (_fixed.c) that includes the generated header

Usage

  1. Paste your C code in the input text area
  2. Click "Run Type Inference"
  3. View the generated header and fixed C code in the output tabs

Example

Input:

int main() {
    x = 10;
    y = foo(x);
    return y;
}

The tool will infer the types of x, y, and foo and generate appropriate declarations.

Credits

Based on psychec-typeinference-docker, a Docker image wrapper for the PsycheC type inference functionality.