Start working on json_entities
This commit is contained in:
		
							
								
								
									
										4
									
								
								compile
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								compile
									
									
									
									
									
								
							| @@ -9,6 +9,10 @@ OUT=main | ||||
| CFLAGS+=" -Iinclude/dstring" | ||||
| SRC+=" src/dstring/*.c" | ||||
|  | ||||
| # JSON_ENTITIES | ||||
| CFLAGS+=" -Iinclude/json_entities" | ||||
| SRC+=" src/json_entities/*.c" | ||||
|  | ||||
| # LEXER | ||||
| CFLAGS+=" -Iinclude/lexer" | ||||
| SRC+=" src/lexer/*.c" | ||||
|   | ||||
| @@ -9,14 +9,15 @@ | ||||
|       "-pedantic", | ||||
|       "-Iinclude", | ||||
|       "-Iinclude/dstring", | ||||
|       "-Iinclude/json_entities", | ||||
|       "-Iinclude/lexer", | ||||
|       "-o", | ||||
|       "main", | ||||
|       "src/main.c" | ||||
|     ], | ||||
|     "directory": "/mnt/3A5CDF785CDF2CFF/Users/abdoo/dev/say_it_in_json", | ||||
|     "file": "/mnt/3A5CDF785CDF2CFF/Users/abdoo/dev/say_it_in_json/src/main.c", | ||||
|     "output": "/mnt/3A5CDF785CDF2CFF/Users/abdoo/dev/say_it_in_json/main" | ||||
|     "directory": "/Users/abdelrahman/dev/personal/say-it-in-json", | ||||
|     "file": "/Users/abdelrahman/dev/personal/say-it-in-json/src/main.c", | ||||
|     "output": "/Users/abdelrahman/dev/personal/say-it-in-json/main" | ||||
|   }, | ||||
|   { | ||||
|     "arguments": [ | ||||
| @@ -28,14 +29,15 @@ | ||||
|       "-pedantic", | ||||
|       "-Iinclude", | ||||
|       "-Iinclude/dstring", | ||||
|       "-Iinclude/json_entities", | ||||
|       "-Iinclude/lexer", | ||||
|       "-o", | ||||
|       "main", | ||||
|       "src/dstring/dstring.c" | ||||
|     ], | ||||
|     "directory": "/mnt/3A5CDF785CDF2CFF/Users/abdoo/dev/say_it_in_json", | ||||
|     "file": "/mnt/3A5CDF785CDF2CFF/Users/abdoo/dev/say_it_in_json/src/dstring/dstring.c", | ||||
|     "output": "/mnt/3A5CDF785CDF2CFF/Users/abdoo/dev/say_it_in_json/main" | ||||
|     "directory": "/Users/abdelrahman/dev/personal/say-it-in-json", | ||||
|     "file": "/Users/abdelrahman/dev/personal/say-it-in-json/src/dstring/dstring.c", | ||||
|     "output": "/Users/abdelrahman/dev/personal/say-it-in-json/main" | ||||
|   }, | ||||
|   { | ||||
|     "arguments": [ | ||||
| @@ -47,220 +49,34 @@ | ||||
|       "-pedantic", | ||||
|       "-Iinclude", | ||||
|       "-Iinclude/dstring", | ||||
|       "-Iinclude/json_entities", | ||||
|       "-Iinclude/lexer", | ||||
|       "-o", | ||||
|       "main", | ||||
|       "src/json_entities/json_entities.c" | ||||
|     ], | ||||
|     "directory": "/Users/abdelrahman/dev/personal/say-it-in-json", | ||||
|     "file": "/Users/abdelrahman/dev/personal/say-it-in-json/src/json_entities/json_entities.c", | ||||
|     "output": "/Users/abdelrahman/dev/personal/say-it-in-json/main" | ||||
|   }, | ||||
|   { | ||||
|     "arguments": [ | ||||
|       "/usr/bin/clang", | ||||
|       "-c", | ||||
|       "-g", | ||||
|       "-Wall", | ||||
|       "-Werror", | ||||
|       "-pedantic", | ||||
|       "-Iinclude", | ||||
|       "-Iinclude/dstring", | ||||
|       "-Iinclude/json_entities", | ||||
|       "-Iinclude/lexer", | ||||
|       "-o", | ||||
|       "main", | ||||
|       "src/lexer/lexer.c" | ||||
|     ], | ||||
|     "directory": "/mnt/3A5CDF785CDF2CFF/Users/abdoo/dev/say_it_in_json", | ||||
|     "file": "/mnt/3A5CDF785CDF2CFF/Users/abdoo/dev/say_it_in_json/src/lexer/lexer.c", | ||||
|     "output": "/mnt/3A5CDF785CDF2CFF/Users/abdoo/dev/say_it_in_json/main" | ||||
|   }, | ||||
|   { | ||||
|     "arguments": [ | ||||
|       "/usr/bin/clang-16", | ||||
|       "-cc1", | ||||
|       "-triple", | ||||
|       "x86_64-redhat-linux-gnu", | ||||
|       "-emit-obj", | ||||
|       "-mrelax-all", | ||||
|       "-disable-free", | ||||
|       "-clear-ast-before-backend", | ||||
|       "-disable-llvm-verifier", | ||||
|       "-discard-value-names", | ||||
|       "-main-file-name", | ||||
|       "-mrelocation-model", | ||||
|       "static", | ||||
|       "-mframe-pointer=all", | ||||
|       "-fmath-errno", | ||||
|       "-ffp-contract=on", | ||||
|       "-fno-rounding-math", | ||||
|       "-mconstructor-aliases", | ||||
|       "-funwind-tables=2", | ||||
|       "-target-cpu", | ||||
|       "x86-64", | ||||
|       "-tune-cpu", | ||||
|       "generic", | ||||
|       "-mllvm", | ||||
|       "-treat-scalable-fixed-error-as-warning", | ||||
|       "-debug-info-kind=constructor", | ||||
|       "-dwarf-version=4", | ||||
|       "-debugger-tuning=gdb", | ||||
|       "-fcoverage-compilation-dir=/home/abdelrahman/dev_work/say_it_in_json", | ||||
|       "-resource-dir", | ||||
|       "/usr/lib64/clang/16", | ||||
|       "-I", | ||||
|       "include", | ||||
|       "-I", | ||||
|       "include/dstring", | ||||
|       "-I", | ||||
|       "include/lexer", | ||||
|       "-internal-isystem", | ||||
|       "/usr/lib64/clang/16/include", | ||||
|       "-internal-isystem", | ||||
|       "/usr/local/include", | ||||
|       "-internal-isystem", | ||||
|       "/usr/bin/../lib/gcc/x86_64-redhat-linux/13/../../../../x86_64-redhat-linux/include", | ||||
|       "-internal-externc-isystem", | ||||
|       "/include", | ||||
|       "-internal-externc-isystem", | ||||
|       "/usr/include", | ||||
|       "-Wall", | ||||
|       "-Werror", | ||||
|       "-pedantic", | ||||
|       "-fdebug-compilation-dir=/home/abdelrahman/dev_work/say_it_in_json", | ||||
|       "-ferror-limit", | ||||
|       "19", | ||||
|       "-fgnuc-version=4.2.1", | ||||
|       "-fcolor-diagnostics", | ||||
|       "-faddrsig", | ||||
|       "-D__GCC_HAVE_DWARF2_CFI_ASM=1", | ||||
|       "-x", | ||||
|       "c", | ||||
|       "-o", | ||||
|       "/tmp/main-fcfd2b.o", | ||||
|       "src/main.c" | ||||
|     ], | ||||
|     "directory": "/mnt/3A5CDF785CDF2CFF/Users/abdoo/dev/say_it_in_json", | ||||
|     "file": "/mnt/3A5CDF785CDF2CFF/Users/abdoo/dev/say_it_in_json/src/main.c", | ||||
|     "output": "/tmp/main-fcfd2b.o" | ||||
|   }, | ||||
|   { | ||||
|     "arguments": [ | ||||
|       "/usr/bin/clang-16", | ||||
|       "-cc1", | ||||
|       "-triple", | ||||
|       "x86_64-redhat-linux-gnu", | ||||
|       "-emit-obj", | ||||
|       "-mrelax-all", | ||||
|       "-disable-free", | ||||
|       "-clear-ast-before-backend", | ||||
|       "-disable-llvm-verifier", | ||||
|       "-discard-value-names", | ||||
|       "-main-file-name", | ||||
|       "-mrelocation-model", | ||||
|       "static", | ||||
|       "-mframe-pointer=all", | ||||
|       "-fmath-errno", | ||||
|       "-ffp-contract=on", | ||||
|       "-fno-rounding-math", | ||||
|       "-mconstructor-aliases", | ||||
|       "-funwind-tables=2", | ||||
|       "-target-cpu", | ||||
|       "x86-64", | ||||
|       "-tune-cpu", | ||||
|       "generic", | ||||
|       "-mllvm", | ||||
|       "-treat-scalable-fixed-error-as-warning", | ||||
|       "-debug-info-kind=constructor", | ||||
|       "-dwarf-version=4", | ||||
|       "-debugger-tuning=gdb", | ||||
|       "-fcoverage-compilation-dir=/home/abdelrahman/dev_work/say_it_in_json", | ||||
|       "-resource-dir", | ||||
|       "/usr/lib64/clang/16", | ||||
|       "-I", | ||||
|       "include", | ||||
|       "-I", | ||||
|       "include/dstring", | ||||
|       "-I", | ||||
|       "include/lexer", | ||||
|       "-internal-isystem", | ||||
|       "/usr/lib64/clang/16/include", | ||||
|       "-internal-isystem", | ||||
|       "/usr/local/include", | ||||
|       "-internal-isystem", | ||||
|       "/usr/bin/../lib/gcc/x86_64-redhat-linux/13/../../../../x86_64-redhat-linux/include", | ||||
|       "-internal-externc-isystem", | ||||
|       "/include", | ||||
|       "-internal-externc-isystem", | ||||
|       "/usr/include", | ||||
|       "-Wall", | ||||
|       "-Werror", | ||||
|       "-pedantic", | ||||
|       "-fdebug-compilation-dir=/home/abdelrahman/dev_work/say_it_in_json", | ||||
|       "-ferror-limit", | ||||
|       "19", | ||||
|       "-fgnuc-version=4.2.1", | ||||
|       "-fcolor-diagnostics", | ||||
|       "-faddrsig", | ||||
|       "-D__GCC_HAVE_DWARF2_CFI_ASM=1", | ||||
|       "-x", | ||||
|       "c", | ||||
|       "-o", | ||||
|       "/tmp/dstring-46186e.o", | ||||
|       "src/dstring/dstring.c" | ||||
|     ], | ||||
|     "directory": "/mnt/3A5CDF785CDF2CFF/Users/abdoo/dev/say_it_in_json", | ||||
|     "file": "/mnt/3A5CDF785CDF2CFF/Users/abdoo/dev/say_it_in_json/src/dstring/dstring.c", | ||||
|     "output": "/tmp/dstring-46186e.o" | ||||
|   }, | ||||
|   { | ||||
|     "arguments": [ | ||||
|       "/usr/bin/clang-16", | ||||
|       "-cc1", | ||||
|       "-triple", | ||||
|       "x86_64-redhat-linux-gnu", | ||||
|       "-emit-obj", | ||||
|       "-mrelax-all", | ||||
|       "-disable-free", | ||||
|       "-clear-ast-before-backend", | ||||
|       "-disable-llvm-verifier", | ||||
|       "-discard-value-names", | ||||
|       "-main-file-name", | ||||
|       "-mrelocation-model", | ||||
|       "static", | ||||
|       "-mframe-pointer=all", | ||||
|       "-fmath-errno", | ||||
|       "-ffp-contract=on", | ||||
|       "-fno-rounding-math", | ||||
|       "-mconstructor-aliases", | ||||
|       "-funwind-tables=2", | ||||
|       "-target-cpu", | ||||
|       "x86-64", | ||||
|       "-tune-cpu", | ||||
|       "generic", | ||||
|       "-mllvm", | ||||
|       "-treat-scalable-fixed-error-as-warning", | ||||
|       "-debug-info-kind=constructor", | ||||
|       "-dwarf-version=4", | ||||
|       "-debugger-tuning=gdb", | ||||
|       "-fcoverage-compilation-dir=/home/abdelrahman/dev_work/say_it_in_json", | ||||
|       "-resource-dir", | ||||
|       "/usr/lib64/clang/16", | ||||
|       "-I", | ||||
|       "include", | ||||
|       "-I", | ||||
|       "include/dstring", | ||||
|       "-I", | ||||
|       "include/lexer", | ||||
|       "-internal-isystem", | ||||
|       "/usr/lib64/clang/16/include", | ||||
|       "-internal-isystem", | ||||
|       "/usr/local/include", | ||||
|       "-internal-isystem", | ||||
|       "/usr/bin/../lib/gcc/x86_64-redhat-linux/13/../../../../x86_64-redhat-linux/include", | ||||
|       "-internal-externc-isystem", | ||||
|       "/include", | ||||
|       "-internal-externc-isystem", | ||||
|       "/usr/include", | ||||
|       "-Wall", | ||||
|       "-Werror", | ||||
|       "-pedantic", | ||||
|       "-fdebug-compilation-dir=/home/abdelrahman/dev_work/say_it_in_json", | ||||
|       "-ferror-limit", | ||||
|       "19", | ||||
|       "-fgnuc-version=4.2.1", | ||||
|       "-fcolor-diagnostics", | ||||
|       "-faddrsig", | ||||
|       "-D__GCC_HAVE_DWARF2_CFI_ASM=1", | ||||
|       "-x", | ||||
|       "c", | ||||
|       "-o", | ||||
|       "/tmp/lexer-b37823.o", | ||||
|       "src/lexer/lexer.c" | ||||
|     ], | ||||
|     "directory": "/mnt/3A5CDF785CDF2CFF/Users/abdoo/dev/say_it_in_json", | ||||
|     "file": "/mnt/3A5CDF785CDF2CFF/Users/abdoo/dev/say_it_in_json/src/lexer/lexer.c", | ||||
|     "output": "/tmp/lexer-b37823.o" | ||||
|     "directory": "/Users/abdelrahman/dev/personal/say-it-in-json", | ||||
|     "file": "/Users/abdelrahman/dev/personal/say-it-in-json/src/lexer/lexer.c", | ||||
|     "output": "/Users/abdelrahman/dev/personal/say-it-in-json/main" | ||||
|   } | ||||
| ] | ||||
|   | ||||
							
								
								
									
										30
									
								
								include/json_entities/json_entities.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								include/json_entities/json_entities.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | ||||
| #ifndef JSON_ENTITIES_H | ||||
| #define JSON_ENTITIES_H | ||||
|  | ||||
| #include "aliases.h" | ||||
| #include "dstring.h" | ||||
| #include <stdbool.h> | ||||
|  | ||||
| typedef struct json_value jval_t; | ||||
|  | ||||
| typedef enum { | ||||
| 	JVAL_OBJECT, | ||||
| 	JVAL_ARRAY, | ||||
| 	JVAL_STRING, | ||||
| 	JVAL_INTEGER, | ||||
| 	JVAL_DOUBLE, | ||||
| 	JVAL_BOOLEAN, | ||||
| 	JVAL_NULL, | ||||
| } jval_type_t; | ||||
|  | ||||
| struct json_value { | ||||
| 	jval_type_t type; | ||||
| 	union { | ||||
| 		dstr_t *string; | ||||
| 		i64 num_int; | ||||
| 		f64 num_dbl; | ||||
| 		bool boolean; | ||||
| 	}; | ||||
| }; | ||||
|  | ||||
| #endif // !JSON_ENTITIES_H | ||||
| @@ -4,6 +4,8 @@ | ||||
| #include "aliases.h" | ||||
| #include <stdbool.h> | ||||
|  | ||||
| #if 0 | ||||
|  | ||||
| typedef struct json_obj_pair jobj_pair_t; | ||||
| typedef struct json_coll jcoll_t; | ||||
| typedef struct json_val jval_t; | ||||
| @@ -48,4 +50,6 @@ struct json_coll { | ||||
|   }; | ||||
| }; | ||||
|  | ||||
| #endif | ||||
|  | ||||
| #endif // !JSON_TEST_H | ||||
|   | ||||
							
								
								
									
										1
									
								
								src/json_entities/json_entities.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								src/json_entities/json_entities.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| #include "json_entities.h" | ||||
		Reference in New Issue
	
	Block a user