yet another c++ code parser in 73 lines of code
all the 'old' utilities refused to work, so i decided to write my own. The really strange thing i noticed was that none of the old interface generators used ctags?!
so this one is far from done, i just thought i should post some information here, maybe it could be useful for others as well.
Please note that the generator is not fully usable yet, since it does NOT automatically detect the return type of the function.
download link: ASctags.zip
(note: the code is cross platform, but i only included the windows ctags.exe. You would have to modify the script to use the linux/whatever ctags executable)
how to use:
a) install python 2.X
b) drop a .h file onto work.py and it should generate a file called 'output.txt'
improvements/comments welcome :)
EDIT: improved (same link): now handles return types better. next goal: parse and translate the signature :)
[Edited by - tdev on February 28, 2009 7:42:54 PM]
result of an example run over three classes. You can find the source line commented out above the generated AS interface line
current problems (being worked on):
- signatures of behaviors not correct
- signature type names not converted
if you find more, please let me know ;)
[Edited by - tdev on July 31, 2009 5:04:05 PM]
//function//inline Vector2( const Vector2& rkVector )r = engine->RegisterObjectMethod("Ogre_Vector2Class", "Vector2( const Vector2& rkVector )", asMETHOD(Ogre::Vector2,Vector2), asCALL_THISCALL); assert(r>=0);//inline Vector2()r = engine->RegisterObjectMethod("Ogre_Vector2Class", "Vector2()", asMETHOD(Ogre::Vector2,Vector2), asCALL_THISCALL); assert(r>=0);//inline Vector2(const Real fX, const Real fY )r = engine->RegisterObjectMethod("Ogre_Vector2Class", "Vector2(const Real fX, const Real fY )", asMETHOD(Ogre::Vector2,Vector2), asCALL_THISCALL); assert(r>=0);//inline explicit Vector2( Real* const r )r = engine->RegisterObjectMethod("Ogre_Vector2Class", "Vector2( Real* const r )", asMETHOD(Ogre::Vector2,Vector2), asCALL_THISCALL); assert(r>=0);//inline explicit Vector2( const Real afCoordinate[2] )r = engine->RegisterObjectMethod("Ogre_Vector2Class", "Vector2( const Real afCoordinate[2] )", asMETHOD(Ogre::Vector2,Vector2), asCALL_THISCALL); assert(r>=0);//inline explicit Vector2( const Real scaler )r = engine->RegisterObjectMethod("Ogre_Vector2Class", "Vector2( const Real scaler )", asMETHOD(Ogre::Vector2,Vector2), asCALL_THISCALL); assert(r>=0);//inline explicit Vector2( const int afCoordinate[2] )r = engine->RegisterObjectMethod("Ogre_Vector2Class", "Vector2( const int afCoordinate[2] )", asMETHOD(Ogre::Vector2,Vector2), asCALL_THISCALL); assert(r>=0);//inline Vector3( const Real fX, const Real fY, const Real fZ )r = engine->RegisterObjectMethod("Ogre_Vector3Class", "Vector3( const Real fX, const Real fY, const Real fZ )", asMETHOD(Ogre::Vector3,Vector3), asCALL_THISCALL); assert(r>=0);//inline Vector3( const Vector3& rkVector )r = engine->RegisterObjectMethod("Ogre_Vector3Class", "Vector3( const Vector3& rkVector )", asMETHOD(Ogre::Vector3,Vector3), asCALL_THISCALL); assert(r>=0);//inline Vector3()r = engine->RegisterObjectMethod("Ogre_Vector3Class", "Vector3()", asMETHOD(Ogre::Vector3,Vector3), asCALL_THISCALL); assert(r>=0);//inline explicit Vector3( Real* const r )r = engine->RegisterObjectMethod("Ogre_Vector3Class", "Vector3( Real* const r )", asMETHOD(Ogre::Vector3,Vector3), asCALL_THISCALL); assert(r>=0);//inline explicit Vector3( const Real afCoordinate[3] )r = engine->RegisterObjectMethod("Ogre_Vector3Class", "Vector3( const Real afCoordinate[3] )", asMETHOD(Ogre::Vector3,Vector3), asCALL_THISCALL); assert(r>=0);//inline explicit Vector3( const Real scaler )r = engine->RegisterObjectMethod("Ogre_Vector3Class", "Vector3( const Real scaler )", asMETHOD(Ogre::Vector3,Vector3), asCALL_THISCALL); assert(r>=0);//inline explicit Vector3( const int afCoordinate[3] )r = engine->RegisterObjectMethod("Ogre_Vector3Class", "Vector3( const int afCoordinate[3] )", asMETHOD(Ogre::Vector3,Vector3), asCALL_THISCALL); assert(r>=0);//inline Vector4( const Real fX, const Real fY, const Real fZ, const Real fW )r = engine->RegisterObjectMethod("Ogre_Vector4Class", "Vector4( const Real fX, const Real fY, const Real fZ, const Real fW )", asMETHOD(Ogre::Vector4,Vector4), asCALL_THISCALL); assert(r>=0);//inline Vector4( const Vector4& rkVector )r = engine->RegisterObjectMethod("Ogre_Vector4Class", "Vector4( const Vector4& rkVector )", asMETHOD(Ogre::Vector4,Vector4), asCALL_THISCALL); assert(r>=0);//inline Vector4()r = engine->RegisterObjectMethod("Ogre_Vector4Class", "Vector4()", asMETHOD(Ogre::Vector4,Vector4), asCALL_THISCALL); assert(r>=0);//inline explicit Vector4( Real* const r )r = engine->RegisterObjectMethod("Ogre_Vector4Class", "Vector4( Real* const r )", asMETHOD(Ogre::Vector4,Vector4), asCALL_THISCALL); assert(r>=0);//inline explicit Vector4( const Real afCoordinate[4] )r = engine->RegisterObjectMethod("Ogre_Vector4Class", "Vector4( const Real afCoordinate[4] )", asMETHOD(Ogre::Vector4,Vector4), asCALL_THISCALL); assert(r>=0);//inline explicit Vector4( const Real scaler )r = engine->RegisterObjectMethod("Ogre_Vector4Class", "Vector4( const Real scaler )", asMETHOD(Ogre::Vector4,Vector4), asCALL_THISCALL); assert(r>=0);//inline explicit Vector4( const int afCoordinate[4] )r = engine->RegisterObjectMethod("Ogre_Vector4Class", "Vector4( const int afCoordinate[4] )", asMETHOD(Ogre::Vector4,Vector4), asCALL_THISCALL); assert(r>=0);//inline explicit Vector4(const Vector3& rhs)r = engine->RegisterObjectMethod("Ogre_Vector4Class", "Vector4(const Vector3& rhs)", asMETHOD(Ogre::Vector4,Vector4), asCALL_THISCALL); assert(r>=0);//inline Real absDotProduct(const Vector3& vec) constr = engine->RegisterObjectMethod("Ogre_Vector3Class", "Real absDotProduct(const Vector3& vec) const", asMETHOD(Ogre::Vector3, absDotProduct), asCALL_THISCALL); assert(r>=0);//inline Real crossProduct( const Vector2& rkVector ) constr = engine->RegisterObjectMethod("Ogre_Vector2Class", "Real crossProduct( const Vector2& rkVector ) const", asMETHOD(Ogre::Vector2, crossProduct), asCALL_THISCALL); assert(r>=0);//inline Vector3 crossProduct( const Vector3& rkVector ) constr = engine->RegisterObjectMethod("Ogre_Vector3Class", "Ogre_Vector3Class crossProduct( const Vector3& rkVector ) const", asMETHOD(Ogre::Vector3, crossProduct), asCALL_THISCALL); assert(r>=0);//inline bool directionEquals(const Vector3& rhs,r = engine->RegisterObjectMethod("Ogre_Vector3Class", "bool directionEquals(const Vector3& rhs, const Radian& tolerance) const", asMETHOD(Ogre::Vector3, directionEquals), asCALL_THISCALL); assert(r>=0);//inline Real distance(const Vector3& rhs) constr = engine->RegisterObjectMethod("Ogre_Vector3Class", "Real distance(const Vector3& rhs) const", asMETHOD(Ogre::Vector3, distance), asCALL_THISCALL); assert(r>=0);//inline Real dotProduct(const Vector2& vec) constr = engine->RegisterObjectMethod("Ogre_Vector2Class", "Real dotProduct(const Vector2& vec) const", asMETHOD(Ogre::Vector2, dotProduct), asCALL_THISCALL); assert(r>=0);//inline Real dotProduct(const Vector3& vec) constr = engine->RegisterObjectMethod("Ogre_Vector3Class", "Real dotProduct(const Vector3& vec) const", asMETHOD(Ogre::Vector3, dotProduct), asCALL_THISCALL); assert(r>=0);//inline Real dotProduct(const Vector4& vec) constr = engine->RegisterObjectMethod("Ogre_Vector4Class", "Real dotProduct(const Vector4& vec) const", asMETHOD(Ogre::Vector4, dotProduct), asCALL_THISCALL); assert(r>=0);//Quaternion getRotationTo(const Vector3& dest,r = engine->RegisterObjectMethod("Ogre_Vector3Class", "Quaternion getRotationTo(const Vector3& dest, const Vector3& fallbackAxis = Vector3::ZERO) const", asMETHOD(Ogre::Vector3, getRotationTo), asCALL_THISCALL); assert(r>=0);//inline bool isZeroLength(void) constr = engine->RegisterObjectMethod("Ogre_Vector2Class", "bool isZeroLength(void) const", asMETHOD(Ogre::Vector2, isZeroLength), asCALL_THISCALL); assert(r>=0);//inline bool isZeroLength(void) constr = engine->RegisterObjectMethod("Ogre_Vector3Class", "bool isZeroLength(void) const", asMETHOD(Ogre::Vector3, isZeroLength), asCALL_THISCALL); assert(r>=0);//inline Real length () constr = engine->RegisterObjectMethod("Ogre_Vector2Class", "Real length() const", asMETHOD(Ogre::Vector2, length), asCALL_THISCALL); assert(r>=0);//inline Real length () constr = engine->RegisterObjectMethod("Ogre_Vector3Class", "Real length() const", asMETHOD(Ogre::Vector3, length), asCALL_THISCALL); assert(r>=0);//inline void makeCeil( const Vector2& cmp )r = engine->RegisterObjectMethod("Ogre_Vector2Class", "void makeCeil( const Vector2& cmp )", asMETHOD(Ogre::Vector2, makeCeil), asCALL_THISCALL); assert(r>=0);//inline void makeCeil( const Vector3& cmp )r = engine->RegisterObjectMethod("Ogre_Vector3Class", "void makeCeil( const Vector3& cmp )", asMETHOD(Ogre::Vector3, makeCeil), asCALL_THISCALL); assert(r>=0);//inline void makeFloor( const Vector2& cmp )r = engine->RegisterObjectMethod("Ogre_Vector2Class", "void makeFloor( const Vector2& cmp )", asMETHOD(Ogre::Vector2, makeFloor), asCALL_THISCALL); assert(r>=0);//inline void makeFloor( const Vector3& cmp )r = engine->RegisterObjectMethod("Ogre_Vector3Class", "void makeFloor( const Vector3& cmp )", asMETHOD(Ogre::Vector3, makeFloor), asCALL_THISCALL); assert(r>=0);//inline Vector2 midPoint( const Vector2& vec ) constr = engine->RegisterObjectMethod("Ogre_Vector2Class", "Ogre_Vector2Class midPoint( const Vector2& vec ) const", asMETHOD(Ogre::Vector2, midPoint), asCALL_THISCALL); assert(r>=0);//inline Vector3 midPoint( const Vector3& vec ) constr = engine->RegisterObjectMethod("Ogre_Vector3Class", "Ogre_Vector3Class midPoint( const Vector3& vec ) const", asMETHOD(Ogre::Vector3, midPoint), asCALL_THISCALL); assert(r>=0);//inline Real normalise()r = engine->RegisterObjectMethod("Ogre_Vector2Class", "Real normalise()", asMETHOD(Ogre::Vector2, normalise), asCALL_THISCALL); assert(r>=0);//inline Real normalise()r = engine->RegisterObjectMethod("Ogre_Vector3Class", "Real normalise()", asMETHOD(Ogre::Vector3, normalise), asCALL_THISCALL); assert(r>=0);//inline Vector2 normalisedCopy(void) constr = engine->RegisterObjectMethod("Ogre_Vector2Class", "Ogre_Vector2Class normalisedCopy(void) const", asMETHOD(Ogre::Vector2, normalisedCopy), asCALL_THISCALL); assert(r>=0);//inline Vector3 normalisedCopy(void) constr = engine->RegisterObjectMethod("Ogre_Vector3Class", "Ogre_Vector3Class normalisedCopy(void) const", asMETHOD(Ogre::Vector3, normalisedCopy), asCALL_THISCALL); assert(r>=0);//inline bool operator != ( const Vector2& rkVector ) constr = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_NOTEQUAL, "bool operator != ( const Ogre_Vector2Class& rkVector ) cons f( const Vector2& rkVector ) const", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline bool operator != ( const Vector3& rkVector ) constr = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_NOTEQUAL, "bool operator != ( const Ogre_Vector3Class& rkVector ) cons f( const Vector3& rkVector ) const", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline bool operator != ( const Vector4& rkVector ) constr = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_NOTEQUAL, "bool operator != ( const Ogre_Vector4Class& rkVector ) cons f( const Vector4& rkVector ) const", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline Vector2 operator * ( const Real fScalar ) constr = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_MULTIPLY, "Ogre_Vector2Class operator * ( const Real fScalar ) cons f( const Real fScalar ) const", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline Vector2 operator * ( const Vector2& rhs) constr = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_MULTIPLY, "Ogre_Vector2Class operator * ( const Ogre_Vector2Class& rhs) cons f( const Vector2& rhs) const", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline Vector3 operator * ( const Real fScalar ) constr = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_MULTIPLY, "Ogre_Vector3Class operator * ( const Real fScalar ) cons f( const Real fScalar ) const", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Vector3 operator * ( const Vector3& rhs) constr = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_MULTIPLY, "Ogre_Vector3Class operator * ( const Ogre_Vector3Class& rhs) cons f( const Vector3& rhs) const", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Vector4 operator * ( const Real fScalar ) constr = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_MULTIPLY, "Ogre_Vector4Class operator * ( const Real fScalar ) cons f( const Real fScalar ) const", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline Vector4 operator * ( const Vector4& rhs) constr = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_MULTIPLY, "Ogre_Vector4Class operator * ( const Ogre_Vector4Class& rhs) cons f( const Vector4& rhs) const", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline Vector2& operator *= ( const Real fScalar )r = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_MUL_ASSIGN, "Ogre_Vector2Class& operator *= ( const Real fScalar f( const Real fScalar )", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline Vector2& operator *= ( const Vector2& rkVector )r = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_MUL_ASSIGN, "Ogre_Vector2Class& operator *= ( const Ogre_Vector2Class& rkVector f( const Vector2& rkVector )", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline Vector3& operator *= ( const Real fScalar )r = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_MUL_ASSIGN, "Ogre_Vector3Class& operator *= ( const Real fScalar f( const Real fScalar )", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Vector3& operator *= ( const Vector3& rkVector )r = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_MUL_ASSIGN, "Ogre_Vector3Class& operator *= ( const Ogre_Vector3Class& rkVector f( const Vector3& rkVector )", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Vector4& operator *= ( const Real fScalar )r = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_MUL_ASSIGN, "Ogre_Vector4Class& operator *= ( const Real fScalar f( const Real fScalar )", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline Vector4& operator *= ( const Vector4& rkVector )r = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_MUL_ASSIGN, "Ogre_Vector4Class& operator *= ( const Ogre_Vector4Class& rkVector f( const Vector4& rkVector )", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline Vector2 operator + ( const Vector2& rkVector ) constr = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_ADD, "Ogre_Vector2Class operator + ( const Ogre_Vector2Class& rkVector ) cons f( const Vector2& rkVector ) const", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline const Vector2& operator + () constr = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_ADD, "const Ogre_Vector2Class& operator + () cons f() const", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline Vector3 operator + ( const Vector3& rkVector ) constr = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_ADD, "Ogre_Vector3Class operator + ( const Ogre_Vector3Class& rkVector ) cons f( const Vector3& rkVector ) const", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline const Vector3& operator + () constr = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_ADD, "const Ogre_Vector3Class& operator + () cons f() const", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Vector4 operator + ( const Vector4& rkVector ) constr = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_ADD, "Ogre_Vector4Class operator + ( const Ogre_Vector4Class& rkVector ) cons f( const Vector4& rkVector ) const", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline const Vector4& operator + () constr = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_ADD, "const Ogre_Vector4Class& operator + () cons f() const", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline Vector2& operator += ( const Real fScaler )r = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_ADD_ASSIGN, "Ogre_Vector2Class& operator += ( const Real fScaler f( const Real fScaler )", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline Vector2& operator += ( const Vector2& rkVector )r = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_ADD_ASSIGN, "Ogre_Vector2Class& operator += ( const Ogre_Vector2Class& rkVector f( const Vector2& rkVector )", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline Vector3& operator += ( const Real fScalar )r = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_ADD_ASSIGN, "Ogre_Vector3Class& operator += ( const Real fScalar f( const Real fScalar )", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Vector3& operator += ( const Vector3& rkVector )r = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_ADD_ASSIGN, "Ogre_Vector3Class& operator += ( const Ogre_Vector3Class& rkVector f( const Vector3& rkVector )", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Vector4& operator += ( const Real fScalar )r = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_ADD_ASSIGN, "Ogre_Vector4Class& operator += ( const Real fScalar f( const Real fScalar )", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline Vector4& operator += ( const Vector4& rkVector )r = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_ADD_ASSIGN, "Ogre_Vector4Class& operator += ( const Ogre_Vector4Class& rkVector f( const Vector4& rkVector )", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline Vector2 operator - ( const Vector2& rkVector ) constr = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_SUBTRACT, "Ogre_Vector2Class operator - ( const Ogre_Vector2Class& rkVector ) cons f( const Vector2& rkVector ) const", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline Vector2 operator - () constr = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_SUBTRACT, "Ogre_Vector2Class operator - () cons f() const", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline Vector3 operator - ( const Vector3& rkVector ) constr = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_SUBTRACT, "Ogre_Vector3Class operator - ( const Ogre_Vector3Class& rkVector ) cons f( const Vector3& rkVector ) const", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Vector3 operator - () constr = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_SUBTRACT, "Ogre_Vector3Class operator - () cons f() const", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Vector4 operator - ( const Vector4& rkVector ) constr = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_SUBTRACT, "Ogre_Vector4Class operator - ( const Ogre_Vector4Class& rkVector ) cons f( const Vector4& rkVector ) const", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline Vector4 operator - () constr = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_SUBTRACT, "Ogre_Vector4Class operator - () cons f() const", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline Vector2& operator -= ( const Real fScaler )r = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_SUB_ASSIGN, "Ogre_Vector2Class& operator -= ( const Real fScaler f( const Real fScaler )", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline Vector2& operator -= ( const Vector2& rkVector )r = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_SUB_ASSIGN, "Ogre_Vector2Class& operator -= ( const Ogre_Vector2Class& rkVector f( const Vector2& rkVector )", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline Vector3& operator -= ( const Real fScalar )r = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_SUB_ASSIGN, "Ogre_Vector3Class& operator -= ( const Real fScalar f( const Real fScalar )", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Vector3& operator -= ( const Vector3& rkVector )r = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_SUB_ASSIGN, "Ogre_Vector3Class& operator -= ( const Ogre_Vector3Class& rkVector f( const Vector3& rkVector )", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Vector4& operator -= ( const Real fScalar )r = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_SUB_ASSIGN, "Ogre_Vector4Class& operator -= ( const Real fScalar f( const Real fScalar )", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline Vector4& operator -= ( const Vector4& rkVector )r = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_SUB_ASSIGN, "Ogre_Vector4Class& operator -= ( const Ogre_Vector4Class& rkVector f( const Vector4& rkVector )", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline Vector2 operator / ( const Real fScalar ) constr = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_DIVIDE, "Ogre_Vector2Class operator / ( const Real fScalar ) cons f( const Real fScalar ) const", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline Vector2 operator / ( const Vector2& rhs) constr = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_DIVIDE, "Ogre_Vector2Class operator / ( const Ogre_Vector2Class& rhs) cons f( const Vector2& rhs) const", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline Vector3 operator / ( const Real fScalar ) constr = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_DIVIDE, "Ogre_Vector3Class operator / ( const Real fScalar ) cons f( const Real fScalar ) const", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Vector3 operator / ( const Vector3& rhs) constr = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_DIVIDE, "Ogre_Vector3Class operator / ( const Ogre_Vector3Class& rhs) cons f( const Vector3& rhs) const", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Vector4 operator / ( const Real fScalar ) constr = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_DIVIDE, "Ogre_Vector4Class operator / ( const Real fScalar ) cons f( const Real fScalar ) const", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline Vector4 operator / ( const Vector4& rhs) constr = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_DIVIDE, "Ogre_Vector4Class operator / ( const Ogre_Vector4Class& rhs) cons f( const Vector4& rhs) const", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline Vector2& operator /= ( const Real fScalar )r = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_DIV_ASSIGN, "Ogre_Vector2Class& operator /= ( const Real fScalar f( const Real fScalar )", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline Vector2& operator /= ( const Vector2& rkVector )r = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_DIV_ASSIGN, "Ogre_Vector2Class& operator /= ( const Ogre_Vector2Class& rkVector f( const Vector2& rkVector )", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline Vector3& operator /= ( const Real fScalar )r = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_DIV_ASSIGN, "Ogre_Vector3Class& operator /= ( const Real fScalar f( const Real fScalar )", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Vector3& operator /= ( const Vector3& rkVector )r = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_DIV_ASSIGN, "Ogre_Vector3Class& operator /= ( const Ogre_Vector3Class& rkVector f( const Vector3& rkVector )", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Vector4& operator /= ( const Real fScalar )r = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_DIV_ASSIGN, "Ogre_Vector4Class& operator /= ( const Real fScalar f( const Real fScalar )", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline Vector4& operator /= ( const Vector4& rkVector )r = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_DIV_ASSIGN, "Ogre_Vector4Class& operator /= ( const Ogre_Vector4Class& rkVector f( const Vector4& rkVector )", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline bool operator < ( const Vector2& rhs ) constr = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_LESSTHAN, "bool operator < ( const Ogre_Vector2Class& rhs ) cons f( const Vector2& rhs ) const", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline bool operator < ( const Vector3& rhs ) constr = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_LESSTHAN, "bool operator < ( const Ogre_Vector3Class& rhs ) cons f( const Vector3& rhs ) const", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Vector2& operator = ( const Real fScalar)r = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_ASSIGNMENT, "Ogre_Vector2Class& operator = ( const Real fScalar f( const Real fScalar)", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline Vector2& operator = ( const Vector2& rkVector )r = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_ASSIGNMENT, "Ogre_Vector2Class& operator = ( const Ogre_Vector2Class& rkVector f( const Vector2& rkVector )", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline Vector3& operator = ( const Real fScaler )r = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_ASSIGNMENT, "Ogre_Vector3Class& operator = ( const Real fScaler f( const Real fScaler )", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Vector3& operator = ( const Vector3& rkVector )r = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_ASSIGNMENT, "Ogre_Vector3Class& operator = ( const Ogre_Vector3Class& rkVector f( const Vector3& rkVector )", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Vector4& operator = ( const Real fScalar)r = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_ASSIGNMENT, "Ogre_Vector4Class& operator = ( const Real fScalar f( const Real fScalar)", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline Vector4& operator = ( const Vector4& rkVector )r = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_ASSIGNMENT, "Ogre_Vector4Class& operator = ( const Ogre_Vector4Class& rkVector f( const Vector4& rkVector )", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline Vector4& operator = (const Vector3& rhs)r = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_ASSIGNMENT, "Ogre_Vector4Class& operator = (const Ogre_Vector3Class& rhs f(const Vector3& rhs)", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline bool operator == ( const Vector2& rkVector ) constr = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_EQUAL, "bool operator == ( const Ogre_Vector2Class& rkVector ) cons f( const Vector2& rkVector ) const", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline bool operator == ( const Vector3& rkVector ) constr = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_EQUAL, "bool operator == ( const Ogre_Vector3Class& rkVector ) cons f( const Vector3& rkVector ) const", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline bool operator == ( const Vector4& rkVector ) constr = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_EQUAL, "bool operator == ( const Ogre_Vector4Class& rkVector ) cons f( const Vector4& rkVector ) const", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline bool operator > ( const Vector2& rhs ) constr = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_GREATERTHAN, "bool operator > ( const Ogre_Vector2Class& rhs ) cons f( const Vector2& rhs ) const", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline bool operator > ( const Vector3& rhs ) constr = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_GREATERTHAN, "bool operator > ( const Ogre_Vector3Class& rhs ) cons f( const Vector3& rhs ) const", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Real operator [] ( const size_t i ) constr = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_INDEX, "Real operator [] ( const size_t i ) cons f( const size_t i ) const", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline Real& operator [] ( const size_t i )r = engine->RegisterObjectBehaviour("Ogre_Vector2Class", asBEHAVE_INDEX, "Real& operator [] ( const size_t i f( const size_t i )", asMETHOD(Ogre::Vector2, f), asCALL_THISCALL); assert(r>=0);//inline Real operator [] ( const size_t i ) constr = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_INDEX, "Real operator [] ( const size_t i ) cons f( const size_t i ) const", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Real& operator [] ( const size_t i )r = engine->RegisterObjectBehaviour("Ogre_Vector3Class", asBEHAVE_INDEX, "Real& operator [] ( const size_t i f( const size_t i )", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); assert(r>=0);//inline Real operator [] ( const size_t i ) constr = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_INDEX, "Real operator [] ( const size_t i ) cons f( const size_t i ) const", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline Real& operator [] ( const size_t i )r = engine->RegisterObjectBehaviour("Ogre_Vector4Class", asBEHAVE_INDEX, "Real& operator [] ( const size_t i f( const size_t i )", asMETHOD(Ogre::Vector4, f), asCALL_THISCALL); assert(r>=0);//inline Vector2 perpendicular(void) constr = engine->RegisterObjectMethod("Ogre_Vector2Class", "Ogre_Vector2Class perpendicular(void) const", asMETHOD(Ogre::Vector2, perpendicular), asCALL_THISCALL); assert(r>=0);//inline Vector3 perpendicular(void) constr = engine->RegisterObjectMethod("Ogre_Vector3Class", "Ogre_Vector3Class perpendicular(void) const", asMETHOD(Ogre::Vector3, perpendicular), asCALL_THISCALL); assert(r>=0);//inline bool positionCloses(const Vector3& rhs, Real tolerance = 1e-03f) constr = engine->RegisterObjectMethod("Ogre_Vector3Class", "bool positionCloses(const Vector3& rhs, Real tolerance = 1e-03f) const", asMETHOD(Ogre::Vector3, positionCloses), asCALL_THISCALL); assert(r>=0);//inline bool positionEquals(const Vector3& rhs, Real tolerance = 1e-03) constr = engine->RegisterObjectMethod("Ogre_Vector3Class", "bool positionEquals(const Vector3& rhs, Real tolerance = 1e-03) const", asMETHOD(Ogre::Vector3, positionEquals), asCALL_THISCALL); assert(r>=0);//inline Real* ptr()r = engine->RegisterObjectMethod("Ogre_Vector2Class", "Real@ptr()", asMETHOD(Ogre::Vector2,ptr), asCALL_THISCALL); assert(r>=0);//inline const Real* ptr() constr = engine->RegisterObjectMethod("Ogre_Vector2Class", "const Real@ptr() const", asMETHOD(Ogre::Vector2,ptr), asCALL_THISCALL); assert(r>=0);//inline Real* ptr()r = engine->RegisterObjectMethod("Ogre_Vector3Class", "Real@ptr()", asMETHOD(Ogre::Vector3,ptr), asCALL_THISCALL); assert(r>=0);//inline const Real* ptr() constr = engine->RegisterObjectMethod("Ogre_Vector3Class", "const Real@ptr() const", asMETHOD(Ogre::Vector3,ptr), asCALL_THISCALL); assert(r>=0);//inline Real* ptr()r = engine->RegisterObjectMethod("Ogre_Vector4Class", "Real@ptr()", asMETHOD(Ogre::Vector4,ptr), asCALL_THISCALL); assert(r>=0);//inline const Real* ptr() constr = engine->RegisterObjectMethod("Ogre_Vector4Class", "const Real@ptr() const", asMETHOD(Ogre::Vector4,ptr), asCALL_THISCALL); assert(r>=0);//inline Vector2 randomDeviant(r = engine->RegisterObjectMethod("Ogre_Vector2Class", "Ogre_Vector2Class randomDeviant( Real angle) const", asMETHOD(Ogre::Vector2, randomDeviant), asCALL_THISCALL); assert(r>=0);//inline Vector3 randomDeviant(r = engine->RegisterObjectMethod("Ogre_Vector3Class", "Ogre_Vector3Class randomDeviant( const Radian& angle, const Vector3& up = Vector3::ZERO ) const", asMETHOD(Ogre::Vector3, randomDeviant), asCALL_THISCALL); assert(r>=0);//inline Vector3 randomDeviant(r = engine->RegisterObjectMethod("Ogre_Vector3Class", "Ogre_Vector3Class randomDeviant( Real angle, const Vector3& up = Vector3::ZERO ) const", asMETHOD(Ogre::Vector3, randomDeviant), asCALL_THISCALL); assert(r>=0);//inline Vector2 reflect(const Vector2& normal) constr = engine->RegisterObjectMethod("Ogre_Vector2Class", "Ogre_Vector2Class reflect(const Vector2& normal) const", asMETHOD(Ogre::Vector2, reflect), asCALL_THISCALL); assert(r>=0);//inline Vector3 reflect(const Vector3& normal) constr = engine->RegisterObjectMethod("Ogre_Vector3Class", "Ogre_Vector3Class reflect(const Vector3& normal) const", asMETHOD(Ogre::Vector3, reflect), asCALL_THISCALL); assert(r>=0);//inline Real squaredDistance(const Vector3& rhs) constr = engine->RegisterObjectMethod("Ogre_Vector3Class", "Real squaredDistance(const Vector3& rhs) const", asMETHOD(Ogre::Vector3, squaredDistance), asCALL_THISCALL); assert(r>=0);//inline Real squaredLength () constr = engine->RegisterObjectMethod("Ogre_Vector2Class", "Real squaredLength() const", asMETHOD(Ogre::Vector2, squaredLength), asCALL_THISCALL); assert(r>=0);//inline Real squaredLength () constr = engine->RegisterObjectMethod("Ogre_Vector3Class", "Real squaredLength() const", asMETHOD(Ogre::Vector3, squaredLength), asCALL_THISCALL); assert(r>=0);//macro//namespace//member//static const Vector2 NEGATIVE_UNIT_X;r = engine->RegisterGlobalProperty("const Ogre_Vector2Class NEGATIVE_UNIT_X", &Ogre::Vector2::NEGATIVE_UNIT_X); assert(r>=0);//static const Vector3 NEGATIVE_UNIT_X;r = engine->RegisterGlobalProperty("const Ogre_Vector3Class NEGATIVE_UNIT_X", &Ogre::Vector3::NEGATIVE_UNIT_X); assert(r>=0);//static const Vector2 NEGATIVE_UNIT_Y;r = engine->RegisterGlobalProperty("const Ogre_Vector2Class NEGATIVE_UNIT_Y", &Ogre::Vector2::NEGATIVE_UNIT_Y); assert(r>=0);//static const Vector3 NEGATIVE_UNIT_Y;r = engine->RegisterGlobalProperty("const Ogre_Vector3Class NEGATIVE_UNIT_Y", &Ogre::Vector3::NEGATIVE_UNIT_Y); assert(r>=0);//static const Vector3 NEGATIVE_UNIT_Z;r = engine->RegisterGlobalProperty("const Ogre_Vector3Class NEGATIVE_UNIT_Z", &Ogre::Vector3::NEGATIVE_UNIT_Z); assert(r>=0);//static const Vector2 UNIT_SCALE;r = engine->RegisterGlobalProperty("const Ogre_Vector2Class UNIT_SCALE", &Ogre::Vector2::UNIT_SCALE); assert(r>=0);//static const Vector3 UNIT_SCALE;r = engine->RegisterGlobalProperty("const Ogre_Vector3Class UNIT_SCALE", &Ogre::Vector3::UNIT_SCALE); assert(r>=0);//static const Vector2 UNIT_X;r = engine->RegisterGlobalProperty("const Ogre_Vector2Class UNIT_X", &Ogre::Vector2::UNIT_X); assert(r>=0);//static const Vector3 UNIT_X;r = engine->RegisterGlobalProperty("const Ogre_Vector3Class UNIT_X", &Ogre::Vector3::UNIT_X); assert(r>=0);//static const Vector2 UNIT_Y;r = engine->RegisterGlobalProperty("const Ogre_Vector2Class UNIT_Y", &Ogre::Vector2::UNIT_Y); assert(r>=0);//static const Vector3 UNIT_Y;r = engine->RegisterGlobalProperty("const Ogre_Vector3Class UNIT_Y", &Ogre::Vector3::UNIT_Y); assert(r>=0);//static const Vector3 UNIT_Z;r = engine->RegisterGlobalProperty("const Ogre_Vector3Class UNIT_Z", &Ogre::Vector3::UNIT_Z); assert(r>=0);//static const Vector2 ZERO;r = engine->RegisterGlobalProperty("const Ogre_Vector2Class ZERO", &Ogre::Vector2::ZERO); assert(r>=0);//static const Vector3 ZERO;r = engine->RegisterGlobalProperty("const Ogre_Vector3Class ZERO", &Ogre::Vector3::ZERO); assert(r>=0);//static const Vector4 ZERO;r = engine->RegisterGlobalProperty("const Ogre_Vector4Class ZERO", &Ogre::Vector4::ZERO); assert(r>=0);//Real x, y, z, w;r = engine->RegisterObjectProperty("Ogre_Vector4Class", "float w", offsetof(Ogre::Vector4, w)); assert(r>=0);//Real x, y;r = engine->RegisterObjectProperty("Ogre_Vector2Class", "float x", offsetof(Ogre::Vector2, x)); assert(r>=0);//Real x, y, z;r = engine->RegisterObjectProperty("Ogre_Vector3Class", "float x", offsetof(Ogre::Vector3, x)); assert(r>=0);//Real x, y, z, w;r = engine->RegisterObjectProperty("Ogre_Vector4Class", "float x", offsetof(Ogre::Vector4, x)); assert(r>=0);//Real x, y;r = engine->RegisterObjectProperty("Ogre_Vector2Class", "float y", offsetof(Ogre::Vector2, y)); assert(r>=0);//Real x, y, z;r = engine->RegisterObjectProperty("Ogre_Vector3Class", "float y", offsetof(Ogre::Vector3, y)); assert(r>=0);//Real x, y, z, w;r = engine->RegisterObjectProperty("Ogre_Vector4Class", "float y", offsetof(Ogre::Vector4, y)); assert(r>=0);//Real x, y, z;r = engine->RegisterObjectProperty("Ogre_Vector3Class", "float z", offsetof(Ogre::Vector3, z)); assert(r>=0);//Real x, y, z, w;r = engine->RegisterObjectProperty("Ogre_Vector4Class", "float z", offsetof(Ogre::Vector4, z)); assert(r>=0);//prototype//void method();r = engine->RegisterObjectMethod("ObjectClass", "void method()", asMETHOD(Object, method), asCALL_THISCALL); assert(r>=0);//Object &operator=(const Object &);r = engine->RegisterObjectBehaviour("ObjectClass", asBEHAVE_ASSIGNMENT, "ObjectClass & f(const Object &)", asMETHOD(Object, f), asCALL_THISCALL); assert(r>=0);//Object &operator=(int);r = engine->RegisterObjectBehaviour("ObjectClass", asBEHAVE_ASSIGNMENT, "ObjectClass & f(int)", asMETHOD(Object, f), asCALL_THISCALL); assert(r>=0);//classr = engine->RegisterObjectType("ObjectClass", sizeof(Object), asOBJ_REF); assert(r>=0);r = engine->RegisterObjectType("Vector2Class", sizeof(Vector2), asOBJ_REF); assert(r>=0);r = engine->RegisterObjectType("Vector3Class", sizeof(Vector3), asOBJ_REF); assert(r>=0);r = engine->RegisterObjectType("Vector4Class", sizeof(Vector4), asOBJ_REF); assert(r>=0);
current problems (being worked on):
- signatures of behaviors not correct
- signature type names not converted
if you find more, please let me know ;)
[Edited by - tdev on July 31, 2009 5:04:05 PM]
This is a great start. However the biggest problem with a code parser like this, is that it has no way of knowing the exact AngelScript signature. For example a parameter taken by pointer in C++ can be mapped to several different parameter forms in AngelScript:
Another problem is that sometimes you want to register a global function as a class member in AngelScript. (Some even want to register class members as global functions, but AS doesn't support that yet).
Somewhere there needs to be manual interaction between the automatic code parsing and the generation of the AS registration code.
I think the ideal tool would be to have a GUI that has the ability to automatically parse the C++ code. The user should then select which types and functions that should be registered, and define any AS specific signature where the C++ signature doesn't match. The tool should then store these user settings, and monitor the application for modifications so that the user can be notified when a change needs to be made to the AS interface.
@ - by handle@+ - by handle with automatic release after return∈ - input reference&inout - in/out reference&out - output reference
Another problem is that sometimes you want to register a global function as a class member in AngelScript. (Some even want to register class members as global functions, but AS doesn't support that yet).
Somewhere there needs to be manual interaction between the automatic code parsing and the generation of the AS registration code.
I think the ideal tool would be to have a GUI that has the ability to automatically parse the C++ code. The user should then select which types and functions that should be registered, and define any AS specific signature where the C++ signature doesn't match. The tool should then store these user settings, and monitor the application for modifications so that the user can be notified when a change needs to be made to the AS interface.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
thanks for enlightening me :)
i created a google code project for it:
http://code.google.com/p/angelscript-cpp-interface-generator/
will post updates here later :)
i created a google code project for it:
http://code.google.com/p/angelscript-cpp-interface-generator/
will post updates here later :)
I've added a link to this on the AngelScript wiki.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement