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

Parsing error when namespaces found in headers #20

Closed
KuennekeS opened this issue May 1, 2014 · 11 comments
Closed

Parsing error when namespaces found in headers #20

KuennekeS opened this issue May 1, 2014 · 11 comments

Comments

@KuennekeS
Copy link

We have header files that already belong to existing namespaces. As soon as the parser encounters anything that is namespaced it crashes with the following output.

(INFO) Parsing ["testing.h"]
/home/tmux/.rvm/gems/ruby-1.9.3-p545@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:220: warning: Insecure world writable dir /opt/tools in PATH, mode 040777
/home/tmux/.rvm/gems/ruby-1.9.3-p545@global/gems/bundler-1.5.3/lib/bundler.rb:295: warning: Insecure world writable dir /opt/tools in PATH, mode 040777
/home/tmux/.rvm/gems/ruby-1.9.3-p545/bundler/gems/rbgccxml-da76add8d536/lib/rbgccxml/sax_parser.rb:46:in `const_get': uninitialized constant RbGCCXML::NamespaceAlias (NameError)
    from /home/tmux/.rvm/gems/ruby-1.9.3-p545/bundler/gems/rbgccxml-da76add8d536/lib/rbgccxml/sax_parser.rb:46:in `start_element'
    from /home/tmux/.rvm/gems/ruby-1.9.3-p545/gems/nokogiri-1.5.9/lib/nokogiri/xml/sax/document.rb:116:in `start_element_namespace'
    from /home/tmux/.rvm/gems/ruby-1.9.3-p545/gems/nokogiri-1.5.9/lib/nokogiri/xml/sax/parser.rb:95:in `parse_with'
    from /home/tmux/.rvm/gems/ruby-1.9.3-p545/gems/nokogiri-1.5.9/lib/nokogiri/xml/sax/parser.rb:95:in `parse_io'
    from /home/tmux/.rvm/gems/ruby-1.9.3-p545/gems/nokogiri-1.5.9/lib/nokogiri/xml/sax/parser.rb:82:in `parse'
    from /home/tmux/.rvm/gems/ruby-1.9.3-p545/bundler/gems/rbgccxml-da76add8d536/lib/rbgccxml/sax_parser.rb:15:in `parse'
    from /home/tmux/.rvm/gems/ruby-1.9.3-p545/bundler/gems/rbgccxml-da76add8d536/lib/rbgccxml/parser.rb:67:in `parse'
    from /home/tmux/.rvm/gems/ruby-1.9.3-p545/bundler/gems/rbgccxml-da76add8d536/lib/rbgccxml/rbgccxml.rb:27:in `parse'
    from /home/tmux/.rvm/gems/ruby-1.9.3-p545/bundler/gems/rbplusplus-82d025aa0232/lib/rbplusplus/extension.rb:163:in `sources'
    from generate.rb:6:in `block in <main>'
    from /home/tmux/.rvm/gems/ruby-1.9.3-p545/bundler/gems/rbplusplus-82d025aa0232/lib/rbplusplus/extension.rb:82:in `call'
    from /home/tmux/.rvm/gems/ruby-1.9.3-p545/bundler/gems/rbplusplus-82d025aa0232/lib/rbplusplus/extension.rb:82:in `initialize'
    from generate.rb:5:in `new'
    from generate.rb:5:in `<main>'

It seems rbgccxml is missing some constants that are produced from nokogiri?

@jasonroelofs
Copy link
Owner

Must be, I've never seen the NamespaceAlias tag before. What version / build of gcc-xml are you using?

@KuennekeS
Copy link
Author

GCC-XML version 0.9.0

@jasonroelofs
Copy link
Owner

And could I see the header files in question, or an example that shows this failure?

@KuennekeS
Copy link
Author

@jasonroelofs
Copy link
Owner

Cool, thanks. I'll see what I can do about that.

@KuennekeS
Copy link
Author

I added the following to rbgccxml/nodes/namespace.rb and it at least compiles. I've yet to test the result though.

class NamespaceAlias < Node
end

@KuennekeS
Copy link
Author

Also is there a way to wrap something that is in a nested namespace such as...

namesapce foo {
  namespace bar {
    // stuff i want to wrap
  }
}

@jasonroelofs
Copy link
Owner

That should just work. Are you seeing otherwise?

@KuennekeS
Copy link
Author

It was not resolving the namespace. It might be because the foo:bar namespace was linking to a library we install. Not quite sure, ended up re-factoring to have everything use the test namespace.

The generated code is working now, just working on getting it to tie in properly with our tests.

@jasonroelofs
Copy link
Owner

rbgccxml 1.0.4 is out that supports NamespaceAlias nodes.

@KuennekeS
Copy link
Author

Yep. Tested it out and it is working great. If I have continued troubles
with nested name spacing I'll file a separate issue.

Thanks for the quick feedback and commit.
On May 5, 2014 12:35 PM, "Jason Roelofs" notifications@github.com wrote:

rbgccxml 1.0.4 is out that supports NamespaceAlias nodes.


Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-42207707
.

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

2 participants