p****2 发帖数: 387 | 1 请教一个问题:请问用Bison/Yacc可以实现把Object Code加到源程序中。
譬如,Source1能引用object2.o中的函数. |
h*******e 发帖数: 225 | 2 yacc/bison is just a source-to-source compiler. add necessary "#include"s in
the declaration section in the .yacc file.
【在 p****2 的大作中提到】 : 请教一个问题:请问用Bison/Yacc可以实现把Object Code加到源程序中。 : 譬如,Source1能引用object2.o中的函数.
|
p****2 发帖数: 387 | 3 what if the included function/file is also a source/object generated by
yacc/bison? thanks!
"#include"s in
【在 h*******e 的大作中提到】 : yacc/bison is just a source-to-source compiler. add necessary "#include"s in : the declaration section in the .yacc file.
|
h*******e 发帖数: 225 | 4 xxx.yacc -> Yacc -> xxx.cc | xxx.h
So its basically just including another .h file.
【在 p****2 的大作中提到】 : what if the included function/file is also a source/object generated by : yacc/bison? thanks! : : "#include"s in
|
p****2 发帖数: 387 | 5 Thanks for your reply!
The flex and bison together create a translator that converts source to
some kind of opcode. Now I want to have a linker links source and opcode
and generates another opcode. I am wondering whether I can create such
linker using Bison.
【在 h*******e 的大作中提到】 : xxx.yacc -> Yacc -> xxx.cc | xxx.h : So its basically just including another .h file.
|
p****2 发帖数: 387 | 6 Actually I should ask whether it is hard to implement a linker using
Bison, or do I need to use Bison in order to implement a linker.
【在 p****2 的大作中提到】 : Thanks for your reply! : The flex and bison together create a translator that converts source to : some kind of opcode. Now I want to have a linker links source and opcode : and generates another opcode. I am wondering whether I can create such : linker using Bison.
|