From c048fa32367a78d266d2e35a0bfc909dc6c635ca Mon Sep 17 00:00:00 2001
From: Sophie Coudert <sophie.coudert@telecom-paris.fr>
Date: Mon, 25 Nov 2024 13:56:23 +0100
Subject: [PATCH] add test with raw names

---
 src/main/java/avatartranslator/tosysmlv2/Avatar2SysML.java  | 5 +++--
 .../avatartranslator/tosysmlv2/AvatarFromSysMLLexer.java    | 4 ++--
 .../avatartranslator/tosysmlv2/AvatarFromSysMLSyntax.java   | 2 +-
 .../tosysmlv2/javacup/AvatarFromSysML.jflex                 | 1 -
 ttool/src/test/java/cli/CLIAvatar2SysMLV2Test.java          | 6 +++---
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/main/java/avatartranslator/tosysmlv2/Avatar2SysML.java b/src/main/java/avatartranslator/tosysmlv2/Avatar2SysML.java
index c4dfa434c1..556c3bef1e 100644
--- a/src/main/java/avatartranslator/tosysmlv2/Avatar2SysML.java
+++ b/src/main/java/avatartranslator/tosysmlv2/Avatar2SysML.java
@@ -432,8 +432,9 @@ public class Avatar2SysML {
                 // one Message per direction, parallel build in two buffers msg1Buf and msg2Buf
 
                 // put declaration headers
-                StringBuffer msg1Buf = new StringBuffer(indentation + "\n// Message of signal " + blk1SysMLname + "." + sig1SYSMLname + "............\n");
-                StringBuffer msg2Buf = new StringBuffer(indentation + "\n// Message of signal " + blk2SysMLname  + "." + sig2SYSMLname + "............\n");
+                StringBuffer msg1Buf = new StringBuffer("\n" + indentation + "// Message of signal " + blk1SysMLname + "." + sig1SYSMLname + "..." +
+                        ".........\n");
+                StringBuffer msg2Buf = new StringBuffer("\n" + indentation + "// Message of signal " + blk2SysMLname  + "." + sig2SYSMLname + "............\n");
                 if (out2in) {
                     msg1Buf.append(indentation + "part def " + message1SYSMLname + " :> '#OutMessage', " + message2SYSMLname + " {\n");
                     msg2Buf.append(indentation + "part def " + message2SYSMLname + " :> '#InMessage' {\n" +
diff --git a/src/main/java/avatartranslator/tosysmlv2/AvatarFromSysMLLexer.java b/src/main/java/avatartranslator/tosysmlv2/AvatarFromSysMLLexer.java
index efaf74ccf4..96959ffa2e 100644
--- a/src/main/java/avatartranslator/tosysmlv2/AvatarFromSysMLLexer.java
+++ b/src/main/java/avatartranslator/tosysmlv2/AvatarFromSysMLLexer.java
@@ -1,4 +1,4 @@
-/* The following code was generated by JFlex 1.4.3 on 21/11/2024 16:53 */
+/* The following code was generated by JFlex 1.4.3 on 25/11/2024 13:53 */
 
 /* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille
  *
@@ -47,7 +47,7 @@ import avatartranslator.tosysmlv2.AvatarFromSysMLSyntax.*;
 /**
  * This class is a scanner generated by 
  * <a href="http://www.jflex.de/">JFlex</a> 1.4.3
- * on 21/11/2024 16:53 from the specification file
+ * on 25/11/2024 13:53 from the specification file
  * <code>__AvatarFromSysMLLexer__.jflex</code>
  */
 public class AvatarFromSysMLLexer implements java_cup.runtime.Scanner {
diff --git a/src/main/java/avatartranslator/tosysmlv2/AvatarFromSysMLSyntax.java b/src/main/java/avatartranslator/tosysmlv2/AvatarFromSysMLSyntax.java
index 88e7e7d00c..335c8d5355 100644
--- a/src/main/java/avatartranslator/tosysmlv2/AvatarFromSysMLSyntax.java
+++ b/src/main/java/avatartranslator/tosysmlv2/AvatarFromSysMLSyntax.java
@@ -225,7 +225,7 @@ public class AvatarFromSysMLSyntax {
         private void setTypeName(byte _type, String _smlName) {
             type = _type;
             if (type == AVATARNAME) {
-                sysMLName = _smlName;
+                 sysMLName = _smlName;
                 avatarName = _smlName;
             } else {
                 sysMLName = _smlName.substring(1, _smlName.length() - 1);
diff --git a/src/main/java/avatartranslator/tosysmlv2/javacup/AvatarFromSysML.jflex b/src/main/java/avatartranslator/tosysmlv2/javacup/AvatarFromSysML.jflex
index 081d157ac3..650bb1ea0e 100644
--- a/src/main/java/avatartranslator/tosysmlv2/javacup/AvatarFromSysML.jflex
+++ b/src/main/java/avatartranslator/tosysmlv2/javacup/AvatarFromSysML.jflex
@@ -417,7 +417,6 @@ timerBlockName = "'@tmr:" {AvIdent} "'"
   {timerBlockName}            { return makeSymbol(#Symb.IDENT, new Ident(AvatarFromSysMLSyntax.TIMERBLOCKNAME,yytext())); }
   {fieldName}                 { return makeSymbol(#Symb.IDENT, new Ident(AvatarFromSysMLSyntax.QUOTEDNAME,yytext())); }
   {AvIdent}                   { return makeSymbol(#Symb.IDENT, new Ident(AvatarFromSysMLSyntax.AVATARNAME,yytext())); }
-  "'"{AvIdent}"'"             { return makeSymbol(#Symb.IDENT, new Ident(AvatarFromSysMLSyntax.AVATARNAME,yytext())); }
   "'"[^']+"'"                  { String s = yytext();
                                 return makeSymbol(#Symb.ANYNAME, s.substring(1, s.length() - 1)); }
  . { setErrorLocation(new Location(yyline, yycolumn));
diff --git a/ttool/src/test/java/cli/CLIAvatar2SysMLV2Test.java b/ttool/src/test/java/cli/CLIAvatar2SysMLV2Test.java
index 1ebe642040..d29d8641ce 100644
--- a/ttool/src/test/java/cli/CLIAvatar2SysMLV2Test.java
+++ b/ttool/src/test/java/cli/CLIAvatar2SysMLV2Test.java
@@ -71,9 +71,9 @@ public class CLIAvatar2SysMLV2Test extends AbstractTest implements InterpreterOu
     final static String PATH_TO_EXPECTED_FILE = "cli/expected/";
     final static String PATH_TO_MODELS = "cli/models/";
     private final String[] toThenFrom = {"CoffeeMachine_Avatar", "avSysML_mixedexample", "PressureController"}; //
-    private final String[] okFrom = {"avSysML_withTimer"}; //
-    private final int[] okFromStates = {8};
-    private final int[] okFromTrans = {8};
+    private final String[] okFrom = {"avSysML_withTimer","avSysML_timerRealNames" }; //
+    private final int[] okFromStates = {8,8};
+    private final int[] okFromTrans = {8,8};
     private final String[] errorFrom =
             {"avSysML_syntaxErr1", "avSysML_syntaxErr2", "avSysML_missingBlockErr3", "avSysML_badFieldNameErr4",
                     "avSysML_missingSignalBindingErr5","avSysML_missingAttrDeclErr6", "avSysML_missingOutMsgErr7",
-- 
GitLab