File tree Expand file tree Collapse file tree 4 files changed +40
-1
lines changed Expand file tree Collapse file tree 4 files changed +40
-1
lines changed Original file line number Diff line number Diff line change 1+ CORE
2+ word_constants1.smv
3+ --bound 0
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ --
7+ ^warning: ignoring
Original file line number Diff line number Diff line change 1+ MODULE main
2+
3+ SPEC uwconst(123, 8) = 0d8_123;
4+ SPEC uwconst(123, 8) = 0ud8_123;
5+ SPEC uwconst(123, 8) = 0h_7b;
6+ SPEC uwconst(123, 8) = 0uh_7b;
7+ SPEC uwconst(123, 8) = 0b_01111011;
8+ SPEC uwconst(123, 8) = 0ub_01111011;
9+ SPEC uwconst(123, 8) = 0b8_1111011;
10+ SPEC uwconst(123, 8) = 0ub8_1111011;
11+
12+ SPEC swconst(123, 8) = 0sd8_123;
13+ SPEC swconst(123, 8) = 0sh_7b;
14+ SPEC swconst(123, 8) = 0sb_01111011;
15+ SPEC swconst(123, 8) = 0sb8_1111011;
Original file line number Diff line number Diff line change 66#include " smv_parser.h"
77#include " smv_typecheck.h"
88
9+ #include < util/bitvector_types.h>
910#include < util/mathematical_types.h>
1011#include < util/std_expr.h>
1112#include < util/std_types.h>
@@ -320,8 +321,9 @@ static smv_parse_treet::modulet &new_module(YYSTYPE &module_name)
320321
321322%token IDENTIFIER_Token " identifier"
322323%token QIDENTIFIER_Token " quoted identifier"
323- %token STRING_Token " quoted string"
324+ %token STRING_Token " quoted string"
324325%token NUMBER_Token " number"
326+ %token WORD_CONSTANT_Token " word constant"
325327
326328/* operator precedence, low to high */
327329%right IMPLIES_Token
@@ -815,6 +817,7 @@ formula : basic_expr
815817
816818constant : boolean_constant
817819 | integer_constant
820+ | word_constant
818821 ;
819822
820823boolean_constant:
@@ -841,6 +844,15 @@ integer_constant:
841844 }
842845 ;
843846
847+ word_constant:
848+ WORD_CONSTANT_Token
849+ {
850+ init ($$, ID_constant);
851+ stack_expr ($$).set (ID_value, stack_expr ($1 ).id ());
852+ stack_expr ($$).type () = bv_typet{0 };
853+ }
854+ ;
855+
844856basic_expr : constant
845857 | identifier
846858 {
Original file line number Diff line number Diff line change @@ -188,6 +188,11 @@ void newlocation(YYSTYPE &x)
188188 stack_expr (yysmvlval).id (yytext);
189189 return NUMBER_Token;
190190 }
191+ 0[us ]? [bBoOdDhH ][0 -9 ]* _[0 -9a -fA -F ][_0 -9a -fA -F ]* {
192+ newstack (yysmvlval);
193+ stack_expr (yysmvlval).id (yytext);
194+ return WORD_CONSTANT_Token;
195+ }
191196\" [^ \" ]* \" {
192197 newstack (yysmvlval);
193198 std::string tmp (yytext);
You can’t perform that action at this time.
0 commit comments