Hey Mobi, Sorry for not responding to this sooner. I have two suggestions. First, if you have not already done so, I recommend reading this book about Object Oriented C <http://www.cs.rit.edu/~ats/books/ooc.pdf>. It will likely give you all of the technical background that you need to implement what you want. Second, tcc is a one-shot parser. If you want any preprocessing, you'll need to implement that yourself. Of course, you can write a simple preprocessor in Perl which would take some almost-C syntax and produce an ANSI-C file for you, which you then feed into tcc or gcc or whatever. Alternatively, you can write your own executable that links to libtcc. You would do some string preprocessing, then send the final output to tcc_compile_string. If you are comfortable with Perl, you can write an experimental preprocessor and feed the resulting strings straight into tcc using the C::TinyCompiler module.
I hoe that helps! David On Fri, Apr 18, 2014 at 9:15 AM, mobi phil <[email protected]> wrote: > P.S. > > what would be yet even more complicated but interesting is to add a kind > of 2 phase compile, where the "head" of the tcc parser would be able to > parse the "translated" (or pre-parsed code) code the same way as it does > with the macro expansion. > > > On Fri, Apr 18, 2014 at 3:13 PM, mobi phil <[email protected]> wrote: > >> Domingo, >> >> thanks for your quick answer. Please note that one of the reason I want >> to stay tcc is: >> -> the speed and relative simplicity, this is probably the reason keeps >> all of you close to tcc >> -> I want to stay C syntax. Do not want to invent another language. Want >> just to embed constructs to the existing language. >> >> so for these reasons things like lex/yacc, vala etc. are out of question. >> >> Had a look at the other links as well, but they are far from what I want. >> >> I would love to see C evolving without the "dictated by committee >> syndrome" (or whatsoever is >> the pejorative) and tcc would be probably a nice opportunity to >> experiment. >> >> mobi phil >> >> > > > -- > rgrds, > mobi phil > > being mobile, but including technology > http://mobiphil.com > > _______________________________________________ > Tinycc-devel mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/tinycc-devel > > -- "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." -- Brian Kernighan
_______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel
