@@ -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
@@ -819,7 +819,26 @@ constant : NUMBER_Token { init($$, ID_constant); stack_expr($$).se
819819 ;
820820
821821basic_expr : constant
822- | variable_identifier
822+ | identifier
823+ {
824+ // This rule is part of "complex_identifier" in the NuSMV manual.
825+ $$ = $1 ;
826+ irep_idt identifier = stack_expr ($$).id ();
827+ stack_expr ($$).id (ID_smv_identifier);
828+ stack_expr ($$).set (ID_identifier, identifier);
829+ PARSER.set_source_location (stack_expr ($$));
830+ }
831+ | basic_expr DOT_Token IDENTIFIER_Token
832+ {
833+ // This rule is part of "complex_identifier" in the NuSMV manual.
834+ unary ($$, ID_member, $1 );
835+ stack_expr ($$).set (ID_component_name, stack_expr ($3 ).id ());
836+ }
837+ | basic_expr ' (' basic_expr ' )'
838+ {
839+ // Not in the NuSMV grammar.
840+ binary ($$, $1 , ID_index, $3 );
841+ }
823842 | ' (' formula ' )' { $$=$2 ; }
824843 | NOT_Token basic_expr { init ($$, ID_not); mto ($$, $2 ); }
825844 | " abs" ' (' basic_expr ' )' { unary ($$, ID_smv_abs, $3 ); }
@@ -845,6 +864,9 @@ basic_expr : constant
845864 | basic_expr mod_Token basic_expr { binary ($$, $1 , ID_mod, $3 ); }
846865 | basic_expr GTGT_Token basic_expr { binary ($$, $1 , ID_shr, $3 ); }
847866 | basic_expr LTLT_Token basic_expr { binary ($$, $1 , ID_shl, $3 ); }
867+ | basic_expr ' [' basic_expr ' ]' { binary ($$, $1 , ID_index, $3 ); }
868+ | basic_expr ' [' basic_expr ' :' basic_expr ' ]'
869+ { init ($$, ID_extractbits); mto ($$, $1 ); mto ($$, $3 ); mto ($$, $5 ); }
848870 | basic_expr COLONCOLON_Token basic_expr { binary ($$, $1 , ID_concatenation, $3 ); }
849871 | " word1" ' (' basic_expr ' )' { unary ($$, ID_smv_word1, $3 ); }
850872 | " bool" ' (' basic_expr ' )' { unary ($$, ID_smv_bool, $3 ); }
0 commit comments