From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a7a28d45b9ccd906,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.73.229 with SMTP id o5mr5071154pbv.7.1327319176567; Mon, 23 Jan 2012 03:46:16 -0800 (PST) Path: lh20ni214737pbb.0!nntp.google.com!news2.google.com!postnews.google.com!kg1g2000pbb.googlegroups.com!not-for-mail From: Kylix Newsgroups: comp.lang.ada Subject: Ann: ada binding to v8(google javascript engine) Date: Mon, 23 Jan 2012 03:44:18 -0800 (PST) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 218.15.19.126 Mime-Version: 1.0 X-Trace: posting.google.com 1327319176 7081 127.0.0.1 (23 Jan 2012 11:46:16 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 23 Jan 2012 11:46:16 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: kg1g2000pbb.googlegroups.com; posting-host=218.15.19.126; posting-account=4uMkDwoAAACMyNluw6CdeU7BMSgYHFMk User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-01-23T03:44:18-08:00 List-Id: I made a binding to v8(google javascript engine), with some examples, such as a simple shell: procedure Shell is p : v8.Class_Handle_Scope.Handle_Scope; pragma Unreferenced (p); c : v8.Class_Context.Handles.Persistent := v8.Class_Context.Create; cs : v8.Class_Context.Scope (c.As_Object); ver : v8.Class_String.Pointer := v8.Class_String.Create (v8.Class_V8.Get_Version); tc : v8.Class_Try_Catch.Holder; pragma Warnings (Off); begin loop Ada.Text_IO.Put("input code to execute or enter exit:"); declare code : String := Ada.Text_IO.Get_Line; bin : v8.Class_Script_Data.Pointer; begin exit when code = "exit"; bin := v8.Class_Script_Data.Pre_Compile (code); if not bin.Has_Error then declare js : v8.CLass_Script.Pointer := v8.Class_Script.Compile (source => v8.Class_String.Create (code), pre_data => bin); result : v8.Class_Value.Pointer := js.Run; use type v8.Class_Value.Pointer; begin if result /= null then Show_Result(result); else Ada.Text_IO.Put_Line (int'Image(tc.Message.Get_Line_Number)); tc.Reset; end if; end; end if; bin.Free; end; end loop; end Shell;