Reza_sh Posted December 10, 2012 Report Share Posted December 10, 2012 Hi, I am trying to write a SystemC/TLM front-end. To do so, I need SystemC grammar (at least the TLM part). Does anybody know how and where I can find it? Thank you, Reza Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted December 10, 2012 Report Share Posted December 10, 2012 SystemC(/TLM) is not a first-class language on its own. Instead, it is a C++ class library. Therefore, you can find the language definition in the C++ standard itself, see http://isocpp.org/std/the-standard). That said, you should probably not try to write a C++ parser from scratch. Instead, you may want to look at existing (open-source) parsers, like Clang/LLVM or GCC. There are several projects working on reconstructing the SystemC elements from a C++/SystemC model (SystemC frontends). There has been an overview paper at FDL'2010 about this (Maguet et.al, A Theoretical and Experimental Review of SystemC Front-ends"). Greetings from Oldenburg, Philipp maehne 1 Quote Link to comment Share on other sites More sharing options...
Reza_sh Posted December 12, 2012 Author Report Share Posted December 12, 2012 Thanks Philipp for your reply. However, working with the whole grammar takes lots of time and I don't want to write a parser for the whole language. I want to parse just a SystemC/TLM program. I've seen several tools that work with gcc to parse a SystemC/TLM program, but I could not find the grammar that they use (maybe they are using a C++ grammar). Do you know any reference or resource for just the SystemC/TLM part? Thank you, Reza Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted December 12, 2012 Report Share Posted December 12, 2012 Hmm, how would the grammar of "just a SystemC/TLM program" be simpler than parsing plain C++? I'd say that if you indeed would want to define a specific grammar for SystemC/TLM programs, this would be way more complex instead. IMHO, any (decent) SystemC/TLM language frontend needs to contain (or be based on) a plain C++ frontend. For detailed references to existing projects, you should check the references in the survey paper I mentioned. Greetings from Oldenburg, Philipp Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.