Esempio n. 1
0
void loader(const char *programName)
{

	FILE *file_ptr;
	char c;
	char *dataSegment;
	file_ptr = fopen(programName, "r");
	reset();
	while ( (c = fgetc(file_ptr)) != EOF )
	{
		while ( isspace( ( c = fgetc(file_ptr) ) ) );

		if ( c == '.' )
		{
			
			dataSegment = getWord(file_ptr);   

			if ( !strcmp(dataSegment, "data") )
			{
				getDataSegment(file_ptr);
				putchar('\n');//print new line after printing datas.
				return;

			}
			else if ( !strcmp(dataSegment, "text") )
			{
				getTextSegment(file_ptr);
				return;
			}
			else if ( !strcmp(dataSegment, "end") )  // end of main 			{
				return;
			}
		}
		else if ( c == '#' )
Esempio n. 2
0
void AXLexer::lex(){
	this->header = getHeader();

	/* Read raw label first*/
	this->rawLabel = getObjectTemp();

	this->code = getIRList();
	this->data = getDataSegment();
	this->debug = getDINFO();
	this->libDat = getLIBDATList();
	this->structDat = getSTRUCTDATList();
	this->structPrm = getSTRUCTPRMList();
	this->hpiDat = getHPIDATList();

	return;
}