jsapigen

A glue-code generator for SpiderMonkey
Download

jsapigen Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL v3
  • Price:
  • FREE
  • Publisher Name:
  • Thomas Zimmermann
  • Publisher web site:

jsapigen Tags


jsapigen Description

A glue-code generator for SpiderMonkey jsapigen is a software that generates glue code for embedding SpiderMonkey in C applications.jsapigen provides a simple interface definition language for describing the connection between native C code and the JavaScript environment. It converts such IDL descriptions into C code which is then compiled into an application during the build process.Example:The following code is a snippet of an IDL file. Running jsapigen on this example generates glue code for integration with SpiderMonkey.function void js_function : c_function (int=2);The example shows the declaration of a JavaScript function js_function which executes the C function c_function on invocation. It takes one argument of type int and returns nothing. If the argument is omitted, a default value of 2 is used.This simple example only shows some of jsapigen's features. By now, the program covers roughly 90% of all possible scenarios and often it is possible to create the complete glue code automatically. jsapigen is intended to be used as a preprocessor for C source files and integrates perfectly with make.jsapigen also save you a lot of typing. Generated glue code in C is larger in size then its corresponding IDL description by an estimated factor of 20-50. For example, the one-liner above generates 30 lines of C code, plus another 155 lines of extra C code that can be shared with other declarations in the same file.Installation:Please refer to the file `INSTALL' which comes with this packages. It contains generic install instructions.The system requirements of jsapigen are- a rather POSIX-compatible build environment,- some implementation of Yacc (Yacc, Berkeley Yacc, GNU Bison),- POSIX lex (Flex), and- a C compiler with ISO C90 support.The software has been built with- GNU GCC 3.4.5, 4.2.1, 4.3.1, or- Sun Studio 12and tested on- Debian GNU/Linux 'Lenny' (amd64),- OpenBSD 4.3 (amd64),- FreeBSD 7.0 (i386),- SunOS 5.10 (sparc), and- MinGW on Windows 2000 (i386).If your system is on this list but fails to compile the software, please report this as a bug. Include the file `config.log', the compiler's error message and a description of your build environment.If your system is not on this list but compiles the software, please report it to the mailing list so that the system can be added.If your system does not compile the software but pretends to be compatible with POSIX, please report this as a bug.Usage:jsapigen is a command-line program for software development. It is intended to be used during the build process of an application, e.g. by integration via Makefiles, but it can also be used as stand-alone tool.Call `jsapigen -h' on the command line to get a list of supported options. The manual contains a detailed description of each. Here are some key features of "jsapigen": · generate functions, properties and classes (object-like functions), · provide support for constructors and finalizers · pack and unpack parameters and return values, · pass default values for omitted parameters, and · support suspendable function calls on multi-threaded applications. Requirements: · Berkeley Yacc · Fast Lexical Analyzer Generator What's New in This Release: New features: · support for call and equality operations · allow floating-point numbers as default values (bug #2652881) · C data types short and float in declarations · manual Bug-fixes: · correctly handle garbage collection · use JS_GetInstancePrivate to lookup private fields (bug #2672919) · don't suspend non-suspendable functions (bug #2671225) · less compiler warnings (bug #2671230)


jsapigen Related Software