Пример #1
0
void GetNumber()
{
	int i=0;

	if ('\'' == *src)
	{
		tok.ident[0]=*src++;
		tok.ident[1]=*src++;
		tok.ident[2]=*src++;
		tok.ident[3]='\0';
		//token[0]=*src++;
		//token[1]=*src++;
		//token[2]=*src++;
		//token[3]=0;
	}
	else
	{
		i=0;
		while (chr_table[*src] != SPECIAL)
		{
			//token[i++]=*src++;
			tok.ident[i++]=*src++;
		}
		//token[i]=0;
		tok.ident[i]='\0';
	}

	//if (token[0]=='$')
	if ('$' == tok.ident[0])
	{
		//token_nvalue=hextoi(token+1);
		tok.value=hextoi(tok.ident+1);
	}
	//else if (token[0]=='\'')
	else if ('\'' == tok.ident[0])
	{
		DoTickMarks();
	}
	else
	{
		//token_nvalue=atoi(token);
		tok.value=atoi(tok.ident);
	}
}
Пример #2
0
void GetNumber()
{
  int i;

  if ('\'' == *src)
  {
    token[0]=*src++;
    token[1]=*src++;
    token[2]=*src++;
    token[3]=0;
  }
  else
  {
    i=0;
    while (chr_table[*src] != SPECIAL)
      token[i++]=*src++;
    token[i]=0;
  }
  if (token[0]=='$') ConvHexToDec();
  else if (token[0]=='\'') DoTickMarks();
  else token_nvalue=atoi(token);
}