Skip to content

Automatically exported from code.google.com/p/luna-gen

Notifications You must be signed in to change notification settings

mingzhi1/luna-gen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

= 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',
	   }
		   


taesoobear@gmail.com

About

Automatically exported from code.google.com/p/luna-gen

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published