writing a simple code generator

  • Thread starter Thread starter John Mott
  • Start date Start date
J

John Mott

I've played with some code generators; they all have what appears to be aspx
web pages run from a desktop program. The pages have a code section and a
section where they use <% %> operators to instantiate content.

I have a very specific and surgical need and want to do this from a desktop
program. Is it as simple as instantiating an object thats derived from
system.web.ui.page and invoking a 'execute this' method of some sort and get
a string back? Or am I dreaming ;-)

john mott
 
The selection of the <% %> delimiters is arbitrary. CodeSmith uses
those characters, and GenX from Developmentor did, too. I'm just
speculating, but both products probably picked those characters
because MS developers are familar with using <% %> to provide
'instructions to execute' inside some form of declarative markup.

A Page class won't be able to interpret the special syntax for a code
generator.

Hope that makes sense,
 
Thanks Scott,

What about the big picture? Whats behind the ability to launch a file with
code and constructs that are embedded in it and have it compile the code and
run the page?

thanks,

john
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top