Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about 'decl_string' and 'partial_decl_string' #46

Open
ghost opened this issue Apr 6, 2021 · 0 comments
Open

Question about 'decl_string' and 'partial_decl_string' #46

ghost opened this issue Apr 6, 2021 · 0 comments

Comments

@ghost
Copy link

ghost commented Apr 6, 2021

When trying to scan the bindings for a module (ns-3), I get an error with the tokens because it is None. Tracking down the error, I see the cast parser uses the partial declaration to normalize a name [normalize_name(alias.decl_type.partial_decl_string)]. However, the problem comes because the 'decl_string' and 'partial_decl_string' are different:

namespace ns3 {

struct GabA
{
  uint32_t m_varU {0};
  double m_varD {0.0};
};

struct GabD
{
  uint32_t m_varU {0};
  double m_varD {0.0};
};

typedef std::function<GabD & (const std::shared_ptr<GabA> &ga)> GabSharedFn;
typedef std::function<GabD & (const std::unique_ptr<GabA> &ga)> GabUniqueFn;
}

When the code is parsed, these are the decl_string and partial_decl_string for the two typedefs:

  1. GabSharedFn
partial_decl_string:'::std::function< ns3::GabD &(const std::shared_ptr< ns3::GabA > >'
decl_string:'::std::function<ns3::GabD &(const std::shared_ptr<ns3::GabA> &)>'
  1. GabUniqueFn
partial_decl_string:'::std::function< ns3::GabD &(const std::unique_ptr< ns3::GabA, std::default_delete< ns3::GabA > > >'
decl_string:'::std::function<ns3::GabD &(const std::unique_ptr<ns3::GabA, std::default_delete<ns3::GabA> > &)>'

As you can see, both partial declaration strings are missing &) and that is why I get the error. I had to hard-code this inside the typehandlers directory because I could not figure out where the classes are parsed (i.e., where partial_decl_string and decl_string are created). It seems to me that pygccxml takes care of that but I am not sure. Do you know where the partial_decl_string and decl_string are created?

I would appreciate your feedback.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants