Commit Graph

260 Commits

Author SHA1 Message Date
Sven Vogel 1aa8206268 fixed: missing kind in statement 2024-05-28 12:36:33 +02:00
Sven Vogel 48110c85f2 added function definition block 2024-05-28 11:51:24 +02:00
Sven Vogel 0d1f312ae2 fixed: various implementation faults
fixed typo of parameter
added function struct to group their declaration and definitons
added block to function definiton
added operands to cast and operators
2024-05-28 00:12:32 +02:00
Sven Vogel 68622fbd00 added function parsing 2024-05-27 23:50:29 +02:00
Sven Vogel 6197acf3b2 fixed: llvm dependencies in sdk 2024-05-27 21:22:06 +02:00
Sven Vogel fb6f6e9777 finished global variable test 2024-05-27 18:17:15 +02:00
Sven Vogel 0fcb0d7af8 added test for llvm vars 2024-05-27 16:47:32 +02:00
Sven Vogel e01d4c4808 added debug and error messages 2024-05-27 15:56:44 +02:00
Sven Vogel 92f4708ce7 feature: codegen 2024-05-27 13:05:56 +02:00
Sven Vogel ad7355c94c removed llvm tests 2024-05-27 01:24:37 +02:00
Sven Vogel f16e2cfbaa fixed: mismatched pointer type 2024-05-26 22:52:48 +02:00
Sven Vogel b91c277ac4 added global variables 2024-05-26 22:51:49 +02:00
Sven Vogel 78e6310b05 moved module generation to backend parser 2024-05-26 17:30:53 +02:00
Sven Vogel d0cd74c697 modified codegen backend to use set module 2024-05-26 17:23:08 +02:00
servostar 932e1fa961
Merge pull request #105 from Servostar/89-implement-structs-for-parser
89 implement structs for parser
2024-05-26 15:14:00 +00:00
Sven Vogel 9a5f392b67 Merge branch '89-implement-structs-for-parser' of github.com:Servostar/gemstone into 89-implement-structs-for-parser 2024-05-26 17:12:23 +02:00
Sven Vogel dcd309c7b4 added module type 2024-05-26 17:11:43 +02:00
Sven Vogel 614c917b81 removed redundant files 2024-05-26 17:07:39 +02:00
servostar 220b5d7dcb
Merge pull request #104 from Servostar/89-implement-structs-for-parser
89 implement structs for parser
2024-05-26 15:03:46 +00:00
Felix Müller b7c7fd040a added ast pointer to all structs
removed StringLiteralType because of multiple definitions if used
2024-05-26 16:42:12 +02:00
Sven Vogel 8c17749923 refactored transmute rule and added bracketed expressions 2024-05-26 14:09:53 +02:00
Sven Vogel 7705aea238 added header for semantic tree types 2024-05-23 21:54:37 +02:00
Sven Vogel 8603656e3e added basic expression support 2024-05-22 20:27:40 +02:00
Sven Vogel 00089a4939 added error handling 2024-05-22 16:11:00 +02:00
Sven Vogel 3b78d117b5 added default values for composites 2024-05-21 15:55:22 +02:00
Sven Vogel 6967770d0e added declarations 2024-05-21 14:36:37 +02:00
Sven Vogel fa32df1010 backend parses type and function declarations 2024-05-21 13:08:41 +02:00
SirTalksalot75 58f7170df6
changed lookuptable for casts in ast.c 2024-05-21 12:20:45 +02:00
Sven Vogel 4a3b974d9f added functions to scope 2024-05-21 11:59:44 +02:00
Sven Vogel cc1dc790e1 added test for typedef 2024-05-21 00:41:03 +02:00
Sven Vogel 17e2cd7110 added scope 2024-05-21 00:17:11 +02:00
Sven Vogel 2804fd552b added function backend 2024-05-19 16:07:27 +02:00
Ur Mom 8d7c6a4a2b changed ast implementation for cast 2024-05-16 18:04:02 +02:00
Sven Vogel 1e60890919 added type interface 2024-05-16 12:29:11 +02:00
Ur Mom e57682d717 changed node-name according to ast.h 2024-05-16 11:34:51 +02:00
Ur Mom 2757132cf2 Fixed Typo 2024-05-16 10:27:44 +02:00
SirTalksalot75 af32c32c6a
Merge branch 'main' into 41-add-parser-rules-for-casts 2024-05-16 08:24:19 +02:00
Sven Vogel 16fcd6c8e2 added backend lib 2024-05-16 00:44:02 +02:00
Felix Müller addaff4818 i am not a smart man 2024-05-15 19:30:29 +02:00
Filleo 8b61cca153
Merge branch 'main' into 68-generate-ast-from-parser-rules 2024-05-15 19:19:03 +02:00
Felix Müller 7789c7e597 added removal of root node after output generation 2024-05-15 17:03:18 +02:00
Felix Müller d7b690ec8a solved error in test 2024-05-15 16:26:40 +02:00
Felix Müller f2317c78ce solved bug from fun def 2024-05-15 16:14:55 +02:00
Ur Mom 7da3c9151d fixed shift reduce conflicts in typecast 2024-05-15 15:50:26 +02:00
SirTalksalot75 addc6fe7f6
Merge branch 'main' into 6-add-mechanism-to-read-and-globally-save-options 2024-05-15 13:15:14 +02:00
Felix Müller ac7ceaab9b added while to the syntax tree 2024-05-15 10:41:08 +02:00
Felix Müller f11ade2ef2 changed If else branches, so that the whole branch is under one stmt node 2024-05-15 10:29:47 +02:00
Ur Mom 027b54d087 Second commit 2024-05-14 22:32:44 +02:00
Ur Mom 20ef894f88 Initial commit 2024-05-14 21:55:42 +02:00
Sven Vogel c24a430fd2 fixed if statement 2024-05-14 20:23:29 +02:00
Sven Vogel 32b964444a added C like precedence for operators 2024-05-14 19:20:58 +02:00
Sven Vogel 3ea179b4a9 added precedence for +,-,*,/ 2024-05-14 19:08:42 +02:00
Felix Müller 1055aa0f73 add identlist 2024-05-14 17:01:42 +02:00
Felix Müller a14faeeee7 added specific lists
solved bug in Funcall
2024-05-14 15:30:13 +02:00
Felix Müller 8c063d7016 changed little error in main 2024-05-14 14:57:15 +02:00
Felix Müller b3ad82cc49 moved root node to main
moved output code to main
removed '"' from string literals
2024-05-14 14:03:45 +02:00
Sven Vogel 4c61851a48 fixed build errors 2024-05-14 13:28:05 +02:00
Sven Vogel fa8c97d84f lexer unknown token passthrough 2024-05-14 12:27:21 +02:00
Felix Müller 3d3083c894 first functional state of syntax tree 2024-05-13 22:17:43 +02:00
Sven Vogel 02e7c2775b added better parser error messages 2024-05-13 16:13:49 +02:00
Ur Mom 9eba9d1437 fixed shift-reduce conflict 2024-05-13 13:45:22 +02:00
Felix Müller 0e5736e50c AST implementation WIP 2024-05-13 11:33:23 +02:00
Felix Müller bb474d75ad start of the syntax tree 2024-05-12 23:33:15 +02:00
Ur Mom 76558e89ed Merge branch '41-add-parser-rules-for-casts' of https://github.com/Servostar/gemstone into 41-add-parser-rules-for-casts 2024-05-12 22:55:03 +02:00
Ur Mom eccce505e5 -added Type-Cast
-added Reinterpret-Cast
2024-05-12 22:54:58 +02:00
Filleo 730248595e
Merge pull request #66 from Servostar/concept/ast-design
Concept/ast design
2024-05-12 21:28:53 +02:00
Sven Vogel 23968f7acc required C standard is C23
refactored logger function names to remove underscores
added function attributes
2024-05-10 15:09:52 +02:00
Sven Vogel 12a522b0e6 added missing free for child array 2024-05-10 13:51:23 +02:00
Sven Vogel 80888fdb8d added function for removing and detaching a node 2024-05-10 13:49:04 +02:00
Sven Vogel dd4d70829e added more documentation to AST header 2024-05-10 13:00:25 +02:00
Sven Vogel efeb482128 removed gc 2024-05-08 22:10:14 +02:00
Sven Vogel eac3b23432 Revert "added detach function"
This reverts commit 4322797eae.
2024-05-08 22:06:54 +02:00
Felix Müller abbbe59b08 added string.h in ast.c 2024-05-08 21:56:33 +02:00
servostar 2d411e3b7b
Merge branch 'concept/memory-safety' into concept/ast-design 2024-05-08 19:19:32 +00:00
Sven Vogel 4322797eae added detach function 2024-05-08 20:44:52 +02:00
Felix Müller f05ebf6ac2 added Self token
changed program rule
added rules for box
removed second assign
added storagequalifier
added typedefine
2024-05-08 15:51:30 +02:00
Sven Vogel 94efa65ed0 added test for graphviz 2024-05-08 13:49:06 +02:00
Filleo cd6ebc60ad
Merge pull request #58 from Servostar/39-add-parser-rule-for-functions
added function parser rules
2024-05-08 13:23:58 +02:00
Filleo 0c9c5f37b4
Merge pull request #55 from Servostar/37-add-parser-rule-for-while
added while parser rule
2024-05-08 13:20:16 +02:00
Felix Müller b8723bf83c removed empty lines 2024-05-08 13:18:34 +02:00
SirTalksalot75 743f8899f4
Merge branch 'parser-devel' into add-parser-rule-for-modules-import 2024-05-08 13:16:10 +02:00
Filleo e65761a64f
Merge branch 'parser-devel' into 39-add-parser-rule-for-functions 2024-05-08 09:32:25 +02:00
Filleo 03010bcf42
Merge branch 'parser-devel' into 37-add-parser-rule-for-while 2024-05-08 09:28:34 +02:00
Sven Vogel 565d50b639 added gc module 2024-05-07 15:24:42 +02:00
Sven Vogel 86c74f66c2 added mote syntax elements 2024-05-07 13:04:22 +02:00
Ur Mom 198c27f676 changed moduleimport in parser 2024-05-07 10:07:00 +02:00
Sven Vogel 0a54dd5783 Merge branch 'concept/ast-design' of github.com:Servostar/gemstone into concept/ast-design
merged local changes
2024-05-07 09:51:19 +02:00
servostar 0b832bf199
Merge branch 'concept/ast-design' into 47-add-tests 2024-05-07 07:48:12 +00:00
Felix Müller 08943e3e6e added function parser rules 2024-05-06 22:14:42 +02:00
Sven Vogel 02628a56d6 fixed shift reduce conflicts by removing epsilon functions 2024-05-06 16:41:23 +02:00
Felix Müller 5d155416b4 added while parser rule 2024-05-06 14:13:43 +02:00
Ur Mom 4ee6be3eb8 Changed Key for Function name 2024-05-06 12:09:58 +02:00
Ur Mom 6038241a1b initial commit for adding Module Import 2024-05-06 12:00:03 +02:00
servostar 96a50f4289
Merge branch 'parser-devel' into 40-add-parser-rule-for-calling-functions 2024-05-06 08:51:21 +00:00
servostar 07b3198c06
Merge pull request #51 from Servostar/36-add-parser-rule-for-if
36 add parser rule for if
2024-05-06 08:48:39 +00:00
servostar 4d7dcc4c73
Merge branch 'parser-devel' into 43-add-parser-rule-for-operators 2024-05-06 08:46:07 +00:00
Sven Vogel 03855c5ae6 added more AST elements 2024-05-06 10:32:05 +02:00
Sven Vogel 98c60aef16 added rule for branches 2024-05-05 21:51:51 +02:00
Sven Vogel 6f6b34792f function calls can now have more than 1 parameter list 2024-05-05 21:11:28 +02:00
Felix Müller a1c12f03db removed some empty lines 2024-05-05 21:05:37 +02:00
Sven Vogel c6d8651ab6 added debug statements 2024-05-05 16:31:55 +02:00
Sven Vogel 914935aafb added function to convert AST to graphviz diagram 2024-04-30 14:01:00 +02:00
Sven Vogel 970b45ac3c added less and greater operator 2024-04-30 11:51:59 +02:00
Sven Vogel 3e6469e239 added parser rule for function calling 2024-04-29 14:12:27 +02:00
Sven Vogel 7547331705 added rules for operators 2024-04-29 12:39:44 +02:00
Felix Müller 6de4196c0a created lexer rule for comments
deleted lexer rule for '#'
added parser rule for statement
sorted parser rules
2024-04-28 23:46:12 +02:00
Sven Vogel 897de1b8e1 fixed spelling mistake 2024-04-26 17:36:20 +02:00
Sven Vogel dd867db271 Added identifier lists 2024-04-26 17:30:22 +02:00
Sven Vogel 3c0a885186 added parser rules for declaration, assignment, definition 2024-04-26 16:53:41 +02:00
Ur Mom 72bba3278a updated main.c 2024-04-26 16:21:54 +02:00
SirTalksalot75 cebe5c5bf4
Merge pull request #32 from Servostar/main
Update for branch 4
2024-04-26 16:16:21 +02:00
Sven Vogel e918139f88 added recurse 2024-04-26 15:37:17 +02:00
SirTalksalot75 5f53d1dce4
Update main.c
changed indendation and declared and initialized yyin after file opening
2024-04-25 14:02:12 +02:00
Sven Vogel df927cf7d6 fixed flag error and made option nounistd in lexer depend on compiler used 2024-04-24 22:47:59 +02:00
Sven Vogel d673d1de0a removed dependency of unistd.h from lexer 2024-04-24 22:36:58 +02:00
Sven Vogel 501f6f1602 file name macro searches for last char instead of last string 2024-04-24 22:31:35 +02:00
Sven Vogel 4f5cf6408e added blueprint for AST library 2024-04-23 15:58:07 +02:00
SirTalksalot75 520520e576
Update main.c
moved atexit() to setup
2024-04-23 15:27:11 +02:00
SirTalksalot75 fafcb942e0
Update main.c
fixed typo, and changed close_file function
2024-04-23 14:38:30 +02:00
SirTalksalot75 dad9cbb93a
Update main.c
fixed typo
2024-04-23 14:32:00 +02:00
SirTalksalot75 7797595fef
Update main.c
added File Insertion through arguments
2024-04-23 14:25:49 +02:00
SirTalksalot75 67efb13fe4
Merge pull request #28 from Servostar/main
Branch update
2024-04-22 15:59:40 +02:00
SirTalksalot75 a85558e118
Update main.c
changed close_file Function
changed ERROR to PANIC
2024-04-22 14:01:18 +02:00
SirTalksalot75 05d603f7ac
Update main.c
added Function for file closing
2024-04-22 13:41:37 +02:00
SirTalksalot75 4976aeb22f
Update main.c
fixed typo
2024-04-22 12:57:49 +02:00
SirTalksalot75 6d249dd9ea
Update main.c
deleted fclose()
2024-04-22 12:54:20 +02:00
SirTalksalot75 6fca12df39
modified main.c
-added Error-message from Logging API.
-changed exit and moved after yyparse()
-added extern for file name
todo: make file name user input variable.
2024-04-22 12:53:48 +02:00
SirTalksalot75 1cfe9485e9
added case for missing input of file to main.c 2024-04-22 11:51:27 +02:00
Felix Müller cf810ca375 removed spaces 2024-04-22 11:45:50 +02:00
Felix Müller a0a91d6c78 added numbers to Ident token 2024-04-22 11:11:02 +02:00
Felix Müller 853bf09c96 changed Keyword for unsigned
added debug message for lexer
2024-04-22 10:43:33 +02:00
SirTalksalot75 e90cd80fbe
added prototype for File-reading to main.c 2024-04-21 22:48:29 +02:00
Sven Vogel f61317b123 removed unecessary header from log.h 2024-04-17 16:06:53 +02:00
Filleo 30ebbf51fa
Merge pull request #15 from Servostar/5-create-tokenizer
5 create tokenizer
2024-04-17 15:23:47 +02:00
Filleo 5a519ab8a7
Merge pull request #16 from Servostar/11-make-yyerror-use-error
added printing of the string of `yyerror` with `ERROR`
2024-04-17 15:23:30 +02:00
Felix Müller 1e33cc7965 added printing of the string of `yyerror` with `ERROR` 2024-04-17 15:03:21 +02:00
Felix Müller e8bfc348be removed sign in number tokenizer
pass floats and integer as strings
2024-04-17 09:12:29 +02:00
Felix Müller 7e06e5ade7 Merge branch '5-create-tokenizer' of https://github.com/Servostar/gemstone into 5-create-tokenizer 2024-04-16 19:58:02 +02:00
Felix Müller 74befb4edd added signs to integer
removed linebrakes
added floats as "real"
changed Keyword for single symbol Operators
2024-04-16 19:54:09 +02:00
Filleo c18131fa90
Merge branch 'main' into 5-create-tokenizer 2024-04-15 22:22:57 +02:00
Felix Müller 0740dcc237 deleted test code and files 2024-04-15 22:11:20 +02:00
Felix Müller 866d3d03c1 forgor one file 2024-04-15 22:04:21 +02:00
Felix Müller d9f959f400 completed all keywords and symbols in base language.
created keywords for strings and multiline strings.
2024-04-15 22:02:53 +02:00
Felix Müller 59da185baf all Keywords from primitives til modules 2024-04-15 21:12:17 +02:00
Felix Müller 46de25f8ce first batch of keywords and symbols 2024-04-15 20:36:13 +02:00
Sven Vogel 9340812a49 fixed windows path separator 2024-04-15 10:26:15 +02:00
Sven Vogel 2b46c9e3ab added custom define for macro `__FILE_NAME__` for non supporting compilers 2024-04-14 17:09:28 +02:00
servostar 8bd4898440
Merge pull request #12 from Servostar/8-add-github-action-for-code-check
8 add GitHub action for code check (#12)
reviewed by @flixm16 @SirTalksalot75
2024-04-14 13:54:33 +00:00
Sven Vogel 376837d37c fixed comment typ in lexer 2024-04-12 22:55:03 +02:00
Sven Vogel b0ecb5d459 disable generation of unput() and input() in lexer to avoid code check fail 2024-04-12 22:52:32 +02:00