пятница, 10 февраля 2012 г.

Initial state of the project

First, I want to describe current situation with Octclipse project. To be honest, this project is a really good job! There are a lot of features and I still don't understand everything.

Octclipse is based on Eclipse DLTK (Dynamic Language ToolKit) project. It already has two source parsers, syntax highlighting, launching support, initial debug support, integrated Octave help and many other features.

What is wrong now?

1. Parsers.
One parser is Java-based, implemented with BYACC/J and JFlex. That means, its' grammar was implemented manually and that's why was not complete. Octclipse grammar file size is 3 times smaller than original Octave grammar. So, there are a lot of small issues with parsing (but in general it works on simple sources)

Example of parsing issue:
if  (2 > 1),
  x = 1:10;
  x(end-2:end)
end;

This code is correct and can be executed in Octave without any problems.

The problem relates to 'end' keyword. This special case of using 'end' in vectors to point to the last element was just forgotten (or it was difficult to implement this case).

Second parser is a native one. The main idea is to use native octave parser to determine tokens semantic. That is reasonable, because if something works in Octave, it should work in Octclipse. The problem is that now this parser doesn't work at all due to some changes in AST (Abstract Syntax Tree) classes. Beside, its' architecture is very sophisticated now:

  • User must compile and install native library himself
  • Native library parses source file and converts it to XML
  • In Java-side, ANTXR-based parser converts XML to AST


2. Debug
I didn't manage to run debug yet, because it also requires compiling a native library.

There are also two more native libraries, but I didn't understand their goal yet.

Комментариев нет:

Отправить комментарий