Saturday, December 5, 2009

SYMBOL TABLE

The symbol table program is used to find the address of individual characters,numeric,special characters.Simplest symbol table data structure in C language program is give below:

void main()
{
int i,len;
char e[20];
clrscr();
printf("\nEnter the expression:" );
scanf("%s",e);
len=strlen(e);
if(e[1]!='=')
{
printf("\nThe given expression is wrong");
printf("\nassignment is not possible");
getch();
exit(0);
}
printf("\nSYMBOL TABLE");
printf("\nSYMBOL\tADDRESS\tTYPE");
for(i=0;i
{
if(isdigit(e[i]))
printf("\n%c\t%u\tCONSTANT",e[i],e[i]);
if(isalpha(e[i]))
{
printf("\n%c\t%u\tIDENTIFIER",e[i],e[i]);
}
}
getch();
}

0 comments:

Post a Comment

  © Blogger template Coozie by Ourblogtemplates.com 2008

Back to TOP