<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Bulat,<div class=""> will the c-language package do ? Its parser seems to be based on Happy?</div><div class=""><br class=""></div><div class=""><a href="http://hackage.haskell.org/package/language-c-0.8.1/docs/Language-C-Parser.html" class="">http://hackage.haskell.org/package/language-c-0.8.1/docs/Language-C-Parser.html</a></div><div class=""><br class=""></div><div class="">Regards, Andrew</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 20 Jun 2018, at 16:09, Bulat Ziganshin <<a href="mailto:bulat.ziganshin@gmail.com" class="">bulat.ziganshin@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hello all,<br class=""><br class="">I  develop  a preprocessor transpiling subset of C statements into gcc<br class="">_asm statements. For this project, I will be happy to reuse existing C<br class="">statements parser written with any popular Haskell technology, or just<br class="">start  with  some  simple  C  subset parser  in order to avoid redoing<br class="">existing work.<br class=""><br class="">Unfortunately,  so far I found grammars just for everything but C. And<br class="">while  I  can  start  with  Parsec grammars for Java/Go, it seems that<br class="">MegaParsec now is better choice?<br class=""><br class="">I  can  quickly  develop  grammar for small C subset, but ready-to-use<br class="">grammar  for  larger  C  subset  will  allow me to completely skip the<br class="">development  of  C statement parser and focus on the meat of project -<br class="">asm code generation.   <br class=""><br class="">Eventually,  it may turn into LLVM pass transpiling parts of C++ code,<br class="">but  for  quick  prototype, I prefer Haskell, especially if I can find<br class="">ready-to-use parser.<br class=""><br class="">PS:   It  was  the  first  time  I ever asked at SO, but it turned out<br class="">to be offtopic there:<br class=""><a href="https://stackoverflow.com/questions/50949118/simple-c-grammar-for-haskell-parsec-megaparsec-or-happy" class="">https://stackoverflow.com/questions/50949118/simple-c-grammar-for-haskell-parsec-megaparsec-or-happy</a> <br class=""><br class="">-- <br class="">Best regards,<br class=""> Bulat                          <a href="mailto:Bulat.Ziganshin@gmail.com" class="">mailto:Bulat.Ziganshin@gmail.com</a><br class=""><br class="">_______________________________________________<br class="">Haskell-Cafe mailing list<br class="">To (un)subscribe, modify options or view archives go to:<br class=""><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" class="">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br class="">Only members subscribed via the mailman list are allowed to post.</div></div></blockquote></div><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">--------------------------------------------------------------------<br class="">Andrew Butterfield     Tel: +353-1-896-2517     Fax: +353-1-677-2204<br class="">Lero@TCD, Head of Foundations & Methods Research Group<br class="">School of Computer Science and Statistics,<br class="">Room G.39, O'Reilly Institute, Trinity College, University of Dublin<br class="">                         <a href="http://www.scss.tcd.ie/Andrew.Butterfield/" class="">http://www.scss.tcd.ie/Andrew.Butterfield/</a><br class="">--------------------------------------------------------------------</div>
</div>
<br class=""></div></body></html>