Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » SystemC to Promela transformer
SystemC to Promela transformer [message #1328303] Fri, 02 May 2014 16:21 Go to next message
Reza Sheykhi is currently offline Reza SheykhiFriend
Messages: 3
Registered: May 2014
Junior Member
Hi,

I want to get a SystemC program as an input and generate its equal Promela code as an output. SystemC is a library in C++ and Promela is a formal language. To do so, I could find several options: Xtext, Antlr, and LLVM. I am not sure which option is the best and easier/faster to get this project done.

If I use Xtext, I need to write everything from scratch, which needs a lot of efforts. also using LLVM as a parser is very complicated since LLVM is a complex parser.

Would you please help me to find the right way to do this. If I want to use Xtext, do I need to use the whole C++ grammar?

Thanks,
Reza


Re: SystemC to Promela transformer [message #1328528 is a reply to message #1328303] Fri, 02 May 2014 18:52 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Do not write a new C++ parser; it will take a very very long time to get
right.

You certainly need necessarily all of the C++ grammar and a good C++
preprocessor too.

You should re-use an existing C++ parser, (g++ if you refuse to invest
in a good commercial offering).

If you really insist on writing a parser use an LALR grammar and my C++
grammar, which is the only yaccable implementation
(http://www.parashift.com/c++-faq/yaccable-grammar.html). Read chapter 4
of my thesis
http://www.computing.surrey.ac.uk/research/dsrg/fog/FogThesis.pdf

Regards

Ed Willink


On 02/05/2014 19:39, Reza Sheykhi wrote:
> Hi,
>
> I want to get a SystemC program as an input and generate its equal
> Promela code as an output. SystemC is a library in C++ and Promela is
> a formal language. To do so, I could find several options: Xtext,
> Antlr, and LLVM. I am not sure which option is the best and
> easier/faster to get this project done.
> If I use Xtext, I need to write everything from scratch, which needs a
> lot of efforts. also using LLVM as a parser is very complicated since
> LLVM is a complex parser.
> Would you please help me to find the right way to do this. If I want
> to use Xtext, do I need to use the whole C++ grammar?
>
> Thanks,
> Reza
>
>
>
Re: SystemC to Promela transformer [message #1328542 is a reply to message #1328303] Fri, 02 May 2014 19:00 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
did you have a look at mbeddr?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: SystemC to Promela transformer [message #1334802 is a reply to message #1328542] Mon, 05 May 2014 19:15 Go to previous messageGo to next message
Reza Sheykhi is currently offline Reza SheykhiFriend
Messages: 3
Registered: May 2014
Junior Member
Ed,

If I want to use the current C++ parsers what do you suggest as the starting point? Do you suggest any specific parser (other than g++)? The input of my problem is a SystemC program, which is a very complicated C++ program. I want to generate an equivalent Timed-Automata or Promela code.

Reza
Re: SystemC to Promela transformer [message #1334811 is a reply to message #1334802] Mon, 05 May 2014 19:19 Go to previous messageGo to next message
Reza Sheykhi is currently offline Reza SheykhiFriend
Messages: 3
Registered: May 2014
Junior Member
Christian,

I haven't seen this technology before. As I could understand from their website, mbeddr is a technology stack that supports extension of C. Does it also support systemC? If yes, how can I generate the equal target model (either Timed-Automata or Promela) using mbeddr?

Reza
Re: SystemC to Promela transformer [message #1334886 is a reply to message #1334811] Mon, 05 May 2014 20:03 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
I think you should ask it in the mbeddr community (I don't know if
they already have an eclipse forum)

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Builder to maintain index of EMF Resources
Next Topic:DSL-Editor not found in runtime-workbench
Goto Forum:
  


Current Time: Fri Apr 19 22:30:48 GMT 2024

Powered by FUDForum. Page generated in 0.03974 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top