Hi! It's nice to hear this. As Mariano said, I started to work in something like this some months ago, but I couldn't make something useful yet because I don't have much free time. I can give you a hand if you need. I don't know about OS Process, but I have some experience with FFI, so I'll look for some examples. I also have some questions,<div>
<br><div>- how did you implement the parser, by hand or with a framework?</div><div>- did you implement a preprocessor or used the output of something like CPP?<br>- what about the output of the parser, do you create an AST?</div>
<div><br></div><div>Regards,</div><div> Javier</div><div><br><div class="gmail_quote">On Fri, Jun 17, 2011 at 1:34 PM, Dave Mason <span dir="ltr"><<a href="mailto:dmason@mason-rose.ca">dmason@mason-rose.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I'm working on making a clean interface layer on top of FFI (and possibly Alien and NativeBoost).<br>
<br>
It will look something like:<br>
<br>
FFIParse createFFI: #System category: 'My-Category' library: 'System'.<br>
System parseSystemHeader: 'sys/resource.h'.<br>
rusage := System struct: #rusage.<br>
System getrusage: 0 with: rusage.<br>
Transcript show: 'Used ';<br>
show: rusage ru_utime tv_sec;<br>
show: '.';<br>
show: rusage ru_utime tv_usec;<br>
show: ' seconds of user CPU time';<br>
cr.<br>
System parseSystemHeaer: 'unistd.h';<br>
sleep: 5.<br>
pid := System getpid<br>
<br>
I have a very compact, almost compete C header parser but I need to be able to get the output from<br>
popen("echo \"#include <unistd.h>\"|gcc -E -","r")<br>
or equivalent. The popen is easy enough to get at through FFI, but is there a way to connect either the FILE* or the file descriptor up to some ReadStream. In the worst case, I could probably use FFI to call fread(3) but is there a better way?<br>
<br>
I'd also appreciate any simple examples of using FFI, especially with ExternalStructure subclasses.<br>
<br>
Finally is there a way to get external variables such as 'extern int errno;' ?<br>
<br>
Thanks in advance!<br><font color="#888888">
<br>
../Dave<br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Javier Pimás<br>Ciudad de Buenos Aires<br>
</div></div>