/******************************************************************************
- * Copyright (c) 2000-2015 Ericsson Telecom AB
+ * Copyright (c) 2000-2016 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Baji, Laszlo
+ * Balasko, Jeno
+ * Baranyi, Botond
+ * Beres, Szabolcs
+ * Delic, Adam
+ * Forstner, Matyas
+ * Kovacs, Ferenc
+ * Pandi, Krisztian
+ * Raduly, Csaba
+ * Szabados, Kristof
+ * Szabo, Bence Janos
+ * Szabo, Janos Zoltan – initial implementation
+ * Szalai, Gabor
+ * Zalanyi, Balazs Andor
+ *
******************************************************************************/
%option noyywrap
%option never-interactive
/* Example: fe80::c002:37ff:fe6c:0%fastethernet0/0 */
IPV6 [0-9A-Fa-f:.]+(%[0-9A-Za-z]+)?
+UID [uU][+]?[0-9A-Fa-f]{1,8}
+
TTCNSTRINGPARSING "$#&&&(#TTCNSTRINGPARSING$#&&^#% "
TTCNSTRINGPARSING_COMPONENT "$#&&&(#TTCNSTRINGPARSING_COMPONENT$#&&^#% "
%x SC_commentblock SC_cstring SC_DEFINE
%s SC_MODULE_PARAMETERS SC_LOGGING SC_TESTPORT_PARAMETERS SC_EXECUTE SC_GROUPS
%s SC_COMPONENTS SC_EXTERNAL_COMMANDS SC_MAIN_CONTROLLER SC_INCLUDE SC_ORDERED_INCLUDE
-%s SC_STRING2TTCN_COMPONENT SC_PROFILER
+%s SC_STRING2TTCN_COMPONENT SC_PROFILER SC_CHAR_KEYWORD
%%
{NUMBER} {
yylval.int_val = new int_val_t(yytext);
- if (YY_START == SC_MODULE_PARAMETERS) {
+ if (YY_START == SC_MODULE_PARAMETERS || YY_START == SC_CHAR_KEYWORD) {
// return a different token for module parameters so it doesn't conflict with references
return MPNumber;
}
{FLOAT} {
yylval.float_val = atof(yytext);
- if (YY_START == SC_MODULE_PARAMETERS) {
+ if (YY_START == SC_MODULE_PARAMETERS || YY_START == SC_CHAR_KEYWORD) {
// return a different token for module parameters so it doesn't conflict with references
return MPFloat;
}
break;
default:
set_ret_val_cstr(cstring);
- if (caller_state == SC_MODULE_PARAMETERS) {
+ if (caller_state == SC_MODULE_PARAMETERS || caller_state == SC_CHAR_KEYWORD) {
// return a different token for module parameters so it doesn't conflict with references
return MPCstring;
}
BEGIN(caller_state);
if (caller_state!=SC_DEFINE) {
set_ret_val_cstr(cstring);
- if (caller_state == SC_MODULE_PARAMETERS) {
+ if (caller_state == SC_MODULE_PARAMETERS || caller_state == SC_CHAR_KEYWORD) {
// return a different token for module parameters so it doesn't conflict with references
return MPCstring;
}
}
}
+<SC_CHAR_KEYWORD>
+{
+ {UID} {
+ yylval.str_val = mcopystrn(yytext, yyleng);
+ return UIDval;
+ }
+
+ [,] { return *yytext; }
+
+ [)] { BEGIN(SC_MODULE_PARAMETERS); return *yytext; }
+}
+
/* Section-wide keywords */
<SC_MODULE_PARAMETERS>
{
NULL return NULLKeyword;
null return nullKeyword;
-char return CharKeyword;
+char { BEGIN(SC_CHAR_KEYWORD); return CharKeyword; }
objid return ObjIdKeyword;
omit return OmitKeyword;
none {
[Ee]mergency[Ll]ogging[Mm]ask return EmergencyLoggingMask;
+[Ee]mergency[Ll]ogging[Ff]or[Ff]ail[Vv]erdict return EmergencyLoggingForFailVerdict;
+
[Ff]ile[Mm]ask return FileMask;
[Cc]onsole[Mm]ask return ConsoleMask;
yylval.logseverity_val = TTCN_Logger::DEBUG_TESTPORT;
return LoggingBit;
}
+DEBUG_USER {
+ yylval.logseverity_val = TTCN_Logger::DEBUG_USER;
+ return LoggingBit;
+ }
+DEBUG_FRAMEWORK {
+ yylval.logseverity_val = TTCN_Logger::DEBUG_FRAMEWORK;
+ return LoggingBit;
+ }
DEBUG_UNQUALIFIED {
yylval.logseverity_val = TTCN_Logger::DEBUG_UNQUALIFIED;
return LoggingBit;
"this context.");
yylval.int_val = new int_val_t((RInt)0);
}
- if (YY_START == SC_MODULE_PARAMETERS) {
+ if (YY_START == SC_MODULE_PARAMETERS || YY_START == SC_CHAR_KEYWORD) {
// return a different token for module parameters so it doesn't conflict with references
return MPNumber;
}
"this context.");
yylval.float_val = 0.0;
}
- if (YY_START == SC_MODULE_PARAMETERS) {
+ if (YY_START == SC_MODULE_PARAMETERS || YY_START == SC_CHAR_KEYWORD) {
// return a different token for module parameters so it doesn't conflict with references
return MPFloat;
}
"this context.");
yylval.charstring_val.n_chars = 0;
yylval.charstring_val.chars_ptr = memptystr();
- if (YY_START == SC_MODULE_PARAMETERS) {
+ if (YY_START == SC_MODULE_PARAMETERS || YY_START == SC_CHAR_KEYWORD) {
// return a different token for module parameters so it doesn't conflict with references
return MPCstring;
}
yylval.charstring_val.n_chars=0;
yylval.charstring_val.chars_ptr=memptystr();
Free(macroname);
- if (YY_START == SC_MODULE_PARAMETERS) {
+ if (YY_START == SC_MODULE_PARAMETERS || YY_START == SC_CHAR_KEYWORD) {
// return a different token for module parameters so it doesn't conflict with references
return MPCstring;
}
yylval.charstring_val.chars_ptr=(char*)Malloc(macrolen+1);
memcpy(yylval.charstring_val.chars_ptr, macrovalue, macrolen+1);
Free(macroname);
- if (YY_START == SC_MODULE_PARAMETERS) {
+ if (YY_START == SC_MODULE_PARAMETERS || YY_START == SC_CHAR_KEYWORD) {
// return a different token for module parameters so it doesn't conflict with references
return MPCstring;
}
-. return yytext[0];
+. return yytext[0];
%%