Module Clang.Expr

AST expressions as ordered types.

type t = Ast.expr
val of_cxcursor : ?⁠options:Ast.Options.t -> Clang__.Clang__bindings.cxcursor -> t

of_cxcursor ?options cu translates cu into its high-level representation, supposing that cu points to an expression.

val get_definition : t -> Clang__.Clang__bindings.cxcursor

get_definition e retrieves a cursor that describes the definition of the entity referenced by e. Returns a NULL cursor of e has no corresponding definition.

type radix =
| Decimal
| Octal
| Hexadecimal
| Binary
val radix_of_integer_literal : t -> radix option

radix_of_integer_literal e returns the radix of the integer literal e if available. Note that, by convention, 0 is octal.

val parse_string : ?⁠index:Clang__.Clang__bindings.cxindex -> ?⁠clang_options:Clang__.Clang__bindings.Cxtranslationunit_flags.t -> ?⁠options:Ast.Options.t -> ?⁠filename:string -> ?⁠line:int -> ?⁠context:Clang__.Clang__ast.decl list -> string -> t option * Ast.translation_unit

parse_string ?index ?clang_options ?options ?filename ?line ?context contents parses string contents as a C expression and returns (o, tu) where o is Some e if contents has been successfully parsed as the expression e, and tu is the translation unit created for parsing. tu can be used to retrieve diagnostics if any. context provides some declaration context. filename and line specifies respectively the file name and the line number to use in diagnostics.

include Clang__.Ast_sig.S with type t := t
type t
val compare : t -> t -> int
val equal : t -> t -> bool
val hash : t -> int
val pp : Stdcompat.Format.formatter -> t -> unit
val show : t -> string
module Set : Stdcompat.Set.S with type Set.elt = t
module Map : Stdcompat.Map.S with type Map.key = t
module Hashtbl : Stdcompat.Hashtbl.S with type Hashtbl.key = t