wijnen/pypp
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
This is a python-style preprocessor for C and C++. It should be run to produce
a C or C++ source file, which can then be compiled with gcc/g++.
A simple source file looks like this:
# pypp 0
/* The previous line must be the first one in the file. It specifies the
* required version of pypp to use for processing it. */
#include <stdio.h>
struct foo:
int a
char *text
enum direction:
north
east
south
west
int main (int argc, char **argv):
if argc < 2:
printf ("hello, world.\n")
return 0
else:
for i = 1; i < argc; ++i:
printf ("argument %d is %s.\n", i, argv[i])
return argc
The indentation specifies that something is a block. Only one statement per
line is allowed. No semicolons are needed (or allowed), except in the argument
of a for instruction.
MISSING FEATURES
****************
- calling a function python-style should be possible
- nested functions
- change else so it needs nobreak instead of break
- break num/continue num
- debugging features (startfunc, endfunc) would be nice