Archive for February, 2008

Isometrics TileBuilder

Friday, February 29th, 2008

Isometrics Tile Builder is a simple editor for building tiled pictures. For example: buildings, landscapes, etc.

It has very basic functionality which allows you create horizontal and vertical tiles in isometric projection. With its help you can create sceletons for buildings like on the following screenshot:

tilebuilder.JPG

This application will be further developed and hopefully will became the real editor for isometric pixels art. To use it you will need MS .NET Framework 3.0.

The demo of the application together with the corresponding sources are avalable: Tile Builder

Script.NET on UkrProg’2008

Thursday, February 21st, 2008

Script.NET language will be presented on the UkrProg’2008 conference. This is the 6-th international scientific and practical conference on programming. It will take place in Kiev on May 2008.

About Conference:

Following successful series the first four International Scientific and Practical Conference on Programming (in 1998, 2000, 2002, 2004 and 2006) next conference is announced to be held in Kiev, Ukraine, at Cybernetics Centre of National Academy of Sciences of Ukraine (NASU). The conference of UkrPROG’2008 is planned on May 27-29, 2008 at the same venue and is organized by NASU in cooperation with Ministry of Education and Science of Ukraine, Cybernetic Centre of NASU, and National University of Technology of Ukraine “Kiev Polytechnic Institute”. Basic organizations for conference promotion are Institute of Software Systems of NASU and Glushkov Institute of Cybernetics of NASU.

The main purpose of the conference is to provide a forum for discussion of the most important achievement in both science and practice of programming, software engineering and applications and to extend interaction of academia and practitioners in this area of a science and technology. The main audience and participants at the UkrPROG’2008 are expected researchers from academic departments and laboratories and industrial organisations of Ukraine and other countries of the nearest European region.

DLR Language with Generated parser (Part 3)

Thursday, February 7th, 2008

Background

I wanted to produce a working DLR language. For this purpose I wanted to use C# Compiler tools to generate lexical analyzer and parser. I spent couple of hours tackling DLR with VS and debugger and finaly made it. There are several problems which you have to solve. First, implement a set of classes to host a your language (See Part 1), manage variables (See Part 2) and finaly produce a AST generator.

When almost everything was ready I have suprisingly strange problem with running loops and conditions. The following AST haven’t run as expected:

Loop Ast

In fact, it does not produce any results… And again debugger had helped me. Everything was because of the following implementation of LanguageContext from DLR:
LanguageContext.IsTrue
You have to override this function in your custom language context to make Conditions work:
MyLLanguageContext.IsTrue
Another, issue which blocks me for a while was Variables. I have implemented the following variable management through Variable Dictionary:
Variable Table

The limitation of the following solution is that it only works with Integer variables.

Solution

I have used C# Compiler Tools by Malcolm Crowe to produce Parser and Lexical Analyzer. The syntax of the grammar is similar to that of Yacc:

MyStatement: …
| ‘if’ Condition:c MyStatement:s {$$ = Ast.IfThen((Expression)c.yylval, (Statement)s.yylval);}

The complete grammar of the language and build tools may be found in the “Grammar and Lexer” folder of the solution.

The example of the MyL code:


MyL code
The AST produced by the Parser has the following DLR Dump:

DLR Dump (AST)
You may download DLR MyL by the following link

See also