Added more keywords

This commit is contained in:
Tristan B. Velloza Kildaire 2021-03-05 10:30:27 +02:00
parent a223045bb3
commit 5c37112f42
1 changed files with 21 additions and 0 deletions

View File

@ -37,6 +37,9 @@ public enum SymbolType
PUBLIC,
PRIVATE,
STATIC,
CASE,
GOTO,
DO,
UNKNOWN
}
@ -169,6 +172,24 @@ public static SymbolType getSymbolType(Token tokenIn)
{
return SymbolType.FOR;
}
/* case keyword */
else if(cmp(token, "case") == 0)
{
return SymbolType.CASE;
}
/* goto keyword */
else if(cmp(token, "goto") == 0)
{
return SymbolType.GOTO;
}
/* do keyword */
else if(cmp(token, "do") == 0)
{
return SymbolType.DO;
}
/* Identifier check (TODO: Track vars) */
else if (isAlpha(token))