Re: TextTransformer: Presentation and some questions

codeworker@free.fr (Cedric LEMAIRE)
10 Aug 2004 17:31:46 -0400

          From comp.compilers

Related articles
TextTransformer: Presentation and some questions Meyer-Eltz@t-online.de (2004-07-13)
Re: TextTransformer: Presentation and some questions codeworker@free.fr (2004-08-10)
| List of all articles for this month |
From: codeworker@free.fr (Cedric LEMAIRE)
Newsgroups: comp.compilers
Date: 10 Aug 2004 17:31:46 -0400
Organization: http://groups.google.com
References: 04-07-014
Keywords: tools, parse
Posted-Date: 10 Aug 2004 17:31:46 EDT

Meyer-Eltz@t-online.de (Detlef Meyer-Eltz) wrote
> [snip ...]


> I am still full of plans and ideas for further improvements, but I would like
> to know your assessements:
> Do you think it is a good idea to combine a parser generator with an
> interpreter?
> Which are the most essential instructions such a tool should master?
> For whom could such a tool be useful?
> Is the use of the regex library favorable?
> Do you know similar tools?
> Would you use an integrated debugger or do you prefer first to create code
> and than use the debugger of your compiler?


I know a similar tool called CodeWorker, which is both a parsing tool
(pred-LL(k), extended-BNF scripts) and a universal source code
generator (template-based scripts), available at
"http://www.codeworker.org".


It interprets a scripting language, but a translation of scripts to
C++ is provided (switch '-c++' on the command-line).


It is useful for every aspect of generative programming.


One of the most important instruction is '>ontinue', which reclaims
the rest of the sequence being valid. It is very useful for both
debugging the grammar and checking the syntax of the input file.
You can find more features at
"http://www.codeworker.org/ScriptsRepository.html#source_to_source_translation":
click on the link "CodeWorker_grammar.cwp" and search the non-terminal
template symbol 'script<"extended-BNF">' (non-terminals may look like
C++ template functions here), or you can read the chapter of the
documentation speaking about extended-BNF scripts in CW
(http://www.codeworker.org/CodeWorker.pdf).


See the function 'translate()' to learn how to process
source-to-source translation or program transformation (text
transformer, in fact). It merges both extended-BNF and template-based
instructions.
Examples:
    * how to translate a CW script to an HTML syntax highlighting:
http://www.codeworker.org/ScriptsRepository.html#source_to_source_translation,
    * how to inject profiling in an C++ source file:
http://codeworker.free.fr/ScriptsRepository.html#Program_transformation


In CodeWorker, the debugging is done during the interpretation:
'#trace' to trace non-terminal calls, 'debug' statement (not useful in
fact), ...


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.