Re: Newbie questions
Stefan Seefeld <[email protected]> Fri, 21 Jul 2006 09:53:35 -0400
| Newsgroups | gmane.comp.documentation.synopsis |
|---|---|
| Message-ID | <[email protected]> |
[email protected] wrote: > I have been trying to use Synopsis to analyse some C++ code, but I am > experiencing some problems. > > I am using the binary distribution synopsis-0.8.win32-py2.4.exe. > > To get Synopsis to work I had to: > > 1. Add /Python24/Synopsis/lib to the system path so that libSynopsis.dll > could be found. > 2. Edit Synopsis/Parsers/Cpp/Parser.py to use the ucpp module instead of > the wave module. 1. This is documented in the INSTALL notes. (is there a better place for users of the windows binary package to notice ?) 2. This is quite embarassing ! The Parser.py version that slipped into the windows binary release was obviously not the one I meant to put there. Replacing calls to 'wave' by 'ucpp' is the right fix. > Once I had done this I tried to parse a simple header file: > > ---- simple_test.h ---- > > 1: #ifndef __simple_test_h__ > 2: #define __simple_test_h__ > 3: int x(); > 4: #endif // __simple_test_h__ > > ---- > > Using this script: > > ---- simple_test.py ---- > > 1: from Synopsis.AST import AST > 2: from Synopsis.Parsers import Cxx > 3: > 4: ast = AST() > 5: cxx = Cxx.Parser() > 6: ast = cxx.process(ast, input=['simple_test.h']) > > ---- > > When I do this I get the following error: > > ---- console output ---- > > Warning: An exception occurred: Type::wrong_type_cast > At: (D:\Projects\User\SAVXPCodeAnalysis\SynopsisTest\simple_test.h:3) Confirmed. (I'm puzzled, as the code is trivial, and doesn't seem to trigger any platform-specific bits, yet the same code is processed fine on linux.) > I also noticed that if the file I try to parse does not exist I get the > following error: > > --- console output ---- > > file 'D:\SynopsisTest\simple_test.h' not found > ucpp returned error flag. ignoring error. > Traceback (most recent call last): > File "D:\SynopsisTest\simple_test.py", line 6, in ? > ast = cxx.process(ast, input=['simple_test.hx']) > File "C:\Python24\Lib\site-packages\Synopsis\Parsers\Cxx\Parser.py", line > 73, in process > if self.preprocess: os.remove(ii_file) > OSError: [Errno 13] Permission denied: 'c:\\temp\\synopsis-2420.ii' I guess the reason is that Parser.py assumes the .ii file to exist when it actually doesn't (because the preprocessor backend bailed out before it could create it), and for some strange reason windows generates a 'Permission denied' error when attempting to remove a non-existing file. While harmless, I will look into a fix. > What am I doing wrong? Nothing. It's embarassing that I have created a windows package without making sure it actually works. It simply shows that it takes more to release (and maintain !) a package for a particular platform than casual access to it to run the packager. Unfortunately, I can't make any promises as to when I can fix it (given that my daily development platform is Linux). I will, however, do my best in helping figuring out errors and problems. So, any help in porting and maintaining (not only to windows) would be more than welcome ! Thanks, Stefan