[antlr-interest] Re: Preprocessors - academic question

mzukowski at yci.com mzukowski at yci.com
Fri Jun 28 11:20:49 PDT 2002


> Ideally, we wanted to be able to do radical transformations 
> on the code.
> For example, we wanted to be able to take old code which mixed UI and
> database access, and automatically split that code so that it 
> could more
> easily be split up and put into an n-tier architecture (application
> servers, etc).
> 
> We still think that's possible, but with this big limitation: the
> preprocessing junk is lost from the source. That will be 
> unacceptable for
> most potential projects, but it might be acceptable for the odd thing.

There's no reason you couldn't put the preprocessing junk in at the end,
right?  I mean if you are radically changing the code then they can expect
things to change.  Maybe you can take the transformed tree and then start
some pattern matching to insert macros where appropriate.  You could use
original invocations of the macros to have a pattern to match against.  This
might make for a good (somewhat) interactive step at the end.  You get a
chance to refactor the code via macros since the language doesn't support
objects or whatnot.

Monty

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list