需要有关构建小型C ++到C编译器的帮助。 [英] Need help regarding building a small C++ to C compiler.

查看:85
本文介绍了需要有关构建小型C ++到C编译器的帮助。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我的编程语言项目的任务是创建一个

编译器,它将C ++文件作为输入并将其转换为C

文件。在这里,我必须处理继承和运算符重载

和虚函数。我的意思是它不应该妨碍C ++的含义。在

坦率和简单的术语中我需要用C ++实现一个小的C ++编译器,

我希望中间表示为C.请帮助我

这个。

~感谢和问候

Hi All,
I have an assignment for my Programming language project to create a
compiler that takes a C++ file as input and translate it into the C
file. Here I have to take care of inheritance and operator overloading
and virtual functions. I mean it should not hamper the C++ meaning. In
frank and simple terms i need to implement a small C++ compiler in C++,
and i want the intermediate representation to be C. Please help me in
this.
~thanks and regards

推荐答案

学生skrev:
大家好,
我的编程语言项目的任务是创建一个
编译器,它将C ++文件作为输入并将其转换为C
文件。在这里,我必须处理继承和运算符重载和虚函数。我的意思是它不应该妨碍C ++的含义。用坦率和简单的术语我需要在C ++中实现一个小的C ++编译器,我希望中间表示为C.请帮我
这个。
〜谢谢和问候
Hi All,
I have an assignment for my Programming language project to create a
compiler that takes a C++ file as input and translate it into the C
file. Here I have to take care of inheritance and operator overloading
and virtual functions. I mean it should not hamper the C++ meaning. In
frank and simple terms i need to implement a small C++ compiler in C++,
and i want the intermediate representation to be C. Please help me in
this.
~thanks and regards




见Lex和Yacc / Bison(或精神)作为开始。


-

TB @ SWEDEN



See Lex and Yacc/Bison (or Spirit) as a start.

--
TB @ SWEDEN


2006-03-07,学生< On ********* @ mail2student.com>写道:
On 2006-03-07, Student <On*********@mail2student.com> wrote:
我的编程语言项目的任务是创建一个
编译器,它将C ++文件作为输入并将其转换为C
文件。在这里,我必须处理继承和操作符
重载和虚函数。我的意思是它不应该妨碍C ++的含义。坦率而简单的术语我需要在C ++中实现一个小的C ++编译器,我希望中间表示为C.请帮助我。
I have an assignment for my Programming language project to create a
compiler that takes a C++ file as input and translate it into the C
file. Here I have to take care of inheritance and operator
overloading and virtual functions. I mean it should not hamper the
C++ meaning. In frank and simple terms i need to implement a small
C++ compiler in C++, and i want the intermediate representation to
be C. Please help me in this.




您能选择更具挑战性的东西吗? ;-)


由comp.compilers停止寻求帮助。


-

Neil Cerutti
童子军正在节省铝罐,瓶子和其他物品的回收利用。所得款项将用于削弱儿童。 --Church

Bulletin Blooper



Could you choose something any more challenging? ;-)

Stop by comp.compilers for help.

--
Neil Cerutti
Scouts are saving aluminum cans, bottles, and other items to be
recycled. Proceeds will be used to cripple children. --Church
Bulletin Blooper


文章< 1141747437.056257.215800

@ z34g2000cwc.googlegroups.com> ,
On*********@mail2student.com 说......
In article <1141747437.056257.215800
@z34g2000cwc.googlegroups.com>,
On*********@mail2student.com says...
大家好,
我的编程语言项目的任务是创建一个
编译器,它将C ++文件作为输入并将其转换为C
文件。在这里,我必须处理继承和运算符重载和虚函数。我的意思是它不应该妨碍C ++的含义。用坦率和简单的术语我需要在C ++中实现一个小的C ++编译器,我希望中间表示为C.请帮助我
这个。
Hi All,
I have an assignment for my Programming language project to create a
compiler that takes a C++ file as input and translate it into the C
file. Here I have to take care of inheritance and operator overloading
and virtual functions. I mean it should not hamper the C++ meaning. In
frank and simple terms i need to implement a small C++ compiler in C++,
and i want the intermediate representation to be C. Please help me in
this.




这是否完全可行取决于你的意思

bysmall C ++ to C Compiler。如果你的意思是编译一个C ++的一小部分,那么它可能是可行的。如果你是
意味着一个C ++的小编译器,你就是在做梦 - 一个C ++

编译器是一个很大的项目。


使编译器可行将在很大程度上取决于创建C ++的一个子集,这是合理的尝试。

C ++的功能与真正无关紧要(例如//作为

评论分隔符)而其他人则特别难以支付(例如支持导出的模板)。


-

后来,

杰瑞。


宇宙是自己想象的虚构。



Whether this is at all feasible depends on what you mean
by "small C++ to C Compiler". If you mean a compiler for
a small subset of C++, then it might be feasible. If you
mean a small compiler for C++, you''re dreaming -- a C++
compiler is a BIG project.

Making the compiler feasible will depend heavily upon
creating a subset of C++ that''s reasonable to attempt.
C++ features vary from the truly trivial (e.g. // as a
comment delimiter) while others are exceptionally
difficult (e.g. supporting exported templates).

--
Later,
Jerry.

The universe is a figment of its own imagination.

这篇关于需要有关构建小型C ++到C编译器的帮助。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆