@@ -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
@@ -842,7 +842,26 @@ integer_constant:
842842 ;
843843
844844basic_expr : constant
845- | variable_identifier
845+ | identifier
846+ {
847+ // This rule is part of "complex_identifier" in the NuSMV manual.
848+ $$ = $1 ;
849+ irep_idt identifier = stack_expr ($$).id ();
850+ stack_expr ($$).id (ID_smv_identifier);
851+ stack_expr ($$).set (ID_identifier, identifier);
852+ PARSER.set_source_location (stack_expr ($$));
853+ }
854+ | basic_expr DOT_Token IDENTIFIER_Token
855+ {
856+ // This rule is part of "complex_identifier" in the NuSMV manual.
857+ unary ($$, ID_member, $1 );
858+ stack_expr ($$).set (ID_component_name, stack_expr ($3 ).id ());
859+ }
860+ | basic_expr ' (' basic_expr ' )'
861+ {
862+ // Not in the NuSMV grammar.
863+ binary ($$, $1 , ID_index, $3 );
864+ }
846865 | ' (' formula ' )' { $$=$2 ; }
847866 | NOT_Token basic_expr { init ($$, ID_not); mto ($$, $2 ); }
848867 | " abs" ' (' basic_expr ' )' { unary ($$, ID_smv_abs, $3 ); }
@@ -868,6 +887,7 @@ basic_expr : constant
868887 | basic_expr mod_Token basic_expr { binary ($$, $1 , ID_mod, $3 ); }
869888 | basic_expr GTGT_Token basic_expr { binary ($$, $1 , ID_shr, $3 ); }
870889 | basic_expr LTLT_Token basic_expr { binary ($$, $1 , ID_shl, $3 ); }
890+ | basic_expr ' [' basic_expr ' ]' { binary ($$, $1 , ID_index, $3 ); }
871891 | basic_expr COLONCOLON_Token basic_expr { binary ($$, $1 , ID_concatenation, $3 ); }
872892 | " word1" ' (' basic_expr ' )' { unary ($$, ID_smv_word1, $3 ); }
873893 | " bool" ' (' basic_expr ' )' { unary ($$, ID_smv_bool, $3 ); }
0 commit comments