Commit Graph
76 Commits
Author SHA1 Message Date
abdelrahman ec6df32839 Start implementing using the state transition table in the lexer 2023-07-30 11:47:26 +01:00
abdelrahman de57d9f14b Add enum value for newline 2023-07-30 00:37:39 +01:00
abdelrahman f1f90cf56b Specify the length of the strings tables explicitly 2023-07-29 22:10:28 +01:00
abdelrahman 41d7cf2717 Reformat 2023-07-29 22:09:09 +01:00
abdelrahman 002a8e7064 Get the input and state strings from tables instead of switch cases 2023-07-29 22:07:03 +01:00
abdelrahman fc80095d1f Remove clear_file and update write_table to accept a file pointer 2023-07-29 21:46:59 +01:00
abdelrahman 642d000ebd Fix keyword handling so the final keyword states don't consume input 2023-07-29 21:42:20 +01:00
abdelrahman b4a4865870 Regenerate the state table 2023-07-27 00:54:53 +01:00
abdelrahman 1b4d6a6156 Update column width and write row state as a comment 2023-07-27 00:53:39 +01:00
abdelrahman 26fabd91b9 Ensure build scripts fail if attempting to run them from different
directory
2023-07-25 09:00:11 +01:00
abdelrahman adde1db0f4 Finalise generating the state table 2023-07-25 08:56:42 +01:00
abdelrahman 7eec0e0730 Add generating the table to the main build script 2023-07-25 08:56:18 +01:00
abdelrahman 6c454fbb8e Add char_type function to lexer.c but exclude it from build 2023-07-25 08:55:46 +01:00
abdelrahman fd8231b02d Pull states and inputs enums to a separate header 2023-07-23 22:49:23 +01:00
abdelrahman 09f2315b66 Test generating a state transition table 2023-07-23 22:49:09 +01:00
abdelrahman 91162654b3 Initial work on converting the state machine to a state table 2023-07-23 22:48:28 +01:00
abdelrahman 6e93d3ecd1 Update .gitignore 2023-07-23 22:48:05 +01:00
abdelrahman 621e50ee24 Convert free_json to an iterative function to avoid stack overflow on
large files
2023-07-12 00:37:45 +01:00
abdelrahman 2bbf21f90b Remove compile_commands.json from source control 2023-07-09 23:50:06 +01:00
abdelrahman f5b1fae214 Update README 2023-07-09 23:46:25 +01:00
abdelrahman 25e9c2db04 Add todo 2023-07-09 22:30:14 +01:00
abdelrahman f1519cf0ea Read the file into a dynamic array to avoid stack overflow 2023-07-02 20:50:24 +01:00
abdelrahman dde80250ed Cleanup unused includes 2023-07-01 16:48:47 +01:00
abdelrahman f9e9f0ebd8 Add function to traverse json tree and free all memory allocations 2023-07-01 16:45:31 +01:00
abdelrahman 135a6da54c Ensure negative numbers are handled properly 2023-07-01 15:12:21 +01:00
abdelrahman e818135aef Move the logic for loading a json file into the load_json function 2023-07-01 15:05:53 +01:00
abdelrahman 10597c0ed7 Remove validate_json 2023-07-01 15:05:41 +01:00
abdelrahman ff110ea6e2 Move the json entities specific functions to json_entities 2023-07-01 15:04:59 +01:00
abdelrahman 99f5c5bfe5 Refactored parse_token function 2023-07-01 04:43:52 +01:00
abdelrahman 7e4d82888a Updated print_token function 2023-07-01 04:43:29 +01:00
abdelrahman 2a4d573118 Add print_json function to traverse json tree and print all elements 2023-07-01 04:42:40 +01:00
abdelrahman f8d69310be Update debug config 2023-07-01 04:42:00 +01:00
abdelrahman 96e9df0434 Parser test implementation 2023-06-28 23:36:52 +01:00
abdelrahman ce38afc59f Update json entities 2023-06-28 23:36:37 +01:00
abdelrahman 202dc51a18 Update debug config 2023-06-28 23:36:16 +01:00
abdelrahman 9c0ababd93 Update test files 2023-06-28 23:35:57 +01:00
abdelrahman b6d4a1f218 Ensure the functions declared in lexer.c are static 2023-06-28 21:44:04 +01:00
abdelrahman 740d9b6566 Combine TK_TRUE and TK_FALSE into TK_BOOL 2023-06-28 21:43:35 +01:00
abdelrahman 75b18d96ee Add extra test file 2023-06-28 21:42:42 +01:00
abdelrahman 14ad503d4d Updated json_entities 2023-06-27 23:16:26 +01:00
abdelrahman 1e510411dc get_next_token returns result which includes possible error and token 2023-06-27 22:23:16 +01:00
abdelrahman 3ded1d2708 Testing building json objects in C 2023-06-25 23:52:45 +01:00
abdelrahman c4caa1bb84 Update test_files README 2023-06-24 03:43:42 +01:00
abdelrahman 311a9362ea Update debug config 2023-06-24 03:41:56 +01:00
abdelrahman 84533ad643 Ensure lexer returns correct token for numerical values 2023-06-24 03:41:22 +01:00
abdelrahman 7a326421b8 Add dstr_find function 2023-06-24 03:40:04 +01:00
abdelrahman 5f926f060e Add more examples 2023-06-24 03:39:45 +01:00
abdelrahman fd525e26a6 Update print format specifier 2023-06-22 00:37:59 +01:00
abdelrahman 2ef4e2f056 Cleanup 2023-06-20 23:38:46 +01:00
abdelrahman 1b56aaa185 Started implementing the get_next_token function 2023-06-20 23:37:56 +01:00
abdelrahman e4d161d79d Plan work for get_next_token function 2023-06-20 21:56:59 +01:00
abdelrahman 0d289df26f Fix bug in dstr_to_cstr 2023-06-20 21:56:33 +01:00
abdelrahman 62f45b6a7f Add str_view_t 2023-06-20 21:55:59 +01:00
abdelrahman 31e19a50fc Save string and number values for tokenisation 2023-06-18 22:57:08 +01:00
abdelrahman f0043a691c Rename lexer string functions 2023-06-18 22:08:47 +01:00
abdelrahman 57fe5ab1b7 Add dstr_t type 2023-06-18 21:40:36 +01:00
abdelrahman 0095d8fe61 Rename lexer_states to lexer 2023-06-18 21:39:50 +01:00
abdelrahman 909bcf3056 Add test files for unicode sequences 2023-06-18 00:23:40 +01:00
abdelrahman 386dfe72db Added string type that works for both keywords and unicode sequences 2023-06-18 00:03:31 +01:00
abdelrahman 727d41c5ff Added script to test all the example json files 2023-06-18 00:03:07 +01:00
abdelrahman ed9b5fb638 Add keyword support 2023-06-17 22:10:48 +01:00
abdelrahman aff2735b9f Update examples 2023-06-17 22:10:38 +01:00
abdelrahman 558d01448d Update debug config 2023-06-17 22:10:27 +01:00
abdelrahman b0e527ee76 Added handling numerical states 2023-06-17 18:44:30 +01:00
abdelrahman 43630526dc Handle objects, arrays and strings 2023-06-17 15:27:16 +01:00
abdelrahman d7791e3794 Add test files 2023-06-17 15:27:03 +01:00
abdelrahman 75c282a58c Update .gitignore 2023-06-17 15:26:52 +01:00
abdelrahman 94398935e8 Configure debugging 2023-06-17 15:26:30 +01:00
abdelrahman aacadcb5f5 Remove binary 2023-06-17 11:46:43 +01:00
abdelrahman cad6b938b3 Started implementing the lexer 2023-06-17 00:45:00 +01:00
abdelrahman f4b826a299 Reorganise 2023-06-16 22:38:37 +01:00
abdelrahman 4a657e5a2c Initial testing of parsing JSON objects 2023-06-13 23:58:38 +01:00
abdelrahman 82c2fcdc64 Continue experimenting with state machines 2023-06-13 23:36:14 +01:00
abdelrahman 23a7874950 Removed the binary from source control 2023-06-13 00:22:32 +01:00
abdelrahman cf7b1352e8 Add some notes 2023-06-11 22:22:55 +01:00
abdelrahman a7a6c00aad INITIAL COMMIT 2023-06-11 21:11:29 +01:00