code-generation

Page generation from PHP class

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 11:39:32
I'm actually creating websites for fun and some of my friends told me that I could be more efficient if I could create the output of the page with a php class that would represent the whole page. I was wondering how you people would do it. Thanks I'd suggest looking into some PHP frameworks, such as Cake which is good for beginners, or Symfony or Zend Framework if you're more skilled. Those will streamline your PHP development a lot. I am not a OO programmer .. but, as a proof of concept, and as per your question, you can do/try something like this. class Page { public $meta_title; public

T4 vs CodeDom vs Oslo [closed]

点点圈 提交于 2019-12-04 11:04:35
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . In an application scaffolding project on which I'm working, I'm trying to decide whether to use Oslo , T4 or CodeDom for generating code. Our goals are to keep dependencies to a minimum and drive code generation for a domain driven

Anyone have experience calling Rake from MSBuild for code gen and other benefits? How did it go? What are your thoughts / recommendations?

耗尽温柔 提交于 2019-12-04 10:11:17
While programming in C# using Visual Studio 2008, I often wish for "automatic" code generation. If possible, I'd like to achieve it by making my MSBuild solution file call out to Rake, which would call Ruby code for the code generation, having the resulting generated files automatically appear in my solution. Here's one business example (of many possible examples I could name) where this kind of automatic code generation would be helpful. In a recent project I had an interface with some properties that contained dollar amounts. I wanted a second interface and a third interface that had the

How best to deal with gigantic source code files in Visual Studio

╄→гoц情女王★ 提交于 2019-12-04 09:59:56
I'm working on a project which makes substantial use of code generation. Some of the files it generates contain >0.25 million lines of code. VS (2K5) doesn't cope too badly, but R# (4.01) throws an out of memory exception every two minutes or so. Splitting them out into partial classes/separate files isn't an option in the immediate term, though it may be later. Are there any clever IDE tricks to dealing with this? EDIT: so people are immediately saying (very sensibly) 'don't have a file that big' and suggesting ways to break it out into smaller files. That's fine, but I'm on a time-boxed task

Delphi-IDE: how to change the way class-completion works?

别等时光非礼了梦想. 提交于 2019-12-04 09:45:19
问题 Class completion in Delphi is a big time-saver, but I haven't found a way to customize it. I would like a getter and setter for a property to be grouped together instead of being thrown all over my unit; The interface part is generated properly, but the implementation section becomes a mess if you leave things up to the IDE. I want methods to be ordered like this by default: function TAaa.getAaa(); procedure TAaa.setAaa(); procedure TAaa.Baa(); function TAaa.getCow(); procedure TAaa.setCow();

Benefits and drawbacks of generated C# classes for Json objects

房东的猫 提交于 2019-12-04 09:40:58
I have sample Json and I need to serialize it into C# objects. I decided to leverage for this purpose Json.Net library. Also I need to have C# classes which will represent this Json. To create classes could be used Json C# class generator . There we have two options. "Create properties" and generated classes will look like: public class Address { private JObject __jobject; public Address(JObject obj) { this.__jobject = obj; } public string street_address { get { return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "street_address")); } } public string city { get {

Java source code generation frameworks [closed]

a 夏天 提交于 2019-12-04 09:35:59
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I have a set of Java 5 source files with old-style Doclet tags, comments and annotations. And based on that I would like to write a generator for another set of Java classes. What is the best way to do that? And are there any good standalone libraries for code analysis/generation in Java? Any shared exprience in

Eclipse UML plugin with Java Code Generation

谁说胖子不能爱 提交于 2019-12-04 09:32:53
问题 Does anyone know of a good (read: Free) Eclipse UML plugin that can also do code generation? If not, does anyone know of any good Eclipse UML plugins? EDIT : I'm running Eclipse IDE on Fedora Linux TIA Noob 回答1: eUML is free (read the license for restrictions): http://www.soyatec.com/euml2/features/ Also Jupe: http://jupe.binaervarianz.de/ 回答2: I've had some luck creating UML diagrams based on java code with ObjectAid: ObjectAid Download Page. It was made for Eclipse so it should work.

XSD Gen Classes That Reference a Common Type

僤鯓⒐⒋嵵緔 提交于 2019-12-04 09:23:31
问题 I am using XSD's to define my DTO types in C#. I am using XSD.exe to gen the classes from the XSD's. I have a Common.xsd that defines an Address type and I want to use this in more than one class: <xs:complexType name="Address"> <xs:sequence> <xs:element name="Street1" type="xs:string"/> <xs:element name="Street2" type="xs:string"/> <xs:element name="City" type="xs:string"/> <xs:element name="State" type="xs:string"/> <xs:element name="Zip" type="xs:string"/> </xs:sequence> </xs:complexType>

Code generator for expressions using Sethi-Ullman algorithm

送分小仙女□ 提交于 2019-12-04 09:07:29
Give a AST tree , I want to generate an assembly-like language. I'm trying using Sethi-Ullman algorithm but I have some questions in the algorithm implemetation. What should I do when I run out of registers? currently I do the following: Emit a push REG where REG is the register of right subtree, evaluate left subtree, get one free register assign as register of right subtree and then emit a POP REG operation where REG is the register of right subtree too. How should I implement the function to get a free register? currently I'm using an implementation like this instead of a stack-based: enum