@@ -341,7 +341,7 @@ static smv_parse_treet::modulet &new_module(YYSTYPE &module_name)
341341%left TIMES_Token DIVIDE_Token
342342%left COLONCOLON_Token
343343%left UMINUS /* supplies precedence for unary minus */
344- %left DOT_Token
344+ %left DOT_Token ' [ '
345345
346346%%
347347
@@ -820,6 +820,12 @@ constant : NUMBER_Token { init($$, ID_constant); stack_expr($$).se
820820
821821basic_expr : constant
822822 | variable_identifier
823+ | basic_expr DOT_Token IDENTIFIER_Token
824+ {
825+ // This rule is part of "complex_identifier" in the NuSMV manual.
826+ unary ($$, ID_member, $1 );
827+ stack_expr ($$).set (ID_component_name, stack_expr ($3 ).id ());
828+ }
823829 | ' (' formula ' )' { $$=$2 ; }
824830 | NOT_Token basic_expr { init ($$, ID_not); mto ($$, $2 ); }
825831 | " abs" ' (' basic_expr ' )' { unary ($$, ID_smv_abs, $3 ); }
@@ -845,6 +851,9 @@ basic_expr : constant
845851 | basic_expr mod_Token basic_expr { binary ($$, $1 , ID_mod, $3 ); }
846852 | basic_expr GTGT_Token basic_expr { binary ($$, $1 , ID_shr, $3 ); }
847853 | basic_expr LTLT_Token basic_expr { binary ($$, $1 , ID_shl, $3 ); }
854+ | basic_expr ' [' basic_expr ' ]' { binary ($$, $1 , ID_index, $3 ); }
855+ | basic_expr ' [' basic_expr ' :' basic_expr ' ]'
856+ { init ($$, ID_extractbits); mto ($$, $1 ); mto ($$, $3 ); mto ($$, $5 ); }
848857 | basic_expr COLONCOLON_Token basic_expr { binary ($$, $1 , ID_concatenation, $3 ); }
849858 | " word1" ' (' basic_expr ' )' { unary ($$, ID_smv_word1, $3 ); }
850859 | " bool" ' (' basic_expr ' )' { unary ($$, ID_smv_bool, $3 ); }
@@ -973,6 +982,7 @@ complex_identifier:
973982 stack_expr ($$).id (ID_smv_identifier);
974983 stack_expr ($$).set (ID_identifier, identifier);
975984 }
985+ /*
976986 | complex_identifier DOT_Token QIDENTIFIER_Token
977987 {
978988 unary($$, ID_member, $1);
@@ -993,6 +1003,7 @@ complex_identifier:
9931003 // Not in the NuSMV grammar.
9941004 binary($$, $1, ID_index, $3);
9951005 }
1006+ */
9961007 ;
9971008
9981009cases :
0 commit comments