Exemplo n.º 1
0
	ISClass* SAnalyzeExternalClass(Lexer::ILexer* lexer, SyntaxApi::IClass* base_class, SemanticApi::ISClass* _sbase_class, 
		TExternalClassDecl decl, TGlobalBuildContext build_context, 
		std::vector<SemanticApi::TExternalSMethod> external_classes_bindings, int& curr_bind)
	{
		auto sbase_class = dynamic_cast<TSClass*>(_sbase_class);
		lexer->ParseSource(decl.source.c_str());

		auto cl = SyntaxApi::AnalyzeNestedClass(lexer, base_class);

		TSClass* scl = new TSClass(sbase_class, cl);
		sbase_class->AddClass(scl);
		scl->Build();

		scl->LinkSignature(build_context);
		scl->SetSize(decl.size);
		if (scl->GetType() == SemanticApi::TNodeWithTemplatesType::Template)
			scl->SetAutoMethodsInitialized();
		else
			scl->InitAutoMethods();
		//scl->CalculateMethodsSizes();

		//TODO проверка что заданы все external_func
		scl->SetExternal(external_classes_bindings, curr_bind);

		return scl;
	}
Exemplo n.º 2
0
void TSyntaxAnalyzer::CreateInternalClasses()
{
	TNameId name_id = lexer->GetIdFromName("dword");
	TClass* t_syntax = new TClass(base_class.get());
	base_class->AddNested(t_syntax);
	t_syntax->name = name_id;
	TSClass* t = new TSClass(sem_base_class.get(), t_syntax);
	t->SetSize(1);
	t->SetSignatureLinked();
	t->SetBodyLinked();
	sem_base_class->AddClass(t);
}
Exemplo n.º 3
0
	void CreateInternalClasses(Lexer::ILexer* lexer, SyntaxApi::IClass* base_class, SemanticApi::ISClass* _sbase_class)
	{
		lexer->ParseSource("class dword {}");
		SyntaxApi::IClass* t_syntax = SyntaxApi::AnalyzeNestedClass(lexer, base_class);

		auto sbase_class = dynamic_cast<TSClass*>(_sbase_class);
		TSClass* t = new TSClass(sbase_class, t_syntax);
		t->SetSize(1);
		t->SetSignatureLinked();
		t->SetBodyLinked();
		sbase_class->AddClass(t);
	}