Home Help Center

Slice parser question

vukicevicvukicevic Member Vladimir VukicevicOrganization: DUGProject: DUG Insight ✭✭
I'm writing a new slice2* generator using the established framework (i.e. slice2cpp, slice2docbook, etc.). I'd like to have an option to generate stubs/wrappers for multiple Slice interface files in one file; for example, both slice/Ice/Current.ice and slice/Ice/Identity.ice, and I was planning on using Unit::mergeModules() to accomplish this, much like slice2docbook does. However, I'm running an include level problem -- Current.ice includes Identity.ice. If I give "Current.ice Identity.ice" as arguments to my generator, my visitStructStart() and visitStructEnd() methods get called for the Identity struct, but my visitDataMember() method does not get called. If I pass "Identity.ice Current.ice", all works as expected.

I'm going to look into the Slice parser, and see if I can put in a patch to have it update the inclue level if it is later asked to parse (as a top level document) something it has already seen via an include. However, I would assume that I shouldn't get the visitStructStart() and visitStructEnd() calls either, right? Is the parser already trying to update include levels, and just missing the data member levels?

Thanks,
-- Vlad

Comments

  • vukicevicvukicevic Member Vladimir VukicevicOrganization: DUGProject: DUG Insight ✭✭
    Re: Slice parser question

    Er, I really need to learn to look at the code in more depth before asking questions (though being on dialup that could blow up at any moment isn't helping things :)... it looks like Parser.cpp Slice::{ClassDef,Struct,...}::createDataMember() is missing an updateIncludeLevel() call in the if(_unit->ignRedefs()) { ... } block?
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    You are right. We will fix this.
Sign In or Register to comment.