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
translatescu
into its high-level representation, supposing thatcu
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 bye
. Returns aNULL
cursor ofe
has no corresponding definition.
val radix_of_integer_literal : t -> radix option
radix_of_integer_literal e
returns the radix of the integer literale
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 stringcontents
as a C expression and returns(o, tu)
whereo
isSome e
ifcontents
has been successfully parsed as the expressione
, andtu
is the translation unit created for parsing.tu
can be used to retrieve diagnostics if any.context
provides some declaration context.filename
andline
specifies respectively the file name and the line number to use in diagnostics.