#6 AttributeError: 'typedef_t' object has no attribute 'has_val

closed-fixed
nobody
None
5
2007-01-05
2007-01-04
Kulik
No

First of all, congratulations, py++ is an excellent package. It generates brilliant code, much much better than pyste. I have got very good experience with it, generating code even for relatively big projects.

I only got one problem. When creating the module builder and including several specific files it raises an exception. I have followed the advice on big projects and I include all headers in one header.

The whole output:
INFO Parsing source file "Core/Core.h" ...

INFO gccxml cmd: /usr/bin/gccxml -I"../../../" -I"../../../" "../../../Core/Core.h" -fxml="/tmp/tmpI0w7iY.xml"
Traceback (most recent call last):
File "generate_bindings.py", line 10, in ?
mb = module_builder.module_builder_t( working_directory = "../../../", files = source_files, include_paths = [ "../../../" ], indexing_suite_version = 2 )
File "/usr/lib64/python2.4/site-packages/pyplusplus/module_builder/builder.py", line 87, in __init__
, indexing_suite_version)
File "/usr/lib64/python2.4/site-packages/pyplusplus/module_builder/builder.py", line 118, in __parse_declarations
decls = reader.read_files( files, compilation_mode )
File "/usr/lib64/python2.4/site-packages/pygccxml/parser/project_reader.py", line 225, in read_files
return self.__parse_file_by_file(files)
File "/usr/lib64/python2.4/site-packages/pygccxml/parser/project_reader.py", line 250, in __parse_file_by_file
decls = reader.read_file( header )
File "/usr/lib64/python2.4/site-packages/pygccxml/parser/source_reader.py", line 244, in read_file
raise error
AttributeError: 'typedef_t' object has no attribute 'has_value_name'

This only happens when I include 3 files in the project (every other header file works without any problems). Strange is, that I have some very neat C++ metaprogramming inside the project, but that is parsed (and even exposed when instantiated) properly. This error only happens on 3 (IMO very simple headers). Their names are Log.h, LogSystem.h and RegularExpressions.h. Even when I include them separately they raise the exception.

RegularExpressions.h is the simplest one (it only typedefs to boost::regex).

#ifndef __REALITYSTREAM_CORE_REGULAR_EXPRESSIONS_H__
#define __REALITYSTREAM_CORE_REGULAR_EXPRESSIONS_H__

#include "Global.h"
// not really needed there, but if user wants regular expression, he/she definitely wants the string too
#include "String.h"
#include <boost/regex.hpp>

namespace RealityStream
{
typedef boost::regex Regex;
# define RegexMatch boost::regex_match
}

#endif

Global.h just prototypes the classes (to lower depencies), and String.h just typedefs String to std::string. But String.h header is used everywhere and works flawlessly when used from any other header file.

Thanks in advance,
Martin Preisler

Discussion

  • Roman

    Roman - 2007-01-04

    Logged In: YES
    user_id=1084190
    Originator: NO

    Hello Martin. Thank you for nice words and bug reporting. I think I fixed the bug you are talking about. can you confirm this against SVN version?

    Thanks.

     
  • Kulik

    Kulik - 2007-01-05

    Logged In: YES
    user_id=1620918
    Originator: YES

    Confirmed, it works now.

     
  • Kulik

    Kulik - 2007-01-05
    • status: open --> closed-fixed
     

Log in to post a comment.