Re: Small embeddable scripting language ?



> 3) As an embedded template language for code snippets and file and
> project wizards. For example, you might want to add a code snippet for a
> standard C header file:
> -----------------
> /*
> ** File name <%=echo $file_name%>
> ** Copyright <%=echo $current_year%> <%=echo $author_name%>
> */
> 
> #ifndef <%=echo upper(canonical($file_name))%>
> #define <%=echo upper(canonical(file_name))%>
> ....
> 
> #endif /* <%=echo upper(canonical($file_name))%> */
> -------------------

I just wanted to give you some thought on this part of your plan.  I am
working on GObject Factory a GObject code generator that I eventualy
plan to integrate into Anjuta 2.  I have recently moved to a template
engine instead of generating everthing in C.  I found that XSLT provided
by libxslt works well for this type of thing and is easy to setup and
debug the templates with command line tools.  

The drawbacks with XSLT is that it can get verbose and it doesn't have
very good tools for doing things like changing strings from uppercase to
lowercase (at least none that I have found in the documentation).  I got
around this by doing the case changes in the C code.

The benefit of XSLT is that it is easy to use, is a defined standard by
the XML working group and would save you the trouble of coming up with
another template system.  It literally took me 1/2 hour to learn and it
is already part of the GNOME libraries.

I don't want to give you more languages to learn ;-) but it is just a
thought.

--
J5  




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]