Showing posts with label openmodelica. Show all posts
Showing posts with label openmodelica. Show all posts

Thursday, June 9, 2011

OMCCp Thesis status: Published

This work is done!

I have to thank a lot of people for this, but I need another post for that. Now finally the thesis is been submitted and published.

The final URL is http://urn.kb.se/resolve?urn=urn:nbn:se:liu:diva-68863

This ends this Blog and the story of how I made my thesis.

As common as fairy tales, my examiner wanted me to work part time for him, in order to finish some further work related with my thesis. So this story ends with me sitting in the same place as I produce the most of my thesis but now as an employee.

This is then my stone to this field of science called Computer Science:


“People think that computer science is the art of geniuses but the actual reality is the opposite, just many people doing things that build on each other, like a wall of mini stones.” Donald Knuth

BibTex
@misc{Lopez-Rojas11,
author = {Lopez-Rojas Edgar Alonso},
institution = {Linköping University, PELAB - Programming Environment Laboratory},
pages = {233},
title = {OMCCp : A MetaModelica Based Parser Generator Applied to Modelica},
year = {2011}
}

Tuesday, May 31, 2011

Thesis presented!!

After a successful presentation today, now it remains only the correction of a few mistakes in the report and wait for the approval of the examiner for the final version of the report.

Next week I will have a meeting with my examiner to define the final modifications for submitting the final version of this report.

The project is almost done!

Monday, May 30, 2011

OMCC Presentation coming soon

Only one day left for the presentation, the latex Beamer software helped me for the first time to produce a PDF for the presentation. It is quite uncommon but very interesting to use LaTeX for a presentation. The result seems quite professional and only a few will tell it is LaTeX.

Today I will do one last rehearsal to prepare the presentation. It will take place in the room called Donald Knuth which is nice due to the contribution of Knuth to the LR parsing in 1965.

The last week I have been working only in the presentation and I did some reading again of the literature in order to have fresh all the concepts of compilers in case tricky questions come up by the opponent.

After a remarkable progress with the grammar with about 92% of the test suite working, OMCC is getting ready to be incorporated into the OMC compiler for OpenModelica.

Thursday, May 19, 2011

Final optimizations

I have increase the performance of my parser by simplifying the lexer and the parser. After I took out the recursion lexing and parsing one token at the time was easier.

My examiner wants me to implement an external C function to improve the speed of the lexer but the lexer is not my concern now. The time that the parser takes is considerable long, compared to the lexer.

More test will be performed over this weekend at the same time I keep growing the grammar which now only fails in 98 out of 568 cases in the grammar.

Monday, May 16, 2011

Presentation for the thesis scheduled

The time has come to present my thesis.

I have 2 weeks to prepare a good presentation and make good use of the software I produced.

However some improvements are required for the lexer to improve the performance.

The time for the presentation will be the 31st May 2011 15.15

Now is time to prepare an awesome presentation!!

Friday, May 6, 2011

draft 1 delivered

I just finished the first draft of the thesis, now it is under my supervisors review. However, the testing set for a subset of the Modelica grammmar wont be enough for the examiner, so I am currently working on extending the grammar for the parser while waiting for comments over the draft 1.

Tuesday, April 12, 2011

OMCC with error handling

I have been working on the thesis very hard lately, so far I have
accomplished this:

* Lexer and Parser
* Lexer and Parser Generator
* Error Handling

The last part is now working like this:

It uses error recovery to detect more errors, but it always fails at the end. Right now it only recovers from the action ERASE token, however if there are tokens with errors nearby it will stop parsing.

From the papers I read, I have this primary error handling techniques (single correction) which could be insert, replace or erase. So far I have not implemented MERGE because my parser only understand tokens and has no idea about the semantic value of the tokens. I need to implement a table to look for the semantic value, also important for displaying the errors with the right String not with the Token NAME as now.

***ERRORS WERE FOUND AND COULD NOT RECOVER ***

Syntax Error near [TOKEN:T_DO 'do' from (line:3 col:18) until (line:3
col:20)], ERASE token
Syntax Error near [TOKEN:T_ADD '+' from (line:4 col:13) until (line:4
col:14)], INSERT token {T_INTCONST or T_IDENT}
Syntax Error near [TOKEN:T_ADD '+' from (line:4 col:13) until (line:4
col:14)], REPLACE token with {T_LPAREN}
Syntax Error near [TOKEN:T_ADD '+' from (line:4 col:13) until (line:4
col:14)], ERASE token
Syntax Error near [TOKEN:T_IDENT 'y' from (line:8 col:5) until (line:8
col:6)], INSERT token {T_THEN}

program file:

1/* this is while test of comment */
2read x y z w;
3while x <> 99 do do
4 ans := (x++1) - (y/3);
5 write ans;
6 read x, y;
7 if x = 10
8 y := 234;
9 endif
10end


My thesis is getting close to the end, I hope it can be completed by the end of this month.

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.

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.

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

Tuesday, December 28, 2010

Starting the reading

This year is almost gone, and I have in mind to start fully productive in January with my Master Thesis at Linköping University for the master program in Computer Science, so I decided to spend the most of this december in reading some interesting references for my master thesis.

First, I have to start catching up with all the theory of Compilers, so I have started reading the first 4 chapters of the book Compilers Principles, Techniques, and Tools

I also have a lot to read from the book Principles of Object Oriented Modeling and simulation with modelica 2.1

One of my supervisors had a video conference with me today to explain me a bit more about the whole project open modelica and to clarify me a bit more about the PARCER that I will build for this project.

The idea is to improve the speed and the error detection in open modelica by replacing the current parcer ANTLR with a integrated parcer built in Modelica language.

Next meeting will be next week or better to say "next year" and I hope to be done with the reading.

My idea is to start the second week of January to design the structure of the parcer and learn the tool I will use to write the compiler parcer.