WIP: Accessors for variable declarations, function definitions and class definitions

This commit is contained in:
Tristan B. Velloza Kildaire 2021-03-21 12:39:29 +02:00
parent c7b2d1663f
commit a004ff0233
1 changed files with 31 additions and 0 deletions

View File

@ -276,6 +276,37 @@ public final class Parser
gprintln("parseBody(): Leave", DebugType.WARNING);
}
private void parseAccessor()
{
/* Save and consume the accessor */
string accessor = getCurrentToken().getToken();
nextToken();
/* TODO: Only allow, private, public, protected */
/* TODO: Pass this to call for class prsewr or whatever comes after the accessor */
/* Get the current token's symbol type */
SymbolType symbolType = getSymbolType(getCurrentToken());
/* Before calling any, consume the token (accessor) */
nextToken();
/* If class */
if(symbolType == SymbolType.CLASS)
{
}
/* If typed-definition (function or variable) */
else if(symbolType == SymbolType.TYPE)
{
/* TODO: Call parseClass with parseClass(View=) */
}
/* Error out */
else
{
expect("Expected either function definition, variable declaration or class definition");
}
}
private void parseFunctionArguments()
{