@@ -344,6 +344,7 @@ and attrparam =
344344 | AAddrOf of attrparam (* * & a **)
345345 | AIndex of attrparam * attrparam (* * a1[a2] *)
346346 | AQuestion of attrparam * attrparam * attrparam (* * a1 ? a2 : a3 **)
347+ | AAssign of attrparam * attrparam (* * a1 = a2 *)
347348
348349
349350(* * Information about a composite type (a struct or a union). Use
@@ -1874,6 +1875,7 @@ let additiveLevel = 60
18741875let comparativeLevel = 70
18751876let bitwiseLevel = 75
18761877let questionLevel = 100
1878+ let assignLevel = 110
18771879let getParenthLevel (e : exp ) =
18781880 match e with
18791881 | Question _ -> questionLevel
@@ -1924,6 +1926,7 @@ let getParenthLevelAttrParam (a: attrparam) =
19241926 | AAddrOf _ -> 30
19251927 | ADot _ | AIndex _ | AStar _ -> 20
19261928 | AQuestion _ -> questionLevel
1929+ | AAssign _ -> assignLevel
19271930
19281931
19291932let isIntegralType t =
@@ -4423,6 +4426,9 @@ class defaultCilPrinterClass : cilPrinter = object (self)
44234426 self#pAttrParam () a1 ++ text " ? " ++
44244427 self#pAttrParam () a2 ++ text " : " ++
44254428 self#pAttrParam () a3
4429+ | AAssign (a1 , a2 ) ->
4430+ self#pAttrParam () a1 ++ text " =" ++
4431+ self#pAttrParam () a2
44264432
44274433
44284434 (* A general way of printing lists of attributes *)
@@ -5561,6 +5567,10 @@ and childrenAttrparam (vis: cilVisitor) (aa: attrparam) : attrparam =
55615567 let e3' = fAttrP e3 in
55625568 if e1' != e1 || e2' != e2 || e3' != e3
55635569 then AQuestion (e1', e2', e3') else aa
5570+ | AAssign (e1 , e2 ) ->
5571+ let e1' = fAttrP e1 in
5572+ let e2' = fAttrP e2 in
5573+ if e1' != e1 || e2' != e2 then AAssign (e1', e2') else aa
55645574
55655575
55665576let rec visitCilFunction (vis : cilVisitor ) (f : fundec ) : fundec =
0 commit comments