Submit and pass all tests to enable saving to GitHub.
Implementation
Your Task
Implement function declaration and function call parsing.
Requirements
Parse function declarations:
Return type (int, void, char, etc.)
Function name
Parameter list (can be empty)
Function body (block statement)
Create AST nodes:
NODE_FUNC_DECL: Contains name, params, return type, body
NODE_PARAM: Contains type and name
NODE_CALL: Function call expression
Parse function calls:
name(arg1, arg2, ...)
Zero or more arguments
Arguments are expressions
Handle edge cases:
Empty parameter list: void foo()
Void return type: void foo()
No parameters notation: int foo(void)
Function declarations without body (prototypes)
Success Criteria
Parse: int main() { return 0; }
Parse: int add(int a, int b) { return a + b; }
Parse: result = add(x, y + 1);
Why This Matters
Parsing declarations is famously the hardest part of C — the spiral rule, function pointers, and the lexer hack all live here — and it is why tools like cdecl exist. Clang devotes thousands of lines to declarator parsing; implementing even simple function declarations teaches you why C++ needed 'most vexing parse' as a term of art.