File tree 1 file changed +50
-0
lines changed
1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -974,6 +974,56 @@ class multi_ary_exprt:public exprt
974
974
{
975
975
add_to_operands (_lhs, _rhs);
976
976
}
977
+
978
+ // In contrast to exprt::opX, the methods
979
+ // below check the size.
980
+ exprt &op0 ()
981
+ {
982
+ PRECONDITION (operands ().size () >= 1 );
983
+ return operands ().front ();
984
+ }
985
+
986
+ exprt &op1 ()
987
+ {
988
+ PRECONDITION (operands ().size () >= 2 );
989
+ return operands ()[1 ];
990
+ }
991
+
992
+ exprt &op2 ()
993
+ {
994
+ PRECONDITION (operands ().size () >= 3 );
995
+ return operands ()[2 ];
996
+ }
997
+
998
+ exprt &op3 ()
999
+ {
1000
+ PRECONDITION (operands ().size () >= 4 );
1001
+ return operands ()[3 ];
1002
+ }
1003
+
1004
+ const exprt &op0 () const
1005
+ {
1006
+ PRECONDITION (operands ().size () >= 1 );
1007
+ return operands ().front ();
1008
+ }
1009
+
1010
+ const exprt &op1 () const
1011
+ {
1012
+ PRECONDITION (operands ().size () >= 2 );
1013
+ return operands ()[1 ];
1014
+ }
1015
+
1016
+ const exprt &op2 () const
1017
+ {
1018
+ PRECONDITION (operands ().size () >= 3 );
1019
+ return operands ()[2 ];
1020
+ }
1021
+
1022
+ const exprt &op3 () const
1023
+ {
1024
+ PRECONDITION (operands ().size () >= 4 );
1025
+ return operands ()[3 ];
1026
+ }
977
1027
};
978
1028
979
1029
// / \brief Cast an exprt to a \ref multi_ary_exprt
You can’t perform that action at this time.
0 commit comments