Mavryk_micheline.MichelineThe abstract syntax tree of Micheline expressions. The first parameter is used to contain locations, but can also embed custom data. The second parameter is the type of primitive names.
val location : ('l, 'p) node -> 'lExtract the location of the node.
val annotations : ('l, 'p) node -> string listExtract the annotations of the node.
Expression form using canonical integer numbering as locations. The root has number zero, and each node adds one in the order of infix traversal. To be used when locations are not important, or when one wants to attach properties to nodes in an expression without rewriting it (using an indirection table with canonical locations as keys).
Canonical integer locations that appear inside canonical expressions.
val dummy_location : canonical_locationA location that won't exist in any well-formed canonical value
Compute the canonical form of an expression. Drops the concrete locations completely.
val root : 'p canonical -> (canonical_location, 'p) nodeGive the root node of an expression in canonical form.
val extract_locations :
('l, 'p) node ->
'p canonical * (canonical_location * 'l) listCompute the canonical form of an expression. Saves the concrete locations in an association list.
val inject_locations :
(canonical_location -> 'l) ->
'p canonical ->
('l, 'p) nodeTransforms an expression in canonical form into a polymorphic one. Takes a mapping function to inject the concrete locations.