Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Custom encoding name with spaces is not compiled
Custom encoding name with spaces is not compiled [message #1842034] Tue, 08 June 2021 00:19 Go to next message
Anton Kozhemyachenko is currently offline Anton KozhemyachenkoFriend
Messages: 16
Registered: June 2021
Junior Member
Hello,

In 3GPP TTCN files there are a bunch of custom encodings which contain spaces, e.g.:

EPS_NAS_MsgContainers.ttcn specifies the encoding of module as
with { encode "NAS Types"}


However, Titan compiler doesn't allow to compile such identifiers (since there is a space).

I'd like to avoid modifying 3GPP files to fix this issue, so the following patch in Titan resolves it:

diff --git a/compiler2/ttcn3/coding_attrib_la.l b/compiler2/ttcn3/coding_attrib_la.l
index a1087a9f9..8f1a42383 100644
--- a/compiler2/ttcn3/coding_attrib_la.l
+++ b/compiler2/ttcn3/coding_attrib_la.l
@@ -72,6 +72,7 @@ LINECOMMENT "//"[^\r\n]*
 WHITESPACE [ \t\v\f]
 NEWLINE \r|\n|\r\n
 IDENTIFIER [A-Za-z][A-Za-z0-9_]*
+IDENTIFIER2 [A-Za-z][A-Za-z0-9_ ]*
 NUMBER 0|[1-9][0-9]*
 
 %s SC_start
@@ -231,7 +232,7 @@ verdicttype RETURN(VerdictTypeKeyword);
     yylval.encoding_type = Type::CT_OER;
     RETURN(EncodingType);
   }
-  {IDENTIFIER} {
+  {IDENTIFIER2} {
     yylval.str = new string(yyleng, yytext);
     RETURN(CustomEncoding);
   }


Here I added a separate token IDENTIFIER2 which extends the identifier with spaces.

Could you please add such fix to the upstream?

Thanks
Re: Custom encoding name with spaces is not compiled [message #1842046 is a reply to message #1842034] Tue, 08 June 2021 08:19 Go to previous messageGo to next message
Olaf Bergengruen is currently offline Olaf BergengruenFriend
Messages: 128
Registered: November 2018
Senior Member
Hi Anton,
I have the same problem with the 3GPP MCPTT test suite.
One question:
- Did you verify that your extension works? I.e. you can compile and run and the right codecs are called during execution?

I assume that we will have to live with this and other small changes in the 3GPP test suites.
Regards,
Olaf
Re: Custom encoding name with spaces is not compiled [message #1842053 is a reply to message #1842046] Tue, 08 June 2021 08:56 Go to previous messageGo to next message
Anton Kozhemyachenko is currently offline Anton KozhemyachenkoFriend
Messages: 16
Registered: June 2021
Junior Member
Hi Olaf,

Sure, I verified it. The Titan repo is compiled on ToT with this patch, and the Titan compiler generates C++ files from TTCN correctly.
I can confirm, that with the patch external codecs with spaced names are called successfully from TTCN.
Re: Custom encoding name with spaces is not compiled [message #1843391 is a reply to message #1842053] Tue, 27 July 2021 14:10 Go to previous messageGo to next message
Adam Knapp is currently offline Adam KnappFriend
Messages: 54
Registered: November 2020
Member
Hi Anton,

Sorry for the late answer! Thanks for raising this issue and your solution. I created a GitLab issue: https://gitlab.eclipse.org/eclipse/titan/titan.core/-/issues/563
Re: Custom encoding name with spaces is not compiled [message #1843393 is a reply to message #1843391] Tue, 27 July 2021 15:18 Go to previous message
Anton Kozhemyachenko is currently offline Anton KozhemyachenkoFriend
Messages: 16
Registered: June 2021
Junior Member
Hi Adam,

Thank you very much.
Previous Topic:Project management tool for TTCN-3 project
Next Topic:A more enjoyable, productive and resource efficient way for working with TTCN-3
Goto Forum:
  


Current Time: Tue Nov 05 22:51:22 GMT 2024

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

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

Back to the top