Friday, March 25, 2011

New omc-parser code project

I recently opened a google code project to handle all the source files of this master's thesis.

The link is here:

http://code.google.com/p/omc-parser/

Command-line access:

Use this command to anonymously check out the latest project source code:
# Non-members may check out a read-only working copy anonymously over HTTP.
svn checkout http://omc-parser.googlecode.com/svn/trunk/ omc-parser-read-only


It is a good place to keep my code safe and also to report all the issues that I get during the development.

I have just setup a development environment in Linux and I want to be able to switch and keep updated all my source code between both operative systems.

Soon I will write an article about software configuration management for students that are developing a thesis, and my experience with this website will definitely help.

Wednesday, March 23, 2011

Tables generator ready

Now my work consist on build part of the code automatically from the Flex and Bison code generated in C.

In order to build this it is necessary to read the lexer.c and parser.c file and generate the LexTable.mo ParseTable.mo that contains the arrays used for the automata machine, and the LexCode.mo and ParseCode.mo used for the actions after a token is found for lexer and a shift reduce rule to build the AST for the parser. The files Token.mo needs to be rebuild also from the parser.c code.

For making this machine customized for any language, it is necessary to link the generated files together with the main files Lexer.mo and Parser.mo, so those files will be generated also with a sufix which will identify the machine.

For my thesis, the exercise 10 and exercise 4 are the examples I am using for testing the machine, so the machines will contain all these files with the sufix 10 and 4 respectively.

Some code cleaning is still necessary to do, but this does not affect the current work, it will be complemented later after the Error Handled is improved in the parser.

Friday, March 11, 2011

Parser Prototype done

This week is been very productive, after a good explanation of how to build the AST, I manage to build the typed AST for MetaModelica, it means that the goals for the prototype are reached and now I can move to the next phase which is to build the Lexer Generator.




There are still things to do, like cleaning the code from unused variables and better performance of the loops, besides the error handling which is another major milestone in this project.

Thursday, March 10, 2011

The Parser is now Parsing

After dealing with the C code generated by BISON, with more than 15 arrays and crazy GOTO statements, I have managed to create the first parser in MetaModelica that parses the exercise 10 of the MetaModelica examples (for those who have read the MetaModelica Document).

For the rest of the mortals, what I have achieve is to make the code of a program to be recognized by another program (Compiler Parser). However there are more stuff to do before this task is complete, including the generation of the AST, error handling and cleaning of the code.

It is now week 10 and hopefully 10 weeks more to go and finish this project. Next activities will be to focus on the MetaModelica code generation based on the Flex and Bison files.

Friday, February 25, 2011

Lexer prototype working

The first challenge of my thesis project is to understand how to program in MetaModelica language. In order to get some understanding I practiced by making the first Lexer Prototype using some samples of automata's machines from the compilers book.

This approach only gave me confidence on how to write code for MetaModelica, the next part was to use the Flex Lexer generator to generate the C code for one of the exercises of the MetaModelica book. This code help me to create the first Lexer that is able to understand the Flex tables and run a machine that generates the tokens required by the parser.

Now the next challenge is to mimic the same behavior with BISON, which is a parser generator, but much more complex that FLEX.

Thursday, February 10, 2011

Modelica Conference

It was good Conference to get some understanding on how big and stable is this project called OpenModelica (http://www.modprod.liu.se/MODPROD2011?l=en)




I got to listen to several expositors including my thesis examiner Peter and my supervisor Martin.

A nice workshop given by one of the creators of the compiler for Modelica Adrian Pop was also interesting to get some hands of this.

It is a good starting point to make this project to start with the coding.

Monday, January 10, 2011

First day at the "office"

From today, I will start coming to the office during week days at LiU PELAB, the duties for today are to finish writting my Planning Report of the thesis for the next semester.

 


Some important points to add are the goal of the thesis and the full schedule for the rest of the semester. This document is very important because it will be like the first requirement document of my thesis and will be an agreement of time with my examiner.

My idea is to finish with the presentation of the thesis at the begining of May, for this the parser for OpenModelica must be completed by the end of march and the written thesis report should be in its first draft by the begining of april.

This is why I will come more often to the office since there is a lot work to do and just a few months ahead.
Posted by Picasa