Menu

new parser in C?

Anonymous
2016-01-27
2016-02-11
1 2 3 4 > >> (Page 1 of 4)
  • Anonymous

    Anonymous - 2016-01-27

    Good afternoon - I am coming from using and do small dev on StarUML and I noticed that this projecs has changed the parser libraries? are they written in C?
    I don't have the possibility to compile in C, what do I have to do in Pascal to include this library? I am stuck at a point where it prompts the error "[dcc32 Error] NXMgr.pas(146): E2291 Missing implementation of interface method IDispatch.GetTypeInfoCount" and other 3 mthods, plus "[dcc32 Fatal Error] ParserCore_TLB.pas(36): F2063 Could not compile used unit 'mscorlib_TLB.pas'". I also imported the .NET library mscorlib.dll but it does not matter, it does not want to compile - with the same errors. Any help? thank you in advance.

     
  • Janusz Szpilewski

    The old parser ProGrammar was dropped from the main program as being seriously outdated (discontinued development, 32 bit binary only).

    It is replaced now with a parser built on top of Gold Parser which generates code in C# and resides in its own DLL (ParserCore.dll). Normally all required libraries should be enclosed and I recently recompiled all program from SVN sources in a fresh virtual machine without any problems. As lots of COM boiler plate handlers are generated by Delphi the problem may come from using some other version than XE5. But again I had no problem with latest Delphi 10. Anyway maybe refreshing WhiteStarUML_TLB.pas (from WhiteStarUML.ridl design view) will help.

     
  • Anonymous

    Anonymous - 2016-01-27

    do I have to include the import folder in the library path?

     
  • Anonymous

    Anonymous - 2016-01-27

    I don't get the error... why the NXMgr.pas should implement interface methods of mscorlib.dll?
    Basically that's what the compiler is expecting...

     
  • Janusz Szpilewski

    IDispatch is a low level general usage COM (not .Net) interface usually implemented and used by Delphi to communicate between COM objects or with .Net exposed as COM. Rarely programmers have to care about it.

    The project comes with pre-created import folder and your errors do not mention missing TLB.pas files. But generally they should be visible and coherent with the Delphi version and the libraries they represent. When you import a COM lib, tick the checkbox to create wrappers.

    Btw. did you install WhiteStarUML before compiling sources? The installer registers some COM data and it could be missing.

     
  • Anonymous

    Anonymous - 2016-01-27

    yes, I did it :(
    but is it necessary to import the mscorlib.dll? Or shall I rely on the installer?
    Also for ParseCore.dll, shall I import it from the dll or from the registered one coming from the installation? Sorry to bother you and thank you

     
  • Anonymous

    Anonymous - 2016-01-27

    I used TAutoObject instead of TInterfacedObject and it compiled....

     
  • Anonymous

    Anonymous - 2016-01-27

    But by doing do, after launching the exe I get Type information missing for class EXprBuilder

     
  • Anonymous

    Anonymous - 2016-01-27

    Is the GoldParser just used for the nxt or also for other things (e.g. profiles, etc.)?

     
  • Janusz Szpilewski

    Hmm... Indeed TAutoObject provides implementation of IDispatch interface however it is not obvious why it may be required there as no dynamic calls are performed but well it is Delphi and there always may be some settings in the IDE altering the behaviour.

    From the point where you are find and delete (in staruml\src) WhiteStarUML.tlb and definitely StarUML.tlb if it is hanging somewhere. Recompilation should recretate it with the latest type info.
    Also check the text of WhiteStarUML.dpr if it contains line {$R *.TLB}.
    IDE sometimes deletes it.

     
    • Anonymous

      Anonymous - 2016-01-27

      Thanks, now it compiles. But I get some Access Violations and Invalid typecast when I run the exe.
      If I launch in debug mode and I break, I find the following line as the reason for the Invalid typecast:

      procedure TAutoObject.Initialize;
      begin
      FAutoFactory := Factory as TAutoObjectFactory;
      inherited Initialize;
      end;

      on System.Win.ComObj

      therefore I guess the use of TAutoObject for your class is not good.

      As a result - at the end - the exe is executed but I noticed that profiles like ERD are not loaded (wrong images etc.)

       
  • Janusz Szpilewski

    At the end of NxMgr.pas (line 3999) replace TTypedComObjectFactory.Create with TAutoObjectFactory.Create as well.

     
  • Anonymous

    Anonymous - 2016-01-27

    right!

    but now when I close it it says that there are still Active COM Objects

     
  • Janusz Szpilewski

    It looks like some problem with counting references but if everything else works well you can ignore it.

     
  • Anonymous

    Anonymous - 2016-01-27

    yes, thanks Janusz. I actually still have issues with profiles but it should not be related to this part, right?

     
  • Janusz Szpilewski

    Nx parser reads .nxt files in profiles so it is important there. It also handles text input in model creation. So check first if the parser is working at all by typing a class name with stereotype like
    <<my stereo="">> Myclass

     
  • Janusz Szpilewski

    Are you on a system with installed .Net 4.0 or later?

    If you are compiling for 32 bit version, try to re-register .Net dll:
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm ParserCore.dll /codebase

    On 64 bit:
    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\regasm ParserCore.dll /codebase

    See if it executes correctly.

     
  • Anonymous

    Anonymous - 2016-01-28

    RegAsm : error RA0000 : Unable to locate input assembly 'ParserCore.dll' or one of its dependencies.

     
  • Janusz Szpilewski

    It is located in the dir where you installed WhiteStarUML.

     
  • Anonymous

    Anonymous - 2016-01-28

    sorry, you are right.
    Now got "Types registered succesfully", but getting same result (no profile working).

     
  • Anonymous

    Anonymous - 2016-01-28

    it should read all the StarUML profiles, right? Nothing changed from an expression point of view?

     
  • Janusz Szpilewski

    Try setting a break in PNXManager.ReadExprWithGoldParser and see if anything strange happens there.

     
  • Anonymous

    Anonymous - 2016-01-28

    unfortunately there is the splash image covering themessage... in any case, it goes like this:

    exception classEOleExcpetion with message 'Unabel to cast COM object of type 'System.ComObject' to interface type 'WhiteStarUML.IExprBuilder'. This operation failed because QueryInterface call on the COM component for the inteface with IID ..... failed due to the following error: No such interface supported (Exception from HRESULT: ...)

     
  • Janusz Szpilewski

    Splash should not show up if you build the app in debug mode. There is also something wrong with the COM config. From whitestaruml.ridl in design mode push button like "register for ActiveX interop" maybe it will fix that.

     
1 2 3 4 > >> (Page 1 of 4)

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.