mirror of
https://github.com/Ed94/gencpp.git
synced 2024-11-10 02:54:53 -08:00
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
This commit is contained in:
parent
7be3617083
commit
db6e8b33eb
2
.vscode/c_cpp_properties.json
vendored
2
.vscode/c_cpp_properties.json
vendored
@ -10,6 +10,7 @@
|
|||||||
"UNICODE",
|
"UNICODE",
|
||||||
"_UNICODE",
|
"_UNICODE",
|
||||||
"GEN_TIME"
|
"GEN_TIME"
|
||||||
|
// "GEN_DONT_USE_NAMESPACE"
|
||||||
],
|
],
|
||||||
"windowsSdkVersion": "10.0.19041.0",
|
"windowsSdkVersion": "10.0.19041.0",
|
||||||
"compilerPath": "C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe",
|
"compilerPath": "C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe",
|
||||||
@ -26,6 +27,7 @@
|
|||||||
"UNICODE",
|
"UNICODE",
|
||||||
"_UNICODE",
|
"_UNICODE",
|
||||||
"GEN_TIME"
|
"GEN_TIME"
|
||||||
|
// "GEN_DONT_USE_NAMESPACE"
|
||||||
],
|
],
|
||||||
"windowsSdkVersion": "10.0.19041.0",
|
"windowsSdkVersion": "10.0.19041.0",
|
||||||
"compilerPath": "C:/Users/Ed/scoop/apps/llvm/current/bin/clang++.exe",
|
"compilerPath": "C:/Users/Ed/scoop/apps/llvm/current/bin/clang++.exe",
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
// This is a simple file reader that reads the entire file into memory.
|
// This is a simple file reader that reads the entire file into memory.
|
||||||
// It has an extra option to skip the first few lines for undesired includes.
|
// It has an extra option to skip the first few lines for undesired includes.
|
||||||
// This is done so that includes can be kept in dependency and component files so that intellisense works.
|
// This is done so that includes can be kept in dependency and component files so that intellisense works.
|
||||||
Code scan_file( char const* path, bool skip_header_includes = true )
|
Code scan_file( char const* path, bool skip_initial_directives = true )
|
||||||
{
|
{
|
||||||
FileInfo file;
|
FileInfo file;
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ Code scan_file( char const* path, bool skip_header_includes = true )
|
|||||||
file_read( & file, str, fsize );
|
file_read( & file, str, fsize );
|
||||||
str.get_header().Length = fsize;
|
str.get_header().Length = fsize;
|
||||||
|
|
||||||
if ( skip_header_includes )
|
if ( skip_initial_directives )
|
||||||
{
|
{
|
||||||
#define current (*scanner)
|
#define current (*scanner)
|
||||||
StrC toks[] {
|
StrC toks[] {
|
||||||
|
@ -20,18 +20,18 @@ constexpr char const* generation_notice =
|
|||||||
"// This file was generated automatially by gen.bootstrap.cpp "
|
"// This file was generated automatially by gen.bootstrap.cpp "
|
||||||
"(See: https://github.com/Ed94/gencpp)\n\n";
|
"(See: https://github.com/Ed94/gencpp)\n\n";
|
||||||
|
|
||||||
constexpr bool DontSkipIncludes = false;
|
constexpr bool DontSkipInitialDirectives = false;
|
||||||
|
|
||||||
int gen_main()
|
int gen_main()
|
||||||
{
|
{
|
||||||
gen::init();
|
gen::init();
|
||||||
|
|
||||||
Code push_ignores = scan_file( "helpers/push_ignores.inline.hpp", DontSkipIncludes );
|
Code push_ignores = scan_file( "helpers/push_ignores.inline.hpp", DontSkipInitialDirectives );
|
||||||
Code pop_ignores = scan_file( "helpers/pop_ignores.inline.hpp", DontSkipIncludes );
|
Code pop_ignores = scan_file( "helpers/pop_ignores.inline.hpp", DontSkipInitialDirectives );
|
||||||
|
|
||||||
// gen_dep.hpp
|
// gen_dep.hpp
|
||||||
{
|
{
|
||||||
Code header_start = scan_file( "dependencies/header_start.hpp", DontSkipIncludes );
|
Code header_start = scan_file( "dependencies/header_start.hpp", DontSkipInitialDirectives );
|
||||||
Code macros = scan_file( "dependencies/macros.hpp" );
|
Code macros = scan_file( "dependencies/macros.hpp" );
|
||||||
Code basic_types = scan_file( "dependencies/basic_types.hpp" );
|
Code basic_types = scan_file( "dependencies/basic_types.hpp" );
|
||||||
Code debug = scan_file( "dependencies/debug.hpp" );
|
Code debug = scan_file( "dependencies/debug.hpp" );
|
||||||
@ -192,7 +192,7 @@ int gen_main()
|
|||||||
|
|
||||||
// gen_builder.hpp
|
// gen_builder.hpp
|
||||||
{
|
{
|
||||||
Code builder = scan_file( "auxillary/builder.hpp" );
|
Code builder = scan_file( "auxillary/builder.hpp", DontSkipInitialDirectives );
|
||||||
|
|
||||||
Builder
|
Builder
|
||||||
header = Builder::open( "gen/gen.builder.hpp" );
|
header = Builder::open( "gen/gen.builder.hpp" );
|
||||||
@ -207,7 +207,7 @@ int gen_main()
|
|||||||
|
|
||||||
// gen_builder.cpp
|
// gen_builder.cpp
|
||||||
{
|
{
|
||||||
Code builder = scan_file( "auxillary/builder.cpp" );
|
Code builder = scan_file( "auxillary/builder.cpp", DontSkipInitialDirectives );
|
||||||
|
|
||||||
Builder
|
Builder
|
||||||
src = Builder::open( "gen/gen.builder.cpp" );
|
src = Builder::open( "gen/gen.builder.cpp" );
|
||||||
@ -222,7 +222,7 @@ int gen_main()
|
|||||||
// gen_scanner.hpp
|
// gen_scanner.hpp
|
||||||
{
|
{
|
||||||
Code parsing = scan_file( "dependencies/parsing.hpp" );
|
Code parsing = scan_file( "dependencies/parsing.hpp" );
|
||||||
Code scanner = scan_file( "auxillary/scanner.hpp" );
|
Code scanner = scan_file( "auxillary/scanner.hpp", DontSkipInitialDirectives );
|
||||||
|
|
||||||
Builder
|
Builder
|
||||||
header = Builder::open( "gen/gen.scanner.hpp" );
|
header = Builder::open( "gen/gen.scanner.hpp" );
|
||||||
@ -239,7 +239,7 @@ int gen_main()
|
|||||||
// gen_scanner.cpp
|
// gen_scanner.cpp
|
||||||
{
|
{
|
||||||
Code parsing = scan_file( "dependencies/parsing.cpp" );
|
Code parsing = scan_file( "dependencies/parsing.cpp" );
|
||||||
Code scanner = scan_file( "auxillary/scanner.cpp" );
|
Code scanner = scan_file( "auxillary/scanner.cpp", DontSkipInitialDirectives );
|
||||||
|
|
||||||
Builder
|
Builder
|
||||||
src = Builder::open( "gen/gen.scanner.cpp" );
|
src = Builder::open( "gen/gen.scanner.cpp" );
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "static_data.cpp"
|
#include "static_data.cpp"
|
||||||
|
|
||||||
Code Code::Global;
|
Code Code::Global;
|
||||||
Code Code::Invalid;
|
Code Code::Invalid;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "types.hpp"
|
#include "types.hpp"
|
||||||
// #include "temp/ecode.hpp"
|
#include "temp/ecode.hpp"
|
||||||
// #include "temp/eoperator.hpp"
|
#include "temp/eoperator.hpp"
|
||||||
// #include "temp/especifier.hpp"
|
#include "temp/especifier.hpp"
|
||||||
|
|
||||||
struct AST;
|
struct AST;
|
||||||
struct AST_Body;
|
struct AST_Body;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "ast.hpp"
|
#include "ast.hpp"
|
||||||
|
|
||||||
#pragma region AST Types
|
#pragma region AST Types
|
||||||
/*
|
/*
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "inlines.hpp"
|
#include "inlines.hpp"
|
||||||
// #include "temp/ast_inlines.hpp"
|
#include "temp/ast_inlines.hpp"
|
||||||
|
|
||||||
#pragma region Constants
|
#pragma region Constants
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "interface.hpp"
|
#include "interface.hpp"
|
||||||
|
|
||||||
void AST::append( AST* other )
|
void AST::append( AST* other )
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "ast.cpp"
|
#include "ast.cpp"
|
||||||
|
|
||||||
internal void init_parser();
|
internal void init_parser();
|
||||||
internal void deinit_parser();
|
internal void deinit_parser();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "ast_types.hpp"
|
#include "ast_types.hpp"
|
||||||
|
|
||||||
#pragma region Gen Interface
|
#pragma region Gen Interface
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "temp/etoktype.cpp"
|
#include "temp/etoktype.cpp"
|
||||||
// #include "interface.upfront.cpp"
|
#include "interface.upfront.cpp"
|
||||||
|
|
||||||
namespace Parser
|
namespace Parser
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "interface.parsing.cpp"
|
#include "interface.parsing.cpp"
|
||||||
|
|
||||||
sw token_fmt_va( char* buf, uw buf_size, s32 num_tokens, va_list va )
|
sw token_fmt_va( char* buf, uw buf_size, s32 num_tokens, va_list va )
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "interface.cpp"
|
#include "interface.cpp"
|
||||||
|
|
||||||
#pragma region Upfront
|
#pragma region Upfront
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "src_start.cpp"
|
#include "gen.hpp"
|
||||||
|
|
||||||
#pragma region StaticData
|
#pragma region StaticData
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "header_start.hpp"
|
#include "header_start.hpp"
|
||||||
|
|
||||||
using LogFailType = sw(*)(char const*, ...);
|
using LogFailType = sw(*)(char const*, ...);
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "macros.hpp"
|
#include "macros.hpp"
|
||||||
|
|
||||||
#pragma region Basic Types
|
#pragma region Basic Types
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "printing.hpp"
|
#include "printing.hpp"
|
||||||
|
|
||||||
#pragma region Containers
|
#pragma region Containers
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "src_start.cpp"
|
|
||||||
|
|
||||||
#pragma region Debug
|
#pragma region Debug
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "basic_types.hpp"
|
#include "basic_types.hpp"
|
||||||
|
|
||||||
#pragma region Debug
|
#pragma region Debug
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "strings.cpp"
|
#include "strings.cpp"
|
||||||
|
|
||||||
#pragma region File Handling
|
#pragma region File Handling
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "strings.hpp"
|
#include "strings.hpp"
|
||||||
|
|
||||||
#pragma region File Handling
|
#pragma region File Handling
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "memory.cpp"
|
#include "memory.cpp"
|
||||||
|
|
||||||
#pragma region Hashing
|
#pragma region Hashing
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "containers.hpp"
|
#include "containers.hpp"
|
||||||
|
|
||||||
#pragma region Hashing
|
#pragma region Hashing
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "header_start.hpp"
|
#include "header_start.hpp"
|
||||||
|
|
||||||
#pragma region Macros
|
#pragma region Macros
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "printing.cpp"
|
#include "printing.cpp"
|
||||||
|
|
||||||
#pragma region Memory
|
#pragma region Memory
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "debug.hpp"
|
#include "debug.hpp"
|
||||||
|
|
||||||
#pragma region Memory
|
#pragma region Memory
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "string_ops.cpp"
|
#include "string_ops.cpp"
|
||||||
|
|
||||||
#pragma region Printing
|
#pragma region Printing
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "string_ops.hpp"
|
#include "string_ops.hpp"
|
||||||
|
|
||||||
#pragma region Printing
|
#pragma region Printing
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "debug.cpp"
|
#include "debug.cpp"
|
||||||
|
|
||||||
#pragma region String Ops
|
#pragma region String Ops
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "memory.hpp"
|
#include "memory.hpp"
|
||||||
|
|
||||||
#pragma region String Ops
|
#pragma region String Ops
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "hashing.cpp"
|
#include "hashing.cpp"
|
||||||
|
|
||||||
#pragma region String
|
#pragma region String
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "hashing.hpp"
|
#include "hashing.hpp"
|
||||||
|
|
||||||
#pragma region Strings
|
#pragma region Strings
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "filesystem.cpp"
|
#include "filesystem.cpp"
|
||||||
|
|
||||||
#pragma region Timing
|
#pragma region Timing
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
// #include "filesystem.hpp"
|
#include "filesystem.hpp"
|
||||||
|
|
||||||
#pragma region Timing
|
#pragma region Timing
|
||||||
|
|
||||||
|
@ -48,6 +48,8 @@ global bool generate_builder = true;
|
|||||||
global bool generate_editor = true;
|
global bool generate_editor = true;
|
||||||
global bool generate_scanner = true;
|
global bool generate_scanner = true;
|
||||||
|
|
||||||
|
constexpr bool DontSkipInitialDirectives = false;
|
||||||
|
|
||||||
int gen_main()
|
int gen_main()
|
||||||
{
|
{
|
||||||
#define project_dir "../project/"
|
#define project_dir "../project/"
|
||||||
@ -55,7 +57,7 @@ int gen_main()
|
|||||||
|
|
||||||
Code push_ignores = scan_file( project_dir "helpers/push_ignores.inline.hpp" );
|
Code push_ignores = scan_file( project_dir "helpers/push_ignores.inline.hpp" );
|
||||||
Code pop_ignores = scan_file( project_dir "helpers/pop_ignores.inline.hpp" );
|
Code pop_ignores = scan_file( project_dir "helpers/pop_ignores.inline.hpp" );
|
||||||
Code single_header_start = scan_file( "components/header_start.hpp" );
|
Code single_header_start = scan_file( "components/header_start.hpp", DontSkipInitialDirectives );
|
||||||
|
|
||||||
Builder
|
Builder
|
||||||
header = Builder::open( "gen/gen.hpp" );
|
header = Builder::open( "gen/gen.hpp" );
|
||||||
@ -69,7 +71,7 @@ int gen_main()
|
|||||||
|
|
||||||
if ( generate_gen_dep )
|
if ( generate_gen_dep )
|
||||||
{
|
{
|
||||||
Code header_start = scan_file( project_dir "dependencies/header_start.hpp" );
|
Code header_start = scan_file( project_dir "dependencies/header_start.hpp", DontSkipInitialDirectives );
|
||||||
Code macros = scan_file( project_dir "dependencies/macros.hpp" );
|
Code macros = scan_file( project_dir "dependencies/macros.hpp" );
|
||||||
Code basic_types = scan_file( project_dir "dependencies/basic_types.hpp" );
|
Code basic_types = scan_file( project_dir "dependencies/basic_types.hpp" );
|
||||||
Code debug = scan_file( project_dir "dependencies/debug.hpp" );
|
Code debug = scan_file( project_dir "dependencies/debug.hpp" );
|
||||||
@ -148,14 +150,14 @@ int gen_main()
|
|||||||
if ( generate_builder )
|
if ( generate_builder )
|
||||||
{
|
{
|
||||||
header.print_fmt( "#pragma region Builder\n\n" );
|
header.print_fmt( "#pragma region Builder\n\n" );
|
||||||
header.print( scan_file( project_dir "auxillary/builder.hpp" ) );
|
header.print( scan_file( project_dir "auxillary/builder.hpp",DontSkipInitialDirectives ) );
|
||||||
header.print_fmt( "#pragma endregion Builder\n\n" );
|
header.print_fmt( "#pragma endregion Builder\n\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( generate_scanner )
|
if ( generate_scanner )
|
||||||
{
|
{
|
||||||
header.print_fmt( "#pragma region Scanner\n\n" );
|
header.print_fmt( "#pragma region Scanner\n\n" );
|
||||||
header.print( scan_file( project_dir "auxillary/scanner.hpp" ) );
|
header.print( scan_file( project_dir "auxillary/scanner.hpp", DontSkipInitialDirectives ) );
|
||||||
header.print_fmt( "#pragma endregion Scanner\n\n" );
|
header.print_fmt( "#pragma endregion Scanner\n\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,7 +236,7 @@ int gen_main()
|
|||||||
if ( generate_builder )
|
if ( generate_builder )
|
||||||
{
|
{
|
||||||
header.print_fmt( "#pragma region Builder\n\n" );
|
header.print_fmt( "#pragma region Builder\n\n" );
|
||||||
header.print( scan_file( project_dir "auxillary/builder.cpp" ) );
|
header.print( scan_file( project_dir "auxillary/builder.cpp", DontSkipInitialDirectives ) );
|
||||||
header.print_fmt( "#pragma endregion Builder\n\n" );
|
header.print_fmt( "#pragma endregion Builder\n\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,7 +244,7 @@ int gen_main()
|
|||||||
if ( generate_scanner )
|
if ( generate_scanner )
|
||||||
{
|
{
|
||||||
header.print_fmt( "#pragma region Scanner\n\n" );
|
header.print_fmt( "#pragma region Scanner\n\n" );
|
||||||
header.print( scan_file( project_dir "auxillary/scanner.cpp" ) );
|
header.print( scan_file( project_dir "auxillary/scanner.cpp", DontSkipInitialDirectives ) );
|
||||||
header.print_fmt( "#pragma endregion Scanner\n\n" );
|
header.print_fmt( "#pragma endregion Scanner\n\n" );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user