Showing posts with label linkoping. Show all posts
Showing posts with label linkoping. Show all posts

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.

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