Git Product home page Git Product logo

luna-gen's Introduction

= Files =
	test_luna/*.lua : self-contained examples (run make.sh to run) 
			These examples use CMake. If you don't want to use CMake, see "examples/gen.sh". 

	luna_gen.lua:  the code generator. 

	mylib*.lua: the code generator depends on these files, but output codes do not.
			luna.h/cpp: the output code depends only on these files. 
			luna.h is worth reading (at least lunaStack class).

	examples/*.lua : real-world examples that use all available functionalities (run gen.sh to convert.)
				   The real-world examples do not run on your system because of missing dependencies.
	
	see examples/README for details. This file explains how to call a lua function from c.

= Supported type =
	class   ( corresponds to a userdata that has a metatable )
	module  ( corresponds to a table. Multiple modules can have the same name. )

= Supported class properties =
	name
	className
	inheritsFrom
	ctors
	wrapperCode : custom function definitions (any valid c++ code which goes into the output cpp file.)
	decl : custom class declarations (any valid c++ code which goes into the output header file)
	globalWrapperCode :custom function definitions (any valid c++ code which goes into the output cpp file.)
	ifdef
	ifndef
	if_
	isLuaInheritable
	enums
	staticMemberFunctions
	memberFunctionsFromFile
	memberFunctions
	isExtendableFromLua : for c++ inheritance from lua. See test_inheritance.lua
	properties 
	read_properties
	write_properties
	customFunctionsToRegister : luna-gen can register a custom function 'int funcName(lua_State* L)'

	Sorry for the lack of documentations. 
	Search for keyword in examples to see its usage, or ask me so that I can update this document. 

= Notes for luabind users =

1. luabind:
		luabind::def("createVRMLskin", &RE::createVRMLskin,luabind::adopt(luabind::result))
   luna-gen: 
		PLDPrimVRML* RE::createVRMLskin(VRMLloader*pTgtSkel, bool bDrawSkeleton) @ ;adopt=true; 


2. luabind:
		.enum_("constants")
		[
			luabind::value("EULER",OpenHRP::DynamicsSimulator::EULER)
		]
   luna-gen:
		enums={
		{"EULER", "(int)OpenHRP::DynamicsSimulator::EULER"},
		}

3. luabind:
		.scope_[..] 
   luna-gen:
        staticMemberFunctions={[[..]]}

4. luabind:
		#ifndef AAA
			luabind::def("abc"...)
		#endif
   luna-gen:
		void abc() @ ;ifndef=AAA;
 
5. luabind:
		#ifndef AAA
		    luabind::class_<asdf>("asdf")[...]
		#endif
   luna-gen:
       {
		   name='asdf',
		   ifndef='AAA',
	   }
		   


[email protected]

luna-gen's People

Contributors

taesoobear avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.