在Linux上运行holyc源代码
secularize的Python项目详细描述
#holyc for linux
在Linux上运行holyc secularly
[![构建状态](http://ec2-54-162-194-49.compute-1.amazonaws.com/job/holyc for linux/job/master/badge/icon)](http://ec2-54-162-194-49.compute-1.amazonaws.com/job/holyc for linux/job/master/)
[![PYPI版本](https://badge.fury.io/py/secularize.svg)](https://badge.fury.io/py/secularize)
如果你用这个,你会死的。或者更糟的是,您当前的操作系统将被templeos替换。我只在“3.7-dev”上做过这个测试。
*s=3;
u0测试(i16 a,u8 b,f64 c){
print(“hello”);
>print(“nothinhing”);
>print(“s%s%s”,“你好”,“世界”);
i64 b=2.000;
````
>examples/test.c`
``````c ````c
>voidtest(简称a,无符号字符b,双c,双c)
<}
double pest(char d)
{
printf(“无”);
}
int main()
{
double*s=3;
printf(“%s%s”,“hello”,“world”);
long b=2.0;
}
`````
为此,请编写要转换为的c文件,然后运行“secularize dump ast name of file.c”。这将很好地将ast打印到json。
``sh
$cat examples/math.c
int main()
{
long a=3;
>long b=2;
$secularize dump ast examples/math.c
{
{
{{
“ “coord”:null,
“ext”:[
>{
{
{
{
“
nodetype”:“funcdef”,
>
“coord”:“示例/math.c:1:5”,
“decl”:{
“u nodetype”:“decl”、
“name”:“main”、
“quals”:[]、
“storage”:[]、
“funcspec”:[]、
“coord”:“examples/math.c:1:5”、
“type”:{
“u nodetype”:“funcdecl”、
“coord”:“examples/math.c:1:5”、
“type”:{
“节点类型”:“typedecl”、
“declname”:“main”、
“quals”:[]、
“coord”:“示例/math.c:1:5”、
“type”:{
“节点类型”:“identifierType”、
“names”:[
“int”
]、
“coord”:“示例/math.c:1:1”
}
},
“args”:null
},
“init”:null,
“bitsize”:null
},
“body”:{
“u nodetype”:“compound”,
“coord”:“examples/math.c:2:1”,
“block-items”:[
{
“u nodetype”:“decl”,
“name”:“a”,
“quals”:[],
“storage”:[],
“funcspec”:[],
“coord”:“examples/math.c:3:8”,
“type”:{
“u nodetype”:“typedecl”,
“declname”:“a”,
“quals”:[],
“coord”:“examples/math.c:3:8”,
“type”:{
“\u nodeType”:“identifierType”,
“names”:[
“long”
],
“coord”:“examples/math.c:3:3”
}
},
“init”:{
“\u nodeType”:“constant”,
“type”:“int”,
“value”:“3”,
“coord”:“examples/math.c:3:12”
},
“bitsize”:null
},
{
“\u nodetype”:“decl”,
“name”:“b”,
“quals”:[],
“storage”:[],
“funcspec”:[],
“coord”:“示例/数学C:4:8”,
“type”:{
“unodetype”:“typedecl”、
“declname”:“b”、
“quals”:[]、
“coord”:“examples/math.c:4:8”、
“type”:{
“unodetype”:“identifierType”、
“names”:[
“long”
]、
“coord”:“examples/math.c:4:3”
}
},
“init”:{
“unodetype”:“constant”,
“type”:“int”,
“value”:“2”,
“coord”:“examples/math.c:4:12”
},
“bitsize”:null
}
]
},
“param-decls”:null
}
]
}
````
处理它。
在Linux上运行holyc secularly
[![构建状态](http://ec2-54-162-194-49.compute-1.amazonaws.com/job/holyc for linux/job/master/badge/icon)](http://ec2-54-162-194-49.compute-1.amazonaws.com/job/holyc for linux/job/master/)
[![PYPI版本](https://badge.fury.io/py/secularize.svg)](https://badge.fury.io/py/secularize)
如果你用这个,你会死的。或者更糟的是,您当前的操作系统将被templeos替换。我只在“3.7-dev”上做过这个测试。
*s=3;
u0测试(i16 a,u8 b,f64 c){
print(“hello”);
i64 b=2.000;
````
>examples/test.c`
``````c ````c
>voidtest(简称a,无符号字符b,双c,双c)
<}
double pest(char d)
{
printf(“无”);
}
int main()
{
double*s=3;
printf(“%s%s”,“hello”,“world”);
long b=2.0;
}
`````
为此,请编写要转换为的c文件,然后运行“secularize dump ast name of file.c”。这将很好地将ast打印到json。
``sh
$cat examples/math.c
int main()
{
long a=3;
>long b=2;
$secularize dump ast examples/math.c
{
{
{{
“
“ext”:[
>{
{
{
{
“
nodetype”:“funcdef”,
>
“coord”:“示例/math.c:1:5”,
“decl”:{
“u nodetype”:“decl”、
“name”:“main”、
“quals”:[]、
“storage”:[]、
“funcspec”:[]、
“coord”:“examples/math.c:1:5”、
“type”:{
“u nodetype”:“funcdecl”、
“coord”:“examples/math.c:1:5”、
“type”:{
“节点类型”:“typedecl”、
“declname”:“main”、
“quals”:[]、
“coord”:“示例/math.c:1:5”、
“type”:{
“节点类型”:“identifierType”、
“names”:[
“int”
]、
“coord”:“示例/math.c:1:1”
}
},
“args”:null
},
“init”:null,
“bitsize”:null
},
“body”:{
“u nodetype”:“compound”,
“coord”:“examples/math.c:2:1”,
“block-items”:[
{
“u nodetype”:“decl”,
“name”:“a”,
“quals”:[],
“storage”:[],
“funcspec”:[],
“coord”:“examples/math.c:3:8”,
“type”:{
“u nodetype”:“typedecl”,
“declname”:“a”,
“quals”:[],
“coord”:“examples/math.c:3:8”,
“type”:{
“\u nodeType”:“identifierType”,
“names”:[
“long”
],
“coord”:“examples/math.c:3:3”
}
},
“init”:{
“\u nodeType”:“constant”,
“type”:“int”,
“value”:“3”,
“coord”:“examples/math.c:3:12”
},
“bitsize”:null
},
{
“\u nodetype”:“decl”,
“name”:“b”,
“quals”:[],
“storage”:[],
“funcspec”:[],
“coord”:“示例/数学C:4:8”,
“type”:{
“unodetype”:“typedecl”、
“declname”:“b”、
“quals”:[]、
“coord”:“examples/math.c:4:8”、
“type”:{
“unodetype”:“identifierType”、
“names”:[
“long”
]、
“coord”:“examples/math.c:4:3”
}
},
“init”:{
“unodetype”:“constant”,
“type”:“int”,
“value”:“2”,
“coord”:“examples/math.c:4:12”
},
“bitsize”:null
}
]
},
“param-decls”:null
}
]
}
````
处理它。