maggio 2008 Blog Posts

Custom drop target

The automatically generated designer in DSL assumes that you have to put the shape on the surface and then eventually connect to others. Statements, in microbasic, are executed sequentially so I want the designer to attach my shapes to one previously placed, dropping it in the link between two shapes. To drive the shapes drop behaviour I have to modify where the shapes are allowed to be dropped. Setting the attribute UsesCustomAccept does this (or at least I hope!!!). <?xml version="1.0" encoding="utf-8"?> <Dsl dslVersion="" Id="bd36672a-93b9-4dce-82f8-2551432eb244" Description="Description for myns.Language1.Language1" ...> <Classes> ...

Double derived pattern in DSL

Customizing a DSL needs different expertise based on the amount of customization that you want to apply. A 'basic' concept that you need to understand is the double derived pattern. The DSL engine generates classes based on the dsl definition. Those classes are partial class so, like in or winform, you can create your code for the same class in another file separating it from the automatically generated. Those classes are split in two separate files, but is essentially the same class so you can't replace a method automatically generated. To address this problem the DSL framework introduce the double derived pattern. For...

Visual programming language using visual studio DSL

I found a very interesting firmware for my Canon A550. This new firmware adds tons of new feature. One of those, is the scripting support using a language similar to basic. As a programmer it's easy to program with it...well...too easy! So I decided to throw some of my spare time to play with DSL. The basic idea is to create a DSL that let's you visually program the canon scripting. What I want to achieve is a tool having a toolbar with all the language (if, do, variable declaration...) and camera (shoot, zoom...) statements that you can drag on the programming surface to...