Note that there are some explanatory texts on larger screens.

plurals
  1. POC to java file reading and printing
    text
    copied!<p>I have a C code which is the following output:</p> <p>INPUT: <code>./includeCrawler -Itest s_01.c</code></p> <p>OUTPUT: <code>s_01.o: s_01.c i_60.h i_44.h i_46.h i_04.h i_51.h i_15.h i_33.h i_29.h i_16.h</code></p> <pre><code>S_01.c: #include "i_60.h" #include "i_44.h" #include "i_46.h" #include "i_04.h" #include "i_51.h" #include "i_15.h" #include &lt;stdio.h&gt; #include &lt;string.h&gt; #include &lt;stdlib.h&gt; #include &lt;unistd.h&gt; #include &lt;time.h&gt; #include &lt;sys/time.h&gt; #include &lt;arpa/inet.h&gt; #include &lt;sys/types.h&gt; #include &lt;signal.h&gt; i_60.c #ifndef _I_60_H_ #define _I_60_H_ #include "i_33.h" #include "i_04.h" #include "i_29.h" #include &lt;stdio.h&gt; #endif /* _I_60_H_ */ </code></pre> <p>Im trying to convert this into java whereby it reads in a file for eg s_01.c and it will print the above output. The file itself will read all the i.h and output it. If there's dependencies such as if the program read s_01.c it will read the files inside s_01.c and it will read #include "i_60.h" inside it and then it will go to i_60.h and find more i's related stuff.. it will continue to do so until it cannot find anymore i's pathway.</p> <p>Here is what i've done so far: I have successfully read for eg 1 file and print out all things related to i and then i threw it into a linkedlist.. However i do not know how to proceed to call each other files and then printout.</p> <pre><code>read: s_02.c Output: [i_02.h] [i_02.h, i_52.h] [i_02.h, i_52.h] [i_02.h, i_52.h] [i_02.h, i_52.h, i_51.h] [i_02.h, i_52.h, i_51.h] [i_02.h, i_52.h, i_51.h] [i_02.h, i_52.h, i_51.h] [i_02.h, i_52.h, i_51.h, i_03.h] [i_02.h, i_52.h, i_51.h, i_03.h, i_41.h] </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload