473,396 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

writing a simple code generator

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
Feb 21 '06 #1
2 933
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,

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Tue, 21 Feb 2006 11:15:28 -0600, "John Mott"
<jo********@hotmail.com> wrote:
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


Feb 21 '06 #2
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
"Scott Allen" <sc***@nospam.odetocode.com> wrote in message
news:gl********************************@4ax.com...
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,

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Tue, 21 Feb 2006 11:15:28 -0600, "John Mott"
<jo********@hotmail.com> wrote:
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

Feb 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: MetalOne | last post by:
I am trying to write a generator function that yields the index position of each set bit in a mask. e.g. for x in bitIndexGenerator(0x16): #10110 print x --> 1 2 4 This is what I have, but...
7
by: Brian Burgess | last post by:
Hi all, Anyone see anything wrong with the following: *************************************************************** <%@ LANGUAGE="VBSCRIPT" %> <% Option Explicit Dim nAcctNbr Dim...
2
by: Scott Vercuski | last post by:
Everyone, I'm having trouble writing an event to the event log. Here is the chunk of code I currently have. ----------------------------------------------------------------------- Private...
8
by: Thomas Stegen | last post by:
I have written a code generator. To be more specific it is a code generator generator. As in a generator that generates code generators. If you run the generator on its own source code you get a...
0
by: Daniel Perron | last post by:
Hi, I was trying to use Galois.Net to specify code generators and I had to look for some text template tool to simplify the syntax. I was looking for something similar to the syntax of an...
14
by: Steven D'Aprano | last post by:
I came across an interesting (as in the Chinese curse) problem today. I had to modify a piece of code using generator expressions written with Python 2.4 in mind to run under version 2.3, but I...
18
by: Bob Cummings | last post by:
Not sure if this is the correct place or not. Anyhow in school we were taught that when trying to calculate the efficiency of an algorithm to focus on something called FLOPs or Floating Point...
19
by: Frank Stutzman | last post by:
My apologies in advance, I'm new to python Say, I have a dictionary that looks like this: record={'BAT': '14.4', 'USD': '24', 'DIF': '45', 'OAT': '16', 'FF': '3.9', 'C3': '343', 'E4': '1157',...
16
by: billsahiker | last post by:
I am researching for an upcoming c# .net 2.0 project that may require reading and writing xml files. I don't want to use xmltextreader/ xmltextwriter as I prefer to have lower level file access...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.