v1.0 Python 3.8+ MIT License

C-Lite
Interpreter

A tree-walking interpreter for a pedagogical subset of C. Built from scratch in Python with zero external runtime dependencies.

hello.clt
// Declare variables
int x;
float pi;

// Assign values
x = 42;
pi = 3.14159;

// Control flow
if (x > 10) {
    printf(x);
} else {
    printf(0);
}

Try C-Lite Now

Write and execute C-Lite code directly in your browser.

C-Lite REPL
C-Lite Interpreter v1.0 (JavaScript Simulation)
Type :help for available commands
 
>>>

Quick Reference

Output

printf(x);
printf("hello");

Try These Examples

Built for Learning

Every design decision documented. Every component transparent.

Zero Dependencies

Only Python 3.8+ standard library.

LL(1) Parser

Recursive-descent parsing with formal EBNF grammar.

Interactive REPL

Multi-line input, state inspection, and error recovery.

Three-Phase Pipeline

1

Lexer

2

Parser

3

Interpreter

Language Reference

A simplified, statically-typed subset of C

Supported Types

TypeDescriptionExamples
intSigned integer0, 42
floatIEEE 754 double-precision3.14, .5

Declaration

int x;      // declaration
x = 42;     // assignment