Custom encoding name with spaces is not compiled [message #1842034] |
Tue, 08 June 2021 00:19 |
Anton Kozhemyachenko 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
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04413 seconds