File size: 1,084 Bytes
d4c6ce0
e491165
 
 
 
d4c6ce0
 
e491165
d4c6ce0
 
e491165
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
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](https://github.com/ltcmelo/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:
```c
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](https://github.com/edmcman/psychec-typeinference-docker), a Docker image wrapper for the PsycheC type inference functionality.