#ifndef _class

#define _class

#include "index.h"

#include "array.h"

#include "file.h"

#include "text.h"

#include "lexer.h"

#include "template.h"

#include <string.h> 

#include <stdbool.h> 



struct class{

	int classIndex;

	char * className;

	int lexerIndex;


	struct template * template;
	

	struct array * properties;

	struct array * methods;

	struct array * extends;
	

	int hasExtended;

	int hasReflection;

	bool usesTemplate;

};

struct class * class_new();



void class_composeTypedefStruct( struct class * classInstance, struct text * classHeader );

void class_reIndexLineNumbers( struct class * baseClass );

void class_updateThisArgument( struct array * arguments, char * baseClassName );

int class_getMethodIndexByName( struct class * classInstance, char * methodName );

void class_addMethodsToBaseClass( struct class * baseClass, struct class * extendedClass );

void class_addPropertiesToBaseClass( struct class * baseClass, struct class * extendedClass );

void class_extendClass( struct class * baseClass );

int class_findClassByClassNameExists( array * classesArray, char * name );

void class_extractMethod( lexer * currentLexer, char * source, int i, struct class * classInstance, struct array * classesArray, struct array * functions );

void class_extractProperty( lexer * currentLexer, int key, int i, char * source, struct class * classInstance );

char * class_extractBodyFromSource( lexer * currentLexer, int i, char * source, int bodyCloseIndex );

struct property * class_getPropertyByName( struct class * classInstance, char * propertyName );

int class_getPropertyIndexByName( struct class * classInstance, char * propertyName );

void class_composeHeader( struct class * classInstance,  struct text * classHeader, char * filename );

void class_composeStruct( struct class * classInstance, struct text * classHeader );

void class_composeMethods( struct class * classInstance,  struct text * classHeader, struct array * sourceArray );




struct property * class_getClassPropertyByPropertyName( struct class * instance, char * propertyName ) ;

char * class_openingDeclarationFromBaseClassName( char * baseClassName, char * currentOperatorSymbol, int leftSideIsPointer );

char * class_getDatatypeFromClassProperty( char * declaration, struct array * variables );

int class_classNameIsPrimitive( char * baseClassName );

char * class_getBaseClassNameBySymbol( char * leftSideSymbol, struct array * variables, int * leftSideIsPointer ) ;

#endif