bool Assembler::AssembleFile(char* a_szAssemblyPath, char* a_szOuputScriptPath, char* a_szScriptName)
{
	std::ofstream l_BinaryFile(a_szOuputScriptPath, std::ofstream::binary | std::ofstream::out);
	m_pAssemblyFile = new std::ifstream(a_szAssemblyPath, std::ifstream::in);


	m_szScriptName = a_szScriptName;

	CollectCode();
	CleanCode();

	if(CollectNatives() && ParseCode())
	{
		ConstructBinary(&l_BinaryFile);
	}
	else
	{
		printf("Couldn't parse code !\n");
	}

	
	m_AssemblyLines.clear();
	m_pAssemblyFile->close();
	l_BinaryFile.close();

	delete m_pAssemblyFile;
	return false;
}
Exemplo n.º 2
0
static void
RestoreHashPreds( USES_REGS1 )
{
  UInt i;

  for (i = 0; i < PredHashTableSize; i++) {
    PredEntry *p = PredHash[i];

    if (p)
      p = PredEntryAdjust(p);
    while (p) {
      Prop nextp;
      
      if (p->NextOfPE)
	p->NextOfPE = PropAdjust(p->NextOfPE);
      nextp = p->NextOfPE;
      CleanCode(p PASS_REGS);
      p = RepPredProp(nextp);
    }
  }
}