Description
Exercise #7
Edit the parse.c file and fill in the functions to make a complete JSON parser that generates a complete JSON "value" that will be printed by the main.c main function. Files provided for you include:
parse.c:
- The file you should edit to complete this program. You may add to or remove the provided function stubs as you see fit.
json.h
:
- Contains the data structures for a JSON value. Comments include the JSON grammar which you may wish to use for reference.
main.h
:
- Includes the other structures for everything else.
lex.c
:
- The lexer. The lexer maintains the _line global variable which should indicate what line of the input the lexer is currently on, to help in debugging your parser.
print.c
:
- Functions to print the value are provided for you.
main.c
:
- Loads a file, initializes the lexer and asks your parser to parse the input.