Commit Graph

32 Commits

Author SHA1 Message Date
Ed_
36260f6edb Updated gencpp with latest fixes used in other projects.
This variant can support parsing some Unreal Engine files!!
2024-04-17 17:40:32 -04:00
Ed_
a667eb4afe Progress on parser documentation 2023-11-21 23:36:56 -05:00
Ed_
be023325a9 Added AST & Code definitions segemnted code defs to separate file
For upcoming statements & expression types, just beginning to lay things out for the future.
2023-11-21 20:07:49 -05:00
Ed_
9d27c7d37e Lexer improvement prep, segmentation of lexer and parser. 2023-11-20 21:24:27 -05:00
Ed_
5c73fbee83 WIP : AST serialization improvements
Code untestd its an initial draft
2023-11-19 20:35:21 -05:00
Ed_
b42b224c0d Forgot to push some parser fixes 2023-10-25 03:33:35 -04:00
Ed_
041671762b Got through parsing raylib.h, started to do some major refactors. 2023-10-25 03:26:25 -04:00
Ed_
729c891cbd Last fixes before handmade hero hiatus 2023-09-25 17:48:16 -04:00
Ed_
754bcfb31e Fixes to get it back to where I was last at with the const specifier issue 2023-09-25 16:42:29 -04:00
Ed_
a8708abf8b WIP : Various changes to project before small hiatus. (Broken)
I need to manually review these as the changes have various errors that are difficult to diagnose why.

I took a break to do handmade hero and now a bit rusty.
2023-09-25 12:12:11 -04:00
Ed_
4b48b96a79 WIP : better AST::debug_str()
Now its more contexually rich to the ast type, however I need to hookup tokens from parsing to the AST. There needs to be a way for the debug string to lookup the token and provide the contexual line.
Can either pass it ( TokArray* toks ) from the parser on failure (or `CodeFile`)..
Technically there is more than enough room for another Token* ptr. I could add another and specifiers would still have at minimum 14 slots before needing to extended to next specs.
**************... yeah
2023-09-12 02:32:44 -04:00
Ed_
6ea40094ee More fixes from clang warnings. Parser::lex prep for changes
parse_static_assert now properly adds new-line to end of statement.

I'm going to end up making a static_assert ast... that or when the statement ast is made it will handle adding that newline.
2023-09-07 22:52:51 -04:00
Ed_
d606c790ca Added a new AST member NextVar to be used for comma separated variable support.
Interface adding has been adjusted to use ParentType->Next.

Using the AST_Class->Next was bad since that breaks the linked list a body AST would have used for traversal.
2023-09-06 03:06:30 -04:00
Ed_
3e249d9bc5 Reorganization of parser, refactor of parse_type( bool* ) and progression of parser docs
Wanted to make parser implementation easier to sift through, so I emphasized alphabetical order more.

Since I couldn't just strip whitespace from typenames I decided to make the parse_type more aware of the typename's components if it was a function signature.
This ofc lead to the dark & damp hell that is parsing typenames.

Also made initial implementation to support parsing decltype within a typename signature..

The test failure for the singleheader is still a thing, these changes have not addressed that.
2023-09-05 01:48:11 -04:00
Ed_
543427dfe5 Fixes to parsing for validation
Removed whitespace stripping from parse_type, prepped for doing some major changes for function signature typenames

Moved template argument parsing to its own helper function since its used in more the one spot.

Latest failure is due to stack overflow when validating parameters. (Shouldn't be hard to debug)
2023-09-03 23:36:51 -04:00
Ed_
0197afd543 Changed how editor intellisense directives are handled for compoenents and dependencies
Didn't like the way I was processing them in scan_file.
2023-08-28 23:46:50 -04:00
Ed_
7249a7317d Added space stripping during for content of various ASTs
* Typedef/Typename
* Function Names
* Pragmas
* Attributes
2023-08-26 11:55:05 -04:00
Ed_
f9117a2353 Added zpl's ivrtual memory to dependencies (unused for now) 2023-08-23 11:07:43 -04:00
Ed_
c97762ac16 Added support for inline comments
Also now doing comment serialization on def_comment directly as parse_comment doesn't need it.

Essentially comment ast types serialize the same way s untyped and execution ASTs
2023-08-23 00:25:14 -04:00
Ed_
a42e241afb Got rid of the temp compoonent files, they are now generated via bootstrapping.
This isn't the last step though everything in the main project directory that isn't md files needs to be generated only.
Can't do that till testing is robust enough...
2023-08-21 23:28:39 -04:00
Ed_
db6e8b33eb got intellisense working for the most part...
VScode works withs some issues.
VS2022 fails.
10xEditor works fine.
JetBrains Rider fails due to it not supporting <push/pop>_macro pragmas
2023-08-21 23:07:03 -04:00
Ed_
5c47777972 compiles agian... 2023-08-21 21:40:23 -04:00
Ed_
050b00f28a WIP - Broken Compile : Added pragma once and includes to all files + Parser fixes, and String improvements
Adding the pragma once and includes the files broke compilation, still diagnosing why.

- Some string functions were moved to the cpp, still need to do some more evaluation of it and the containers...
- Added support for forceinline and neverinline to parsing (untested)
- Added support for specifiers in operator cast such as explicit, inline/forceinline/neverinline, etc.
    - Before it only support const.
    - Still need to support volatile.
- Forceinline was not supported at all for tokenization, fixed that.
2023-08-21 20:30:13 -04:00
Ed_
37d9782cf2 Singleheader now compiles with new build script on both clang & msvc 2023-08-20 10:17:55 -04:00
Ed_
11679ba8b4 New build script works for clang and msvc!
Need to update singleheader and test to use it.
2023-08-19 21:33:01 -04:00
Ed_
32a910515e More refactoring, getting rid of meson in favor of just powershell scripts 2023-08-19 12:18:48 -04:00
Ed_
c7647ab00f Updated docs 2023-08-08 11:56:42 -04:00
Ed_
ed3246c6b0 Fixes for typedef serialization of functions..
Also fix for HashTable<>::rehash_fast not having finished implemenation...

The typedef fix is a sort of hack (like how parsing the rest of the language feels like tbh...).
I might make a def_typedef_fn to make it clearer how to define function typedefs using the upfront interface.
2023-08-07 20:16:04 -04:00
Ed_
c2f8c8aeb1 Added constructor and destructor supported (UNTESTED)
Just compiles and generates...

Also fixed a bug where parsing didn't have a token for virtual specifiers...
2023-08-07 03:10:45 -04:00
Ed_
a4f9596d3b Fixes to serialization, reduced Define_CodeType macro
Now the execution code is generated in bootstrap/singleheader gen.
2023-08-06 17:19:57 -04:00
Ed_
97750388ad No longer using components/temp/ast_inlines (switched to helper function to avoid macro usage)
Increased the arg count support of num_args to 100.
2023-08-06 14:58:43 -04:00
Ed_
5d7dfaf666 Heavy refactor..
Isolating large macros to their own directory (components/temp).
- Plan is to remove them soon with proper generation.

Added additional component files, separating the old data_structures header for a set of ast headers.
Header_end also had its inlines extracted out.
Necessary to complete the macro isolation.

ZPL parser dependencies were removed from the core library along with builder, its now generated in bootstrap as pare of making a gen_builder set of files.

Singleheader will be changed in next few commits to reflect this as well (By making builder deps and components a conditional option).

Tests are most likely all broken for now.
2023-08-03 11:01:43 -04:00