Пример #1
0
void SinglePass(char* filename,char* symboldef, char* opcode_mnemonic, char* operand, unsigned int* opcode){

	fp=fopen(filename,"r");

	if(fp == NULL){
		printf("해당 파일을 읽을 수 없습니다.\n");
		return;
	}

	while(!feof(fp) && !isDone){
		TokenParser(symboldef,opcode_mnemonic,operand);
		if(letThisLinePass == 0){
			Decoder(symboldef,opcode_mnemonic,operand,opcode);
			Translator(symboldef,opcode_mnemonic,operand,opcode);
		}
		//Initalize control signals before next line
		statusBit = 0;
		whereIsOnOPTAB = -1;
		whereIsOnASMTAB = -1;
	}
	if(whichPass == 1){
		DeployLiteral(&PC);
	}
	if(whichPass == 2){
		PrintModificationRecord(); //Print modification record
		ht_print(SYMTAB,"SYMTAB");
	}

	fclose(fp);
	letThisLinePass=0;
	isDone = 0;
	whereIsOnOPTAB =0;
	whereIsOnASMTAB =0;

}
Пример #2
0
void *
toPointer(trace::Value &value, bool bind)
{
    Range range;
    Translator(bind, range).apply(&value);
    return range.ptr;
}
void ExpandedLEDSerialControllerMega::LEDSerialProcess () {
  while (Serial1.available() > 0)
  {
    char c = char(Serial1.read());
    if (c != ';') {
      serialIn += c;
    }
    else {
      Translator (serialIn.c_str(), activeMode, activeState);
      serialIn = "";
    }
  }

  SetMode (activeMode);
  SetState (activeState);
}
Пример #4
0
void *
toPointer(trace::Value &value, bool bind) {
    return Translator(bind) (&value);
}
Пример #5
0
void
toRange(trace::Value &value, Range &range)
{
    Translator(false, range).apply(&value);
}
Пример #6
0
void ImageViewer::mouseDoubleClickEvent(QMouseEvent *event) {
    if(QFileInfo(fileName_).exists()) Translator(workingDir_, ApplicationData::translatorsDir().canonicalPath()).open(fileName_, extension_);
    QFrame::mouseDoubleClickEvent(event);
}
Пример #7
0
//---------------------------------------------------------
bool CTL_Merge::On_Execute(void)
{
	CSG_String	Target	= Parameters("TARGET")->asString();
	CSG_Strings	Files;

	if( !Parameters("FILES")->asFilePath()->Get_FilePaths(Files) || Files.Get_Count() <= 1 )
	{
		Error_Set(SG_T("no files to merge"));

		return( false );
	}

	//-----------------------------------------------------
	int			i, j;
	CSG_Table	Merge;

	if( !Merge.Create(Files[0], TABLE_FILETYPE_Text) )
	{
		Merge.Destroy();

		Merge.Add_Field(SG_T("ORIGINAL")	, SG_DATATYPE_String);
		Merge.Add_Field(SG_T("TRANSLATION")	, SG_DATATYPE_String);

	}

	Merge.Save(Target, TABLE_FILETYPE_Text);

	//-----------------------------------------------------
	for(i=1; i<Files.Get_Count() && Process_Get_Okay(); i++)
	{
		CSG_Translator	Translator(Target, false);
		CSG_Table		Add(Target, TABLE_FILETYPE_Text);

		if( Merge.Create(Files[i], TABLE_FILETYPE_Text) )
		{
			for(j=0; j<Merge.Get_Count() && Set_Progress(j, Merge.Get_Count()); j++)
			{
				if( !Translator.Get_Translation(Merge[j].asString(0), true) )
				{
					Add.Add_Record(Merge.Get_Record(j));
				}
			}

			if( Add.Get_Count() > Translator.Get_Count() )
			{
				Add.Save(Target, TABLE_FILETYPE_Text);
			}
		}
	}

	//-----------------------------------------------------
	for(i=Merge.Get_Count()-1; i>0 && Process_Get_Okay(); i--)
	{
		if( !SG_STR_CMP(Merge[i].asString(0), Merge[i - 1].asString(0)) )
		{
			Merge.Del_Record(i);
		}
	}

	//-----------------------------------------------------
	return( true );
}