Last active
August 29, 2015 14:07
-
-
Save Biazus/a8d10f0a1f9c22676553 to your computer and use it in GitHub Desktop.
Etapa 5 Compiladores - hash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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