Module Cpp.Expression_syntax

Some operators to make streams and method calls look more like the resultant C++

include module type of struct include Exprs end
val method_call : expr -> identifier -> type_ list -> expr list -> expr

Call a method on object, wrapping it in parentheses if it is not a variable

val to_var : identifier -> expr
val literal_string : string -> expr

Turn an OCaml string into a quoted and escaped C++ string

val std_vector_init_expr : type_ -> expr list -> expr

Equivalent to std::vector<t>{e1,...,en}

val fun_call : identifier -> expr list -> expr
val templated_fun_call : identifier -> type_ list -> expr list -> expr
val quiet_NaN : expr

Helper for std::numeric_limits<double>::quiet_NaN()

val int_min : expr

Helper for std::numeric_limits<int>::min()

val static_cast : type_ -> expr -> expr
val (<<) : expr -> expr list -> expr

A pun for the C++ operator<<

val (.@!()) : expr -> identifier -> expr

Method call: Call a no-argument method

E.g. foo.bar()

val (.@?()) : expr -> (identifier * expr list) -> expr

Method call: Call the named method with args

E.g. foo.bar(A1,...An)

val (.@<>()) : expr -> (identifier * type_ list * expr list) -> expr

Method call: Call the named method with template types and args

E.g. foo.bar<T1,...,Tn>(A1,...An)

val (|::!) : type_ -> identifier -> expr

Static method call: Call the named method with no arguments.

E.g. Foo::bar()

val (|::?) : type_ -> (identifier * expr list) -> expr

Static method call: Call the named method with args

E.g. Foo::bar(A1,...An)

val (|::<>) : type_ -> (identifier * type_ list * expr list) -> expr

Static method call: Call the named method with template types and args

E.g. Foo::bar<T1,...,Tn>(A1,...An)

val (+) : expr -> expr -> expr

Pun for C++ operator+(a,b)

val (-) : expr -> expr -> expr

Pun for C++ operator-(a,b)

val (*) : expr -> expr -> expr

Pun for C++ operator*(a,b)