Skip to content

Commit 0ef4d02

Browse files
authored
Merge pull request #1119 from diffblue/svm-identifier-grammar
SMV grammar: rename `variable_name` and `qstring_list`
2 parents 2d61d66 + 283b005 commit 0ef4d02

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/smvlang/parser.y

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ ltl_specification:
421421
}
422422
;
423423

424-
extern_var : variable_name EQUAL_Token QUOTE_Token
424+
extern_var : variable_identifier EQUAL_Token QUOTE_Token
425425
{
426426
const irep_idt &identifier=stack_expr($1).get(ID_identifier);
427427
smv_parse_treet::mc_vart &var=PARSER.module->vars[identifier];
@@ -440,7 +440,7 @@ vardecls : vardecl
440440
| vardecls vardecl
441441
;
442442

443-
module_argument: variable_name
443+
module_argument: variable_identifier
444444
{
445445
const irep_idt &identifier=stack_expr($1).get(ID_identifier);
446446
smv_parse_treet::mc_vart &var=PARSER.module->vars[identifier];
@@ -539,7 +539,7 @@ enum_element: STRING_Token
539539
}
540540
;
541541

542-
vardecl : variable_name ':' type_specifier ';'
542+
vardecl : variable_identifier ':' type_specifier ';'
543543
{
544544
const irep_idt &identifier=stack_expr($1).get(ID_identifier);
545545
smv_parse_treet::mc_vart &var=PARSER.module->vars[identifier];
@@ -621,7 +621,7 @@ assignment : assignment_head '(' assignment_var ')' BECOMES_Token formula ';'
621621
}
622622
;
623623

624-
assignment_var: variable_name
624+
assignment_var: variable_identifier
625625
;
626626

627627
assignment_head: init_Token { init($$, ID_init); }
@@ -670,7 +670,7 @@ define : assignment_var BECOMES_Token formula ';'
670670
formula : term
671671
;
672672

673-
term : variable_name
673+
term : variable_identifier
674674
| next_Token '(' term ')' { init($$, ID_smv_next); mto($$, $3); }
675675
| '(' formula ')' { $$=$2; }
676676
| '{' formula_list '}' { $$=$2; stack_expr($$).id("smv_nondet_choice"); }
@@ -684,7 +684,7 @@ term : variable_name
684684
| case_Token cases esac_Token { $$=$2; }
685685
| term IF_Token term ':' term %prec IF_Token
686686
{ init($$, ID_if); mto($$, $1); mto($$, $3); mto($$, $5); }
687-
| switch_Token '(' variable_name ')' '{' switches '}' { init($$, ID_switch); mto($$, $3); mto($$, $6); }
687+
| switch_Token '(' variable_identifier ')' '{' switches '}' { init($$, ID_switch); mto($$, $3); mto($$, $6); }
688688
| MINUS_Token term %prec UMINUS
689689
{ init($$, ID_unary_minus); mto($$, $2); }
690690
| term mod_Token term { binary($$, $1, ID_mod, $3); }
@@ -786,7 +786,7 @@ formula_list:
786786
identifier : STRING_Token
787787
;
788788

789-
variable_name: qstring_list
789+
variable_identifier: complex_identifier
790790
{
791791
const irep_idt &id=stack_expr($1).id();
792792

@@ -826,34 +826,34 @@ variable_name: qstring_list
826826
}
827827
;
828828

829-
qstring_list: QSTRING_Token
829+
complex_identifier: QSTRING_Token
830830
{
831831
init($$, std::string(stack_expr($1).id_string(), 1)); // remove backslash
832832
}
833833
| STRING_Token
834-
| qstring_list DOT_Token QSTRING_Token
834+
| complex_identifier DOT_Token QSTRING_Token
835835
{
836836
std::string id(stack_expr($1).id_string());
837837
id+=".";
838838
id+=std::string(stack_expr($3).id_string(), 1); // remove backslash
839839
init($$, id);
840840
}
841-
| qstring_list DOT_Token STRING_Token
841+
| complex_identifier DOT_Token STRING_Token
842842
{
843843
std::string id(stack_expr($1).id_string());
844844
id+=".";
845845
id+=stack_expr($3).id_string();
846846
init($$, id);
847847
}
848-
| qstring_list '[' NUMBER_Token ']'
848+
| complex_identifier '[' NUMBER_Token ']'
849849
{
850850
std::string id(stack_expr($1).id_string());
851851
id+="[";
852852
id+=stack_expr($3).id_string();
853853
id+="]";
854854
init($$, id);
855855
}
856-
| qstring_list '(' NUMBER_Token ')'
856+
| complex_identifier '(' NUMBER_Token ')'
857857
{
858858
std::string id(stack_expr($1).id_string());
859859
id+="(";

0 commit comments

Comments
 (0)