Welcome, Guest
Username: Password:
  • Page:
  • 1

TOPIC:

TTCN-3 grammar in Yacc recognisable format? 25 Oct 2002 08:54 #6242

Hello,
1. Does anybody give any reference where I can get TTCN-3 grammar in Yacc recognisable format. I have grammar in BNF format,which I got from the specifications.
2. How can I convert the following BNF grammar in Yacc rules.
TTCN3Module := TTNC3ModuleKeyword TTCN3ModuleID [ModuleParList]
BeginChar
[ModuleDefinitionsPart]
[ModuleControlPart]
EndChar
[WithStatement] [SemiColon]
In specific, my question is how can I indicate an optional production in Yacc rule.

regards,
Anil Krishna

Please Log in to join the conversation.

TTCN-3 grammar in Yacc recognisable format? 25 Oct 2002 12:01 #6243

Dear Anil,

I do not know of a source for what you are seeking, but I doubt that it would be of much use for you anyway. The BNF as given in the standard, is not meant to serve as an implementation grammar, at least not for a LR parser generator, as yacc is. You will need to transform it into a grammar that is amenable to LR analysis manually. These techniques are probably described in about every text book on compiler construction.

I think you might have more luck with an LL(k) parser generator (like ANTLR), which might be able to deal with a the standard's grammar (more) directly. I don't have any experience with this, though.

Finally, before you start tackling parser development for TTCN-3 with yacc, I suggest you try with a simpler language to get some yacc experience first, e.g., find out how to implement optionality, etc. I would certainly not recommend to use TTCN-3 as your first yacc project.

Best regards

Stephan

Original Message
From: ext AnilKrishna [This email address is being protected from spambots. You need JavaScript enabled to view it.]
Sent: Friday, October 25, 2002 10:54 AM
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: TTCN-3 grammar in Yacc recognisable format?



Hello,
1. Does anybody give any reference where I can get TTCN-3 grammar in Yacc recognisable format. I have grammar in BNF format,which I got from the specifications.
2. How can I convert the following BNF grammar in Yacc rules.
TTCN3Module := TTNC3ModuleKeyword TTCN3ModuleID [ModuleParList]
BeginChar
[ModuleDefinitionsPart]
[ModuleControlPart]
EndChar
[WithStatement] [SemiColon]
In specific, my question is how can I indicate an optional production in Yacc rule.

regards,
Anil Krishna

Please Log in to join the conversation.

TTCN-3 grammar in Yacc recognisable format? 25 Oct 2002 18:26 #6244

Stephen TOBIES wrote:
> Dear Anil,
>
> I do not know of a source for what you are seeking, but I doubt that it
> would be of much use for you anyway. The BNF as given in the standard,
> is not meant to serve as an implementation grammar, at least not for a
> LR parser generator, as yacc is. You will need to transform it into a
> grammar that is amenable to LR analysis manually. These techniques are
> probably described in about every text book on compiler construction.
>
> I think you might have more luck with an LL(k) parser generator (like
> ANTLR), which might be able to deal with a the standard's grammar (more)
> directly. I don't have any experience with this, though.

In case you opt for ANTLR, an ANTLR TTCN-3 grammar is available from:
http://www.itm.uni-
luebeck.de/research/main_projects/projects/single_projects/index.php?lang=en&pj_
nr=6&opj_nr=2

Best regards,
Helmut Neukirchen
--
Helmut Neukirchen This email address is being protected from spambots. You need JavaScript enabled to view it.
Institute for Telematics www.itm.uni-luebeck.de
University of Luebeck phone: +49 451 500 4867
Ratzeburger Allee 160, D-23538 Luebeck, Germany fax: +49 451 500 3722

Please Log in to join the conversation.

  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin