From 9d56066c2d6b17b401ca87adab57891a736dd443 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Wed, 30 Sep 2020 17:15:14 +0200 Subject: [PATCH] Allow consecutives '_' in VST identifiers. Replace '/' by '_'. --- crlcore/src/ccore/alliance/vst/VstParserScanner.ll | 2 +- crlcore/src/ccore/toolbox/NamingScheme.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/crlcore/src/ccore/alliance/vst/VstParserScanner.ll b/crlcore/src/ccore/alliance/vst/VstParserScanner.ll index 3131d56d..1750fbd8 100644 --- a/crlcore/src/ccore/alliance/vst/VstParserScanner.ll +++ b/crlcore/src/ccore/alliance/vst/VstParserScanner.ll @@ -228,7 +228,7 @@ base_specifier (B|b|O|o|X|x) \. { return Dot; } \/ { return Slash; } -{letter}(_?{letter_or_digit})* { +{letter}(_|{letter_or_digit})* { char keyword[512]; strncpy( keyword, yytext, 511 ); lower( keyword ); diff --git a/crlcore/src/ccore/toolbox/NamingScheme.cpp b/crlcore/src/ccore/toolbox/NamingScheme.cpp index 3670e400..0d276494 100644 --- a/crlcore/src/ccore/toolbox/NamingScheme.cpp +++ b/crlcore/src/ccore/toolbox/NamingScheme.cpp @@ -1,14 +1,14 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC 2008-2018, All Rights Reserved +// Copyright (c) UPMC 2008-2020, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | // | Alliance / Hurricane Interface | // | | // | Author : Jean-Paul CHAPUT | -// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | +// | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | // | C++ Module : "./toolbox/ToVhdlName.h" | // +-----------------------------------------------------------------+ @@ -72,6 +72,7 @@ namespace CRL { vhdlName += 'n'; if (translated == '\\') translated = '_'; + if (translated == '/' ) translated = '_'; if (translated == '.' ) translated = '_'; if (translated == '%' ) translated = '_'; if (translated == '$' ) translated = '_'; @@ -83,7 +84,7 @@ namespace CRL { if (translated == '_') { if (vhdlName.empty() ) continue; if (i == refName.size()-1) break; - if (vhdlName.back() == '_') continue; + //if (vhdlName.back() == '_') continue; } vhdlName += translated;