Monday, July 28, 2008

Parser modifications and tests

Over the weekend and today I worked on parser rules. I started it from the scratch having the modified grammar and existing grammar implementations as references. I was able to get rid from most of shift/reduce and reduce/reduce conflicts. But I still get a single shift/reduce conflict. I don't know how to find it easily.
Commit the changes of the parser[1]. Then I started with tests, first I go through with the documentations[2][3][4].

[1] svn//svn.zope.org/repos/main/Sandbox/adamg/ocql/branches/qo-compiler - implementation
[2] http://pypi.python.org/pypi/zope.testing/3.5.1
[3] http://wiki.zope.org/zope3/Zope3Book
[4] http://wiki.zope.org/zope3/unittests.html

3 comments:

Charith said...

I continued with parser modifications and writing tests. Add basic tests to the identified project. Commit the changes to the branch. I was facing in trouble with finding out a shit/reduce conflict.
Debug it with the simplest test case. Conflict appears before the tokenizer tokenize the first token. It seems that it can reduce empty token to productions or shift the token. Try to avoid that conflict.

Charith said...

Continued with adding tests. I found out the grammar rule causing me a shift/reduce conflict. It was not generated by empty string. I found it by commenting all the rules and then using them one by one.
Refer to the zope code base to find out how test classes are used in it.

Charith said...

I was unable to do much work today since my father was ill. I had to went with him for doctor meetups. Just go through some test classes and add some simple tests to the project.