📘

neo-cと、改名

に公開
2025/11/14

オブジェクト指向Cコンパイラをneo-cとしました。とりあえず,生きている間は保守します。
リフレクション機能を入れました。

#include <stdio.h>
#include <stdlib.h>

int fun()
{
    puts("aaa");
}

void fun2()
{
    puts("bbb");
}

static int fun4(int a, char* b)
{
    return 1;
}

static const int gUHO;

struct sData
{
    int a;
    char* b;
};

if(num_param_types(fun4) == 2) {
    if(param_types(fun4, 0) == int) {
        int a = 888;
    }
}
elif (num_fields(sData) == 2) {
    if(field_types(sData, 0) == int) {
        int a = 7;
    }
    else {
        int a = 999;
    }
}
elif (defined(fun2) && defined(fun)) {
    int a = 3;
}
else {
    int a = 2;
}

int main(void) {
    printf("a %d\n", a);
    return 0;
}

https://github.com/ab25cq/neo-c

Discussion