Skip to content

Instantly share code, notes, and snippets.

@Biazus
Last active August 29, 2015 14:07
Show Gist options
  • Save Biazus/a8d10f0a1f9c22676553 to your computer and use it in GitHub Desktop.
Save Biazus/a8d10f0a1f9c22676553 to your computer and use it in GitHub Desktop.
Etapa 5 Compiladores - hash
HASh_NODE *makeTemp(void)
{
static int nextTemp = 0;
static char tempName[256];
sprintf(tempName,"myStrangeeTemp%d", nextTemp++);
return hashInsert(HASH_VARIABLE, tempName);
}
HASh_NODE *makeLabel(void)
{
static int nextLabel = 0;
static char labelName[256];
sprintf(labelName,"myStrangeelabel%d", nextlabel++);
return hashInsert(SYMBOL_LABEL, labelName);
}
#define SYMBOL_LABEL 12
HASH_NODE *makeTemp(void);
HASH_NODE *makeLabel(void);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment