Fixes to get it back to where I was last at with the const specifier issue

This commit is contained in:
Edward R. Gonzalez 2023-09-25 16:42:29 -04:00
parent a8708abf8b
commit 754bcfb31e
13 changed files with 155 additions and 92 deletions

View File

@ -32,11 +32,11 @@
<AdditionalIncludePath>C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.36.32532\include</AdditionalIncludePath> <AdditionalIncludePath>C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.36.32532\include</AdditionalIncludePath>
<AdditionalIncludePath>C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.36.32532\ATLMFC\include</AdditionalIncludePath> <AdditionalIncludePath>C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.36.32532\ATLMFC\include</AdditionalIncludePath>
<AdditionalIncludePath>C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\VS\include</AdditionalIncludePath> <AdditionalIncludePath>C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\VS\include</AdditionalIncludePath>
<AdditionalIncludePath>C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt</AdditionalIncludePath> <AdditionalIncludePath>C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt</AdditionalIncludePath>
<AdditionalIncludePath>C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um</AdditionalIncludePath> <AdditionalIncludePath>C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um</AdditionalIncludePath>
<AdditionalIncludePath>C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared</AdditionalIncludePath> <AdditionalIncludePath>C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared</AdditionalIncludePath>
<AdditionalIncludePath>C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt</AdditionalIncludePath> <AdditionalIncludePath>C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt</AdditionalIncludePath>
<AdditionalIncludePath>C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt</AdditionalIncludePath> <AdditionalIncludePath>C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt</AdditionalIncludePath>
<AdditionalIncludePath>C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um</AdditionalIncludePath> <AdditionalIncludePath>C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um</AdditionalIncludePath>
</AdditionalIncludePaths> </AdditionalIncludePaths>
<Defines> <Defines>

View File

@ -170,15 +170,15 @@
<NMakeReBuildCommandLine> <NMakeReBuildCommandLine>
</NMakeReBuildCommandLine> </NMakeReBuildCommandLine>
<NMakeCleanCommandLine>pwsh.exe -ExecutionPolicy Unrestricted -File "$(ProjectDir)scripts\clean.ps1"</NMakeCleanCommandLine> <NMakeCleanCommandLine>pwsh.exe -ExecutionPolicy Unrestricted -File "$(ProjectDir)scripts\clean.ps1"</NMakeCleanCommandLine>
<NMakePreprocessorDefinitions>GEN_INTELLISENSE_DIRECTIVES;GEN_TIME;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions> <NMakePreprocessorDefinitions>GEN_INTELLISENSE_DIRECTIVES;GEN_TIME;GEN_BENCHMARK;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<IncludePath>$(ProjectDir)project;$(ProjectDir)test;$(IncludePath)</IncludePath> <IncludePath>$(ProjectDir)project;$(IncludePath)</IncludePath>
<SourcePath>$(ProjectDir)project;$(SourcePath)</SourcePath> <SourcePath>$(ProjectDir)project;$(SourcePath)</SourcePath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='test debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='test debug|x64'">
<NMakeBuildCommandLine>pwsh.exe -ExecutionPolicy Unrestricted -File "$(ProjectDir)scripts\build.ps1" msvc debug test</NMakeBuildCommandLine> <NMakeBuildCommandLine>pwsh.exe -ExecutionPolicy Unrestricted -File "$(ProjectDir)scripts\build.ps1" msvc debug test</NMakeBuildCommandLine>
<NMakeReBuildCommandLine /> <NMakeReBuildCommandLine />
<NMakeCleanCommandLine>pwsh.exe -ExecutionPolicy Unrestricted -File "$(ProjectDir)scripts\clean.ps1"</NMakeCleanCommandLine> <NMakeCleanCommandLine>pwsh.exe -ExecutionPolicy Unrestricted -File "$(ProjectDir)scripts\clean.ps1"</NMakeCleanCommandLine>
<NMakePreprocessorDefinitions>GEN_INTELLISENSE_DIRECTIVES;GEN_TIME;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions> <NMakePreprocessorDefinitions>GEN_INTELLISENSE_DIRECTIVES;GEN_TIME;GEN_BENCHMARK;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<IncludePath>$(ProjectDir)project;$(ProjectDir)test;$(IncludePath)</IncludePath> <IncludePath>$(ProjectDir)project;$(ProjectDir)test;$(IncludePath)</IncludePath>
<SourcePath>$(ProjectDir)project;$(SourcePath)</SourcePath> <SourcePath>$(ProjectDir)project;$(SourcePath)</SourcePath>
</PropertyGroup> </PropertyGroup>
@ -187,7 +187,7 @@
<NMakeReBuildCommandLine> <NMakeReBuildCommandLine>
</NMakeReBuildCommandLine> </NMakeReBuildCommandLine>
<NMakeCleanCommandLine>pwsh.exe -ExecutionPolicy Unrestricted -File "$(ProjectDir)scripts\clean.ps1"</NMakeCleanCommandLine> <NMakeCleanCommandLine>pwsh.exe -ExecutionPolicy Unrestricted -File "$(ProjectDir)scripts\clean.ps1"</NMakeCleanCommandLine>
<NMakePreprocessorDefinitions>GEN_INTELLISENSE_DIRECTIVES;GEN_TIME;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions> <NMakePreprocessorDefinitions>GEN_INTELLISENSE_DIRECTIVES;GEN_TIME;GEN_BENCHMARK;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<IncludePath>$(ProjectDir)project;$(ProjectDir)test;$(IncludePath)</IncludePath> <IncludePath>$(ProjectDir)project;$(ProjectDir)test;$(IncludePath)</IncludePath>
<SourcePath>$(ProjectDir)project;$(SourcePath)</SourcePath> <SourcePath>$(ProjectDir)project;$(SourcePath)</SourcePath>
</PropertyGroup> </PropertyGroup>
@ -196,7 +196,7 @@
<NMakeReBuildCommandLine> <NMakeReBuildCommandLine>
</NMakeReBuildCommandLine> </NMakeReBuildCommandLine>
<NMakeCleanCommandLine>pwsh.exe -ExecutionPolicy Unrestricted -File "$(ProjectDir)scripts\clean.ps1"</NMakeCleanCommandLine> <NMakeCleanCommandLine>pwsh.exe -ExecutionPolicy Unrestricted -File "$(ProjectDir)scripts\clean.ps1"</NMakeCleanCommandLine>
<NMakePreprocessorDefinitions>GEN_INTELLISENSE_DIRECTIVES;GEN_TIME;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions> <NMakePreprocessorDefinitions>GEN_INTELLISENSE_DIRECTIVES;GEN_TIME;GEN_BENCHMARK;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<IncludePath>$(ProjectDir)project;$(ProjectDir)test;$(IncludePath)</IncludePath> <IncludePath>$(ProjectDir)project;$(ProjectDir)test;$(IncludePath)</IncludePath>
<SourcePath>$(ProjectDir)project;$(SourcePath)</SourcePath> <SourcePath>$(ProjectDir)project;$(SourcePath)</SourcePath>
</PropertyGroup> </PropertyGroup>
@ -205,7 +205,7 @@
<NMakeReBuildCommandLine> <NMakeReBuildCommandLine>
</NMakeReBuildCommandLine> </NMakeReBuildCommandLine>
<NMakeCleanCommandLine>pwsh.exe -ExecutionPolicy Unrestricted -File "$(ProjectDir)scripts\clean.ps1"</NMakeCleanCommandLine> <NMakeCleanCommandLine>pwsh.exe -ExecutionPolicy Unrestricted -File "$(ProjectDir)scripts\clean.ps1"</NMakeCleanCommandLine>
<NMakePreprocessorDefinitions>GEN_INTELLISENSE_DIRECTIVES;GEN_TIME;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions> <NMakePreprocessorDefinitions>GEN_INTELLISENSE_DIRECTIVES;GEN_TIME;GEN_BENCHMARK;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<IncludePath>$(ProjectDir)project;$(ProjectDir)test;$(IncludePath)</IncludePath> <IncludePath>$(ProjectDir)project;$(ProjectDir)test;$(IncludePath)</IncludePath>
<SourcePath>$(ProjectDir)project;$(SourcePath)</SourcePath> <SourcePath>$(ProjectDir)project;$(SourcePath)</SourcePath>
</PropertyGroup> </PropertyGroup>
@ -236,7 +236,6 @@
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<None Include=".editorconfig" /> <None Include=".editorconfig" />
<None Include="project\components\temp\Readme.md" />
<None Include="project\enums\AttributeTokens.csv" /> <None Include="project\enums\AttributeTokens.csv" />
<None Include="project\enums\ECode.csv" /> <None Include="project\enums\ECode.csv" />
<None Include="project\enums\EOperator.csv" /> <None Include="project\enums\EOperator.csv" />
@ -271,10 +270,6 @@
<ClInclude Include="project\components\header_start.hpp" /> <ClInclude Include="project\components\header_start.hpp" />
<ClInclude Include="project\components\inlines.hpp" /> <ClInclude Include="project\components\inlines.hpp" />
<ClInclude Include="project\components\interface.hpp" /> <ClInclude Include="project\components\interface.hpp" />
<ClInclude Include="project\components\temp\ast_inlines.hpp" />
<ClInclude Include="project\components\temp\ecode.hpp" />
<ClInclude Include="project\components\temp\eoperator.hpp" />
<ClInclude Include="project\components\temp\especifier.hpp" />
<ClInclude Include="project\components\types.hpp" /> <ClInclude Include="project\components\types.hpp" />
<ClInclude Include="project\dependencies\basic_types.hpp" /> <ClInclude Include="project\dependencies\basic_types.hpp" />
<ClInclude Include="project\dependencies\containers.hpp" /> <ClInclude Include="project\dependencies\containers.hpp" />
@ -325,8 +320,6 @@
<ClCompile Include="project\components\interface.upfront.cpp" /> <ClCompile Include="project\components\interface.upfront.cpp" />
<ClCompile Include="project\components\src_start.cpp" /> <ClCompile Include="project\components\src_start.cpp" />
<ClCompile Include="project\components\static_data.cpp" /> <ClCompile Include="project\components\static_data.cpp" />
<ClCompile Include="project\components\temp\etoktype.cpp" />
<ClCompile Include="project\components\untyped.cpp" />
<ClCompile Include="project\dependencies\debug.cpp" /> <ClCompile Include="project\dependencies\debug.cpp" />
<ClCompile Include="project\dependencies\filesystem.cpp" /> <ClCompile Include="project\dependencies\filesystem.cpp" />
<ClCompile Include="project\dependencies\hashing.cpp" /> <ClCompile Include="project\dependencies\hashing.cpp" />

View File

@ -97,6 +97,15 @@ int gen_main()
src.write(); src.write();
} }
CodeBody gen_component_header = def_global_body( args(
def_preprocess_cond( PreprocessCond_IfDef, txt("GEN_INTELLISENSE_DIRECTIVES") ),
pragma_once,
def_include(txt("components/types.hpp")),
preprocess_endif,
fmt_newline,
untyped_str( to_str(generation_notice) )
));
// gen.hpp // gen.hpp
{ {
Code header_start = scan_file( "components/header_start.hpp" ); Code header_start = scan_file( "components/header_start.hpp" );
@ -145,15 +154,6 @@ int gen_main()
header.print( pop_ignores ); header.print( pop_ignores );
header.write(); header.write();
CodeBody gen_component_header = def_global_body( args(
def_preprocess_cond( PreprocessCond_IfDef, txt("GEN_INTELLISENSE_DIRECTIVES") ),
pragma_once,
def_include(txt("components/types.hpp")),
preprocess_endif,
fmt_newline,
untyped_str( to_str(generation_notice) )
));
Builder Builder
header_ecode = Builder::open( "components/gen/ecode.hpp" ); header_ecode = Builder::open( "components/gen/ecode.hpp" );
header_ecode.print( gen_component_header ); header_ecode.print( gen_component_header );
@ -223,8 +223,7 @@ int gen_main()
Builder Builder
src_etoktype = Builder::open( "components/gen/etoktype.cpp" ); src_etoktype = Builder::open( "components/gen/etoktype.cpp" );
src_etoktype.print_fmt( generation_notice ); src_etoktype.print( gen_component_header );
src_etoktype.print( pragma_once );
src_etoktype.print( nspaced_etoktype ); src_etoktype.print( nspaced_etoktype );
src_etoktype.write(); src_etoktype.write();
} }

View File

@ -30,9 +30,9 @@ char const* AST::debug_str()
case Access_Protected: case Access_Protected:
case Access_Public: case Access_Public:
if ( Prev ) if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next ) if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
break; break;
case Untyped: case Untyped:
@ -48,9 +48,9 @@ char const* AST::debug_str()
case Preprocess_IfDef: case Preprocess_IfDef:
case Preprocess_IfNotDef: case Preprocess_IfNotDef:
if ( Prev ) if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next ) if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tContent: %S", Content ); result.append_fmt( "\n\tContent: %S", Content );
break; break;
@ -58,9 +58,9 @@ char const* AST::debug_str()
case Class: case Class:
case Struct: case Struct:
if ( Prev ) if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next ) if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tInlineCmd : %S", InlineCmt ? InlineCmt->Content : "Null" ); result.append_fmt( "\n\tInlineCmd : %S", InlineCmt ? InlineCmt->Content : "Null" );
result.append_fmt( "\n\tAttributes : %S", Attributes ? Attributes->to_string() : "Null" ); result.append_fmt( "\n\tAttributes : %S", Attributes ? Attributes->to_string() : "Null" );
@ -72,9 +72,9 @@ char const* AST::debug_str()
case Class_Fwd: case Class_Fwd:
case Struct_Fwd: case Struct_Fwd:
if ( Prev ) if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next ) if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tInlineCmd : %S", InlineCmt ? InlineCmt->Content : "Null" ); result.append_fmt( "\n\tInlineCmd : %S", InlineCmt ? InlineCmt->Content : "Null" );
result.append_fmt( "\n\tAttributes : %S", Attributes ? Attributes->to_string() : "Null" ); result.append_fmt( "\n\tAttributes : %S", Attributes ? Attributes->to_string() : "Null" );
@ -84,9 +84,9 @@ char const* AST::debug_str()
case Constructor: case Constructor:
if ( Prev ) if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next ) if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" ); result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" );
result.append_fmt( "\n\tSpecs : %S", Specs ? Specs->to_string() : "Null" ); result.append_fmt( "\n\tSpecs : %S", Specs ? Specs->to_string() : "Null" );
@ -97,9 +97,9 @@ char const* AST::debug_str()
case Constructor_Fwd: case Constructor_Fwd:
if ( Prev ) if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next ) if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" ); result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" );
result.append_fmt( "\n\tSpecs : %S", Specs ? Specs->to_string() : "Null" ); result.append_fmt( "\n\tSpecs : %S", Specs ? Specs->to_string() : "Null" );
@ -109,9 +109,9 @@ char const* AST::debug_str()
case Destructor: case Destructor:
if ( Prev ) if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next ) if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" ); result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" );
result.append_fmt( "\n\tSpecs : %S", Specs ? Specs->to_string() : "Null" ); result.append_fmt( "\n\tSpecs : %S", Specs ? Specs->to_string() : "Null" );
@ -124,9 +124,9 @@ char const* AST::debug_str()
case Enum: case Enum:
case Enum_Class: case Enum_Class:
if ( Prev ) if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next ) if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" ); result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" );
result.append_fmt( "\n\tAttributes : %S", Attributes ? Attributes->to_string() : "Null" ); result.append_fmt( "\n\tAttributes : %S", Attributes ? Attributes->to_string() : "Null" );
@ -134,25 +134,33 @@ char const* AST::debug_str()
result.append_fmt( "\n\tBody : %S", Body ? Body->debug_str() : "Null" ); result.append_fmt( "\n\tBody : %S", Body ? Body->debug_str() : "Null" );
break; break;
case Enum_Fwd:
case Enum_Class_Fwd: case Enum_Class_Fwd:
if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" );
result.append_fmt( "\n\tAttributes : %S", Attributes ? Attributes->to_string() : "Null" );
result.append_fmt( "\n\tUnderlying Type : %S", UnderlyingType ? UnderlyingType->to_string() : "Null" );
break; break;
case Extern_Linkage: case Extern_Linkage:
case Namespace: case Namespace:
if ( Prev ) if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next ) if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tBody: %S", Body ? Body->debug_str() : "Null" ); result.append_fmt( "\n\tBody: %S", Body ? Body->debug_str() : "Null" );
break; break;
case Friend: case Friend:
if ( Prev ) if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next ) if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" ); result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" );
result.append_fmt( "\n\tDeclaration: %S", Declaration ? Declaration->to_string() : "Null" ); result.append_fmt( "\n\tDeclaration: %S", Declaration ? Declaration->to_string() : "Null" );
@ -160,9 +168,9 @@ char const* AST::debug_str()
case Function: case Function:
if ( Prev ) if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next ) if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" ); result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" );
result.append_fmt( "\n\tAttributes: %S", Attributes ? Attributes->to_string() : "Null" ); result.append_fmt( "\n\tAttributes: %S", Attributes ? Attributes->to_string() : "Null" );
@ -172,18 +180,32 @@ char const* AST::debug_str()
result.append_fmt( "\n\tBody : %S", Body ? Body->debug_str() : "Null" ); result.append_fmt( "\n\tBody : %S", Body ? Body->debug_str() : "Null" );
break; break;
case Function_Fwd:
if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" );
result.append_fmt( "\n\tAttributes: %S", Attributes ? Attributes->to_string() : "Null" );
result.append_fmt( "\n\tSpecs : %S", Specs ? Specs->to_string() : "Null" );
result.append_fmt( "\n\tReturnType: %S", ReturnType ? ReturnType->to_string() : "Null" );
result.append_fmt( "\n\tParams : %S", Params ? Params->to_string() : "Null" );
break;
case Module: case Module:
if ( Prev ) if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next ) if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
break; break;
case Operator: case Operator:
case Operator_Member:
if ( Prev ) if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next ) if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" ); result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" );
result.append_fmt( "\n\tAttributes: %S", Attributes ? Attributes->to_string() : "Null" ); result.append_fmt( "\n\tAttributes: %S", Attributes ? Attributes->to_string() : "Null" );
@ -194,11 +216,26 @@ char const* AST::debug_str()
result.append_fmt( "\n\tOp : %S", to_str( Op ) ); result.append_fmt( "\n\tOp : %S", to_str( Op ) );
break; break;
case Operator_Fwd:
case Operator_Member_Fwd:
if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" );
result.append_fmt( "\n\tAttributes: %S", Attributes ? Attributes->to_string() : "Null" );
result.append_fmt( "\n\tSpecs : %S", Specs ? Specs->to_string() : "Null" );
result.append_fmt( "\n\tReturnType: %S", ReturnType ? ReturnType->to_string() : "Null" );
result.append_fmt( "\n\tParams : %S", Params ? Params->to_string() : "Null" );
result.append_fmt( "\n\tOp : %S", to_str( Op ) );
break;
case Operator_Cast: case Operator_Cast:
if ( Prev ) if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next ) if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" ); result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" );
result.append_fmt( "\n\tSpecs : %S", Specs ? Specs->to_string() : "Null" ); result.append_fmt( "\n\tSpecs : %S", Specs ? Specs->to_string() : "Null" );
@ -206,6 +243,17 @@ char const* AST::debug_str()
result.append_fmt( "\n\tBody : %S", Body ? Body->debug_str() : "Null" ); result.append_fmt( "\n\tBody : %S", Body ? Body->debug_str() : "Null" );
break; break;
case Operator_Cast_Fwd:
if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" );
result.append_fmt( "\n\tSpecs : %S", Specs ? Specs->to_string() : "Null" );
result.append_fmt( "\n\tValueType : %S", ValueType ? ValueType->to_string() : "Null" );
break;
case Parameters: case Parameters:
result.append_fmt( "\n\tNumEntries: %d", NumEntries ); result.append_fmt( "\n\tNumEntries: %d", NumEntries );
result.append_fmt( "\n\tLast : %S", Last->Name ); result.append_fmt( "\n\tLast : %S", Last->Name );
@ -233,9 +281,9 @@ char const* AST::debug_str()
case Template: case Template:
if ( Prev ) if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next ) if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tParams : %S", Params ? Params->to_string() : "Null" ); result.append_fmt( "\n\tParams : %S", Params ? Params->to_string() : "Null" );
result.append_fmt( "\n\tDeclaration: %S", Declaration ? Declaration->to_string() : "Null" ); result.append_fmt( "\n\tDeclaration: %S", Declaration ? Declaration->to_string() : "Null" );
@ -243,9 +291,9 @@ char const* AST::debug_str()
case Typedef: case Typedef:
if ( Prev ) if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next ) if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" ); result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" );
result.append_fmt( "\n\tUnderlyingType: %S", UnderlyingType ? UnderlyingType->to_string() : "Null" ); result.append_fmt( "\n\tUnderlyingType: %S", UnderlyingType ? UnderlyingType->to_string() : "Null" );
@ -261,9 +309,9 @@ char const* AST::debug_str()
case Union: case Union:
if ( Prev ) if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next ) if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tAttributes: %S", Attributes ? Attributes->to_string() : "Null" ); result.append_fmt( "\n\tAttributes: %S", Attributes ? Attributes->to_string() : "Null" );
result.append_fmt( "\n\tBody : %S", Body ? Body->debug_str() : "Null" ); result.append_fmt( "\n\tBody : %S", Body ? Body->debug_str() : "Null" );
@ -271,9 +319,9 @@ char const* AST::debug_str()
case Using: case Using:
if ( Prev ) if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next ) if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" ); result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" );
result.append_fmt( "\n\tAttributes : %S", Attributes ? Attributes->to_string() : "Null" ); result.append_fmt( "\n\tAttributes : %S", Attributes ? Attributes->to_string() : "Null" );
@ -293,9 +341,9 @@ char const* AST::debug_str()
} }
if ( Prev ) if ( Prev )
result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tPrev: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
if ( Next ) if ( Next )
result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ); result.append_fmt( "\n\tNext: %S %S", Prev->type_str(), Prev->Name ? Prev->Name : "Null" );
result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" ); result.append_fmt( "\n\tInlineCmt : %S", InlineCmt ? InlineCmt->Content : "Null" );
result.append_fmt( "\n\tAttributes : %S", Attributes ? Attributes->to_string() : "Null" ); result.append_fmt( "\n\tAttributes : %S", Attributes ? Attributes->to_string() : "Null" );
@ -387,6 +435,10 @@ String AST::to_string()
interface = interface->Next ? interface->Next->cast< CodeType >() : Code { nullptr }; interface = interface->Next ? interface->Next->cast< CodeType >() : Code { nullptr };
} }
} }
else if ( Name )
{
result.append( Name );
}
if ( InlineCmt ) if ( InlineCmt )
{ {
@ -980,6 +1032,10 @@ String AST::to_string()
interface = interface->Next ? interface->Next->cast< CodeType >() : Code { nullptr }; interface = interface->Next ? interface->Next->cast< CodeType >() : Code { nullptr };
} }
} }
else if ( Name )
{
result.append( Name );
}
if ( InlineCmt ) if ( InlineCmt )
{ {

View File

@ -67,10 +67,10 @@ struct CodeUnion;
struct CodeUsing; struct CodeUsing;
struct CodeVar; struct CodeVar;
// namespace Parser namespace Parser
// { {
// struct Token; struct Token;
// } }
/* /*
AST* wrapper AST* wrapper
@ -162,7 +162,7 @@ struct Code_POD
static_assert( sizeof(Code) == sizeof(Code_POD), "ERROR: Code is not POD" ); static_assert( sizeof(Code) == sizeof(Code_POD), "ERROR: Code is not POD" );
// Desired width of the AST data structure. // Desired width of the AST data structure.
constexpr int AST_POD_Size = 128; constexpr int const AST_POD_Size = 128;
/* /*
Simple AST POD with functionality to seralize into C++ syntax. Simple AST POD with functionality to seralize into C++ syntax.
@ -220,19 +220,17 @@ struct AST
constexpr static constexpr static
int ArrSpecs_Cap = int ArrSpecs_Cap =
#if 1
( (
AST_POD_Size AST_POD_Size
- sizeof(void*) * 4 - sizeof(AST*) * 3
// - sizeof(Parser::Token*) - sizeof(Parser::Token*)
// - sizeof(AST*) - sizeof(AST*)
- sizeof(void*) - sizeof(StringCached)
- sizeof(int) - sizeof(CodeT)
- sizeof(ModuleFlag) - sizeof(ModuleFlag)
- sizeof(int) - sizeof(int)
) )
/ sizeof(SpecifierT); // -1 for 4 extra bytes / sizeof(int) - 1; // -1 for 4 extra bytes
#endif
union { union {
struct struct
@ -264,7 +262,7 @@ struct AST
}; };
StringCached Content; // Attributes, Comment, Execution, Include StringCached Content; // Attributes, Comment, Execution, Include
struct { struct {
SpecifierT ArrSpecs[AST::ArrSpecs_Cap]; // Specifiers SpecifierT ArrSpecs[ArrSpecs_Cap]; // Specifiers
AST* NextSpecs; // Specifiers; If ArrSpecs is full, then NextSpecs is used. AST* NextSpecs; // Specifiers; If ArrSpecs is full, then NextSpecs is used.
}; };
}; };
@ -277,7 +275,7 @@ struct AST
AST* Next; AST* Next;
AST* Back; AST* Back;
}; };
// Parser::Token* Token; // Reference to starting token, only avaialble if it was derived from parsing. Parser::Token* Token; // Reference to starting token, only avaialble if it was derived from parsing.
AST* Parent; AST* Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -336,7 +334,7 @@ struct AST_POD
AST* Next; AST* Next;
AST* Back; AST* Back;
}; };
// Parser::Token* Token; // Reference to starting token, only avaialble if it was derived from parsing. Parser::Token* Token; // Reference to starting token, only avaialble if it was derived from parsing.
AST* Parent; AST* Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -350,8 +348,12 @@ struct AST_POD
}; };
}; };
constexpr int specifierT_size = sizeof(SpecifierT); struct test {
constexpr int AST_SIZE = sizeof(AST); SpecifierT ArrSpecs[AST::ArrSpecs_Cap]; // Specifiers
AST* NextSpecs; // Specifiers; If ArrSpecs is full, then NextSpecs is used.
};
constexpr int pls = sizeof(test);
// Its intended for the AST to have equivalent size to its POD. // Its intended for the AST to have equivalent size to its POD.
// All extra functionality within the AST namespace should just be syntatic sugar. // All extra functionality within the AST namespace should just be syntatic sugar.

View File

@ -1,6 +1,6 @@
#ifdef GEN_INTELLISENSE_DIRECTIVES #ifdef GEN_INTELLISENSE_DIRECTIVES
#pragma once #pragma once
#include "types.hpp" #include "components/types.hpp"
#endif #endif
// This file was generated automatially by gencpp's bootstrap.cpp (See: https://github.com/Ed94/gencpp) // This file was generated automatially by gencpp's bootstrap.cpp (See: https://github.com/Ed94/gencpp)

View File

@ -1,6 +1,6 @@
#ifdef GEN_INTELLISENSE_DIRECTIVES #ifdef GEN_INTELLISENSE_DIRECTIVES
#pragma once #pragma once
#include "components/Types.hpp" #include "components/types.hpp"
#endif #endif
// This file was generated automatially by gencpp's bootstrap.cpp (See: https://github.com/Ed94/gencpp) // This file was generated automatially by gencpp's bootstrap.cpp (See: https://github.com/Ed94/gencpp)

View File

@ -1,6 +1,9 @@
// This file was generated automatially by gencpp's bootstrap.cpp (See: https://github.com/Ed94/gencpp) #ifdef GEN_INTELLISENSE_DIRECTIVES
#pragma once #pragma once
#include "components/types.hpp"
#endif
// This file was generated automatially by gencpp's bootstrap.cpp (See: https://github.com/Ed94/gencpp)
namespace Parser namespace Parser
{ {

View File

@ -3921,7 +3921,7 @@ CodeEnum parse_enum( bool inplace_def )
while ( left && currtok_noskip.Type != TokType::BraceCurly_Close ) while ( left && currtok_noskip.Type != TokType::BraceCurly_Close )
{ {
if ( currtok.Type == TokType::Preprocess_Hash ) if ( currtok_noskip.Type == TokType::Preprocess_Hash )
eat( TokType::Preprocess_Hash ); eat( TokType::Preprocess_Hash );
switch ( currtok_noskip.Type ) switch ( currtok_noskip.Type )

View File

@ -1,5 +1,8 @@
#ifdef GEN_INTELLISENSE_DIRECTIVES #ifdef GEN_INTELLISENSE_DIRECTIVES
# pragma once # pragma once
# include "debug.hpp"
# include "basic_types.hpp"
# include "src_start.cpp"
#endif #endif
#pragma region Debug #pragma region Debug

View File

@ -1,5 +1,7 @@
#ifdef GEN_INTELLISENSE_DIRECTIVES #ifdef GEN_INTELLISENSE_DIRECTIVES
# pragma once # pragma once
# include "filesystem.hpp"
# include "strings.hpp"
# include "string_ops.cpp" # include "string_ops.cpp"
#endif #endif

View File

@ -1,3 +1,7 @@
#ifdef GEN_INTELLISENSE_DIRECTIVES
# include "header_start.hpp"
#endif
#pragma region Macros and Includes #pragma region Macros and Includes
# include <stdio.h> # include <stdio.h>

View File

@ -1,5 +1,6 @@
#ifdef GEN_INTELLISENSE_DIRECTIVES #ifdef GEN_INTELLISENSE_DIRECTIVES
# pragma once # pragma once
# include "string_ops.hpp"
# include "debug.cpp" # include "debug.cpp"
#endif #endif