search for: lident

Displaying 5 results from an estimated 5 matches for "lident".

Did you mean: ident
2007 Nov 26
0
[LLVMdev] Fibonacci example in OCaml
...;; f = expr -> If(p, t, f) ] | [ e1 = expr; "<="; e2 = expr -> BinOp(`Leq, e1, e2) ] | [ e1 = expr; "+"; e2 = expr -> BinOp(`Add, e1, e2) | e1 = expr; "-"; e2 = expr -> BinOp(`Sub, e1, e2) ] | [ f = expr; x = expr -> Apply(f, x) ] | [ v = LIDENT -> Var v | n = INT -> Int(int_of_string n) | "("; e = expr; ")" -> e ] ]; defn: [ [ "let"; "rec"; f = LIDENT; x = LIDENT; "="; body = expr -> LetRec(f, x, body) ] ]; prog: [ [ defns = LIST0 defn; "do"; run = ex...
2007 Nov 25
2
[LLVMdev] Fibonacci example in OCaml
Here's my translation of the Fibonacci example into OCaml: open Printf open Llvm let build_fib m = let fibf = define_function "fib" (function_type i32_type [| i32_type |]) m in let bb = builder_at_end (entry_block fibf) in let one = const_int i32_type 1 and two = const_int i32_type 2 in let argx = param fibf 0 in set_value_name "AnArg" argx; let
2007 Nov 25
0
[LLVMdev] OCaml
> On Sunday 25 November 2007 03:42, Christopher Lamb wrote: >> Try this google query. I know there's been some discussion/work on >> OCaml and LLVM. >> >> site:lists.cs.uiuc.edu/pipermail/llvmdev OCaml interface > > I just rediscovered the OCaml bindings in bindings/ocaml (rather than the > ones > in test/Bindings/OCaml!). They do indeed look quite
2007 Nov 25
2
[LLVMdev] OCaml
On Sunday 25 November 2007 03:42, Christopher Lamb wrote: > Try this google query. I know there's been some discussion/work on > OCaml and LLVM. > > site:lists.cs.uiuc.edu/pipermail/llvmdev OCaml interface I just rediscovered the OCaml bindings in bindings/ocaml (rather than the ones in test/Bindings/OCaml!). They do indeed look quite complete but I can't find any examples
2007 Nov 25
2
[LLVMdev] OCaml
...[ f = STRING; "("; args = LIST0 expr; ")" -> Call(f, args) ] | [ "def"; f = STRING; "("; vars = LIST0 [ s = STRING -> s ]; ")"; body = expr -> Function(f, vars, body) ] | [ x = FLOAT -> Num(float_of_string x) ] | [ v = LIDENT -> Var v ] ]; END;; Probably better to use conventional lex and yacc though... -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/products/?e