Menu

#22 Moritz_Win_2020_06_10, XML parsing based on directory is not working

Moritz_2_0_1
closed
None
5
2021-07-26
2021-06-21
Lubos Hubka
No

Hallo !
I have came across your very helpful tool, but I found one significant problem, which prevent me to use it.

Good case:
Relative content of ansi_c_abc2xml_cfg.xml file:
<filename value="./src/main.c" root="SourcePath" donotskip="Yes">
<common name="Common" keepvalidecode="Implicit">
</common></filename>
Scenario: Run the abc2xml.exe for a specific file.
Result: About 500kB XML file is generated.
When I afterwards run the xml2abc, the NSD is generated and content is OK.

Bad case1:
Relative content of ansi_c_abc2xml_cfg.xml file:
<foldername value="./src/" root="SourcePath" fileattachment=".c" recursive="Yes" donotskip="Yes" common="Common" keepvalidecode="Implicit">
Scenario: Run the abc2xml.exe for a specific directory containing only one specific file(the same as in the good case)
Result: Only about 8kB file is generated.
When I afterwards run the xml2abc, the NSD is generated, but it is empty.</foldername>

Bad case2:
Scenario: I have tried to generate the XML by doxygen. I have used the attached Doxyfile_ansi_c_xml with modified "Input".
Result: About 140kB file is generated.
When I afterwards run the xml2abc, the NSD is not generated at all.

I would be obliged if the problem could be solved, because I need exactly such a tool to analyze our huge project.

Thanks and best regards.

Discussion

  • Eckard Klotz

    Eckard Klotz - 2021-06-22

    Hello Lubos Hubka .

    First of all the XML output of Doxygen is only used to add links to the Doxygen documentation if needed. But Moritz is not able to generate diagrams from it, since the structure is differing in detail.
    * Thus your case 2 is a normal case and no bug.

    For your case 1 please provide an example that contains complete file "ansi_c_abc2xml_cfg.xml" as well as an example source to reproduce your issue.
    * It may be helpful if you provide your good case also.

    Thanks for your understanding.

    Please stay well and healthy,
    Eckard Klotz.

     
  • Lubos Hubka

    Lubos Hubka - 2021-06-22

    Hallo Mr. Klotz!
    Thanks for the fast response.

    I'm sending my test environment.
    working_ansi_c_create.bat - good case
    not_working_ansi_c_create.bat - bad case1

    Stay negative!
    ;)
    Best regards.
    Lubos

     
  • Eckard Klotz

    Eckard Klotz - 2021-06-23

    Hello Lubos Hubka .

    Thanks for your zip-file.
    I will take a look to it but may be not before weekend.

    Stay negative also by keeping a positive mindset.

    Best regards,
    Eckard Klotz.

     
    👍
    1
  • Lubos Hubka

    Lubos Hubka - 2021-06-24

    kein problem.

     
  • Eckard Klotz

    Eckard Klotz - 2021-06-25

    Hello Lubos Hubka .

    The reason of your issue is not a bug but a wrong configuration.

    This is the folder configuration in your not working example:

     <Source>
      <!-- to use all c-files in the folder and its sub-folders -->
      <!-- FolderName value="./src/"   root="SourcePath"    fileAttachment=".c"    recursive="Yes"     doNotSkip="No"/ -->
      <FolderName value="./src/" 
                  root="SourcePath"
                  fileAttachment=".c" 
                  recursive="No" 
                  doNotSkip="Yes" 
    
                  Common="Common"
                  keepValideCode="Implicit" />  
     </Source>
    

    You have extended the list of attributes for the xml-node FolderName by adding the attributes Common and keepValideCode. But this additional attributes are not expected by the binary and will be simply ignored.

    The correct configuration of the preprocessor-behaviour will be done as you have done for the single file:

     <Source>
      <!-- to use all c-files in the folder and its sub-folders -->
      <!-- FolderName value="./src/"  root="SourcePath" fileAttachment=".c" recursive="Yes" doNotSkip="No"/ -->
      <FolderName value="./src/"  
                  root="SourcePath" 
                  fileAttachment=".c" 
                  recursive="No" 
                  doNotSkip="Yes"  >
    
        <Common name="Common"  
                               keepValideCode="Implicit"/>
    
      </FolderName>
     </Source>
    

    You have to add at least a sub-node called Common if your sources contain compiler switches (#if, #else, #endif, ...). For complex definitions of preprocessor constants you have to add Special nodes also which are referring to Variants

    This has to be done for folder configurations as well as for file configurations as you can read in the documentation in the chapter:

    • Using the configuration-files of abc2xml and xml2abc

    OK, the documentation is very huge. Thus I attached a reworked version of my introduction document you normally find here :

    If you use SVN you may also download my latest SVN archive here:

    • SVN Archive
    • You will find the Tutorials at :\trunk\distribution\Moritz\Development\Tutorials
    • The tutorials are a little bit reworked but actually not really changed.

    I hope this will solve your issue and provides you a little bit more clarification.

    Stay negative also by keeping a positive mindset.

    Best regards,
    Eckard Klotz.

     
  • Eckard Klotz

    Eckard Klotz - 2021-06-25
    • status: open --> pending
     
  • Eckard Klotz

    Eckard Klotz - 2021-06-25

    Hello Lubos Hubka .

    Please confirm that your issue is solved with my proposal.

    If you like to discuss some details around pleas open a new topic in the discussion forum since this bug topic will be not easily visible any more once i close it.

    Best regards,
    Eckard Klotz.

     
    • Lubos Hubka

      Lubos Hubka - 2021-06-27

      Hallo Mr. Klotz.
      Sorry for delay, during weekend I'm usually not working with the computer.

      And I'm sorry but I'm not sure I understood your answer.
      The NSD is not generated even when I omit the <Common name="Common" and keepValideCode="Implicit" from the config file.

      So now it looks like:

      <Source>
        <!-- to use all c-files in the folder and its sub-folders -->
        <!-- FolderName value="./src/"  root="SourcePath" fileAttachment=".c" recursive="Yes" doNotSkip="No"/ -->
        <FolderName value="./src/"  root="SourcePath" fileAttachment=".c" recursive="No" doNotSkip="Yes" />
      </Source>
      

      But nothing has changed.

      I will go again through the tutorials, but so far I see no solution.

      Thank you for your time.
      Have a nice rest of the weekend.

      Lubos

       

      Last edit: Lubos Hubka 2021-06-27
  • Lubos Hubka

    Lubos Hubka - 2021-06-27

    OK, I have also tried the config you proposed:

    <Source>
      <!-- to use all c-files in the folder and its sub-folders -->
      <!-- FolderName value="./src/"  root="SourcePath" fileAttachment=".c" recursive="Yes" doNotSkip="No"/ -->
      <FolderName value="./src/"  
                  root="SourcePath" 
                  fileAttachment=".c" 
                  recursive="No" 
                  doNotSkip="Yes"  >
    
        <Common name="Common"  
                               keepValideCode="Implicit"/>
    
      </FolderName>
     </Source>
    

    But the result is even worse - in previous run there was an empty HTML file generated. Now there is nothing.

    Have you tried the configuration? Did it worked for you? Because if yes, that means I have different version of moritz binaries than you.

     

    Last edit: Lubos Hubka 2021-06-27
  • Eckard Klotz

    Eckard Klotz - 2021-06-28

    Hello Lubos Hubka .

    Sorry for delay, during weekend I'm usually not working with the computer.

    • No issue week end is week end.

    And I'm sorry but I'm not sure I understood your answer.
    The NSD is not generated even when I omit the <Common name="Common" and keepValideCode="Implicit" from the config file.

    • I hope that the modification you have done before your second response has clarified this point for you.
    • The reason why you have to place the "Common" configuration in a sub-node is that this is potentially not the only thing you have to add for controlling how the parser is dealing with preprocessor directives like #If, #ifndef, #elif, ...
    But the result is even worse - in previous run there was an empty HTML file generated. Now there is nothing.
    
    • I could not confirm.
    • In my nsd-folder I get 9 html files 1 for the complete Main.cpp and 8 for the functions (I attached the xml as well as the nsd result).
    • Note in the batch-file you have provided you have commented out the call of doxygen and thus the content of the html folder is certainly empty.
    Have you tried the configuration? Did it worked for you? Because if yes, that means I have different version of moritz binaries than you.
    
    • I replaced your binaries by the last patched binaries.
    • But actually I don't think that this makes really a difference.

    How ever let's do it step by step.

    • As you already know Moritz contains 2 binaries with their own part-results.
    • Until now I understood, that you have a problem with abc2xml, what is responsible for creating the xml-files in the folder xml (in your case in the folder \xml\doxygen).
    • Now you are talking about html-files, which will be generated by xml2abc into the folder nsd in the case that you want to have nassi shneiderman diagrams.
    • For the further discussion please tell me if the xml-files are generated or not.
    • If this is the case and you have no html-content in the folder nsd , than we have a different case as discussed before.

    Stay well and healthy.

    Best regards,
    Eckard Klotz.

     
  • Lubos Hubka

    Lubos Hubka - 2021-06-28

    Hallo Mr Klotz.

    Well, then I'm making something terribly wrong.
    I have replaced mine binaries with last patched (bin_Windows_64bit_32bit.zip from 2020-12-23).

    But I still have no result.

    I think I have problem with abc2xml, because when I run not_working_ansi_c_create.bat and then working_ansi_c_create.bat, I get 2 completely different xml files - the content is different.

    Could you provide your "not_working_ansi_c_abc2xml_cfg.xml" file?
    Then I should be able to see what's wrong.

    Thanks.
    Best regards.
    Lubos

     

    Last edit: Lubos Hubka 2021-06-28
  • Eckard Klotz

    Eckard Klotz - 2021-06-29

    Hello Lubos Hubka .

    Could you provide your "not_working_ansi_c_abc2xml_cfg.xml" file?
    Then I should be able to see what's wrong.

    • Please find attached

    If this is still not helping you please read again the last part of my post before.

    • I mean "How ever let's do it step by step. ..."
    • In the case that you get no output it may be helpful for me if you would provide the log text-files.

    Stay well and healthy.

    Best regards,
    Eckard Klotz.

     
  • Lubos Hubka

    Lubos Hubka - 2021-07-01

    Hallo Mr. Klotz!

    I have got it! Pls. feel free to close this problem report.

    Many thanks.
    Best regards.
    Lubos

     
  • Eckard Klotz

    Eckard Klotz - 2021-07-02

    Hello Lubos Hubka .

    That's good to read.

    Could you give us a short description of your finding so that other users may learn from it?

    • Even the closing of this topic will move it from the list of active bugs to the list of closed ones interested users may still open it by entering the sub list of closed tickets.

    Stay well and healthy.

    Best regards,
    Eckard Klotz.

     
  • Lubos Hubka

    Lubos Hubka - 2021-07-26

    Hallo! Sorry for the delay, it's holiday time.
    So the problem was quite trivial:

    Mine wrong config:

    <Source>
        <FolderName value="./src/" root="SourcePath" fileAttachment=".c" recursive="Yes" doNotSkip="Yes"/>
     </Source>
    

    Yours working config

    <Source>
        <FolderName value="./src/" root="SourcePath" fileAttachment=".c" recursive="Yes" doNotSkip="Yes">
            <Common name="Common" keepValideCode="Implicit"/>
      </FolderName>
     </Source>
    
     
  • Lubos Hubka

    Lubos Hubka - 2021-07-26

    So, this did the trick:

    <Common name="Common" keepValideCode="Implicit"/>
    
     
  • Eckard Klotz

    Eckard Klotz - 2021-07-26

    Hello Lubos Hubka .

    Thanks for this short completion of the story.

    I will close this topic now.

    In the case that you face other issues could you pleas open an own topic for each issue in the discussion forum first.

    • We could than still decide afterwards if it is a bug or more a help-topic.
    • But it will easier for other newbies to find an to read the topic if they face a similar issue.

    Stay well and healthy.

    Best regards,
    Eckard Klotz.

     
  • Eckard Klotz

    Eckard Klotz - 2021-07-26
    • status: pending --> closed
     

Log in to post a comment.