From 3c2be863bde4965a1ac61092b1348b96397940cb Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Mon, 9 Mar 2015 16:25:00 +0100 Subject: stdlib: Add module erl_anno Introduce erl_anno, an abstraction of the second element of tokens and tuples in the abstract format. The convention that negative line numbers can be used for silencing compiler warnings will no longer work in OTP 19; instead the annotation 'generated' is to be used. --- lib/stdlib/doc/src/erl_parse.xml | 98 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 95 insertions(+), 3 deletions(-) (limited to 'lib/stdlib/doc/src/erl_parse.xml') diff --git a/lib/stdlib/doc/src/erl_parse.xml b/lib/stdlib/doc/src/erl_parse.xml index cf0bff48cd..b97d06e919 100644 --- a/lib/stdlib/doc/src/erl_parse.xml +++ b/lib/stdlib/doc/src/erl_parse.xml @@ -4,7 +4,7 @@
- 19962014 + 19962015 Ericsson AB. All Rights Reserved. @@ -192,6 +192,97 @@ considered a string.

+ + + + Map a function over the annotations of an abstract form + + +

Modifies the abstract form Abstr by applying + Fun on every collection of annotations of the + abstract form. The abstract form is traversed in a + depth-first, left-to-right, fashion. +

+
+
+ + + + Fold a function over the annotations of an abstract form + + +

Updates an accumulator by applying Fun on + every collection of annotations of the abstract form + Abstr. The first call to Fun has + AccIn as argument, and the returned accumulator + AccOut is passed to the next call, and so on. + The final value of the accumulator is returned. The abstract + form is traversed in a depth-first, left-to-right, fashion. +

+
+
+ + + + Map and fold a function over the annotations of an abstract form + + +

Modifies the abstract form Abstr by applying + Fun on every collection of annotations of the + abstract form, while at the same time updating an + accumulator. The first call to Fun has + AccIn as second argument, and the returned + accumulator AccOut is passed to the next call, + and so on. The modified abstract form as well as the the + final value of the accumulator is returned. The abstract + form is traversed in a depth-first, left-to-right, fashion. +

+
+
+ + + + Create new annotations + + +

Creates an abstract form from a term which has the same + structure as an abstract form, but locations where the + abstract form has annotations. For each location, erl_anno:new/1 is + called, and the annotations replace the location. +

+
+
+ + + + Return annotations as terms + + +

Assumes that Term is a term with the same + structure as an abstract form, but with terms, T say, on + those places where an abstract form has annotations. Returns + an abstract form where every term T has been replaced by the + value returned by calling erl_anno:from_term(T). The + term Term is traversed in a depth-first, + left-to-right, fashion. +

+
+
+ + + + Return the representation of annotations + + +

Returns a term where every collection of annotations Anno of + Abstr has been replaced by the term returned by + calling erl_anno:to_term(Anno). The abstract form is + traversed in a depth-first, left-to-right, fashion. +

+
+
@@ -211,8 +302,9 @@
See Also

io(3), - erl_scan(3), - ERTS User's Guide

+ erl_anno(3), + erl_scan(3), + ERTS User's Guide

-- cgit v1.2.3