Newbie questions
[email protected] Fri, 21 Jul 2006 10:01:50 +0100
| Newsgroups | gmane.comp.documentation.synopsis |
|---|---|
| Message-ID | <OF9503B167.2BE2A544-ON802571B2.00305323-802571B2.00319AB5@sophos.com> |
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.
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)
----
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'
----
What am I doing wrong?
Cliff