background preloader

Programing

Facebook Twitter

WML and WMLScript. Book. Linux Parallel Processing HOWTO.

Xtext

Getting Started with Xtext - Peter Friese. Xtext has been released as a part of the Eclipse Galileo release train on June 24th, 2009.

Getting Started with Xtext - Peter Friese

Xtext is a framework for building DLSs (domain specific languages). In fact, it can be seen as a DSL for defining DSLs. In this article, we will develop a small DSL for defining entities. Download and Install Hop over to and download an Xtext distribution matching your platform. To install, unzip the distribution file to a directory of your liking. Windows users, please make sure you unzip to a directory near to your filesystem root!

Create a new project After launching Eclipse and creating a new workspace (or using an existing one), create a new Xtext project by selecting File –> New… Project… –> Xtext Project. Main project name: org.xtext.example.entityLanguage name: org.xtext.example.EntityDSL-File extension: entityCreate generator project: yes Click Finish to let Xtext create the three projects that make up your DSL: Define the grammar for your DSL Let’s derive the grammar for this model. ]( Getting started with Xtext, part 2 - Peter Friese. Last week, I showed you how easy it is to create a DSL with Xtext.

Getting started with Xtext, part 2 - Peter Friese

In this installment, we will have a look at how to leverage the models created with the DSL. Goal. Xtext Tutorial. Now, that we have a DSL, we may want to do something useful with it.

Xtext Tutorial

DSLs are essentially small programming languages. A programming language has to be understandable by a computer. There are basically two ways to make a language "understandable" by a computer. The first one is to write a compiler which transforms expressions made in one language into another language, which is already understandable by a computer. For example, a Java compiler transforms Java programs to bytecode programs. With Xtext, models one can either create a compiler (also called generator) or an interpreter. Code generation with Xpand The Xtext wizard already created a generator project for us. So just open the Xpand template (Main.xpt) and modify it like this: Figure 23. The definition main is invoked from the workflow file. The definition javaBean is declared for elements of type Entity. All text contained between «FILE ...» and «ENDFILE» will go to the new file. Xtext Tutorial. Code Generation With Xtext. We Recommend These Resources Recently I attended a local rheinJUG meeting in Düsseldorf.

While the topic of the session was Eclipse e4, the night’s sponsor itemis provided some handouts on Xtext which got me very interested. The reason is that currently at work we are developing a mobile Java application (J9, CDC/Foundation 1.1 on Windows CE6) for which we needed an easy to use and reliable way for configuring navigation through the application. In a previous iteration we had – mostly because of time constraints – hard coded most of the navigational paths, but this time the app is more complex and doing that again was not really an option.

First we thought about an XML based configuration, but this seemed to be a hassle to write (and read) and also would mean we would have to pay the price of parsing it on every application startup. ACL Video Archive. Computer Musings by Professor Donald E. Knuth.

Assembly

Android Dev. C++ UPX: the Ultimate Packer for eXecutables - Homepage. Cheat sheets and programming resources - QuicklyCode. Download Free Computer eBooks and Programming eBooks. New programming slang - Programming. A question recently posted on stackoverflow.com asked for people to submit programming terms that they or their team have coined and have come into regular use in their own circles.

New programming slang - Programming

Below are the most popular answers Yoda Conditions The act of using if (constant == variable) instead of natural if (variable == constant),; for example, if (4 == foo). Because it is like "if it is the blue – this is the sky" or "if that is tall – this is a man. " Pokémon Exception Handling When you catch all the exceptions and then you try somehow to analyze them. try{ //code }catch ( Exception ex){ if( ex instanceof SubException){ //code }else if(ex instanceof SubSubException){ //code }else{ //code } } Discuss an example here Egyptian brackets This is the style of brackets, when an opening bracket is placed at the end of this line: if (a == b) { printf("hello"); } Why do we call this style "Egyptian brackets?

" Different types of bug reports Stringly Typed It is a riff on strongly-typed. Other types of errors. Codase - Source Code Search Engine. Java Examples: Thread. Koders.com New. PDF2JPG - convert PDF to JPG images with ImageMagick - PHP - Snipplr Social Snippet Repository.