mirror of
https://github.com/Ed94/gencpp.git
synced 2024-12-21 23:34:44 -08:00
Fixes to get it back to where I was last at with the const specifier issue
This commit is contained in:
parent
a8708abf8b
commit
754bcfb31e
10
gencpp.10x
10
gencpp.10x
@ -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\ATLMFC\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.19041.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.19041.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\ucrt</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.22621.0\\shared</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.22621.0\\cppwinrt</AdditionalIncludePath>
|
||||
<AdditionalIncludePath>C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um</AdditionalIncludePath>
|
||||
</AdditionalIncludePaths>
|
||||
<Defines>
|
||||
|
@ -170,15 +170,15 @@
|
||||
<NMakeReBuildCommandLine>
|
||||
</NMakeReBuildCommandLine>
|
||||
<NMakeCleanCommandLine>pwsh.exe -ExecutionPolicy Unrestricted -File "$(ProjectDir)scripts\clean.ps1"</NMakeCleanCommandLine>
|
||||
<NMakePreprocessorDefinitions>GEN_INTELLISENSE_DIRECTIVES;GEN_TIME;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
|
||||
<IncludePath>$(ProjectDir)project;$(ProjectDir)test;$(IncludePath)</IncludePath>
|
||||
<NMakePreprocessorDefinitions>GEN_INTELLISENSE_DIRECTIVES;GEN_TIME;GEN_BENCHMARK;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
|
||||
<IncludePath>$(ProjectDir)project;$(IncludePath)</IncludePath>
|
||||
<SourcePath>$(ProjectDir)project;$(SourcePath)</SourcePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='test debug|x64'">
|
||||
<NMakeBuildCommandLine>pwsh.exe -ExecutionPolicy Unrestricted -File "$(ProjectDir)scripts\build.ps1" msvc debug test</NMakeBuildCommandLine>
|
||||
<NMakeReBuildCommandLine />
|
||||
<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>
|
||||
<SourcePath>$(ProjectDir)project;$(SourcePath)</SourcePath>
|
||||
</PropertyGroup>
|
||||
@ -187,7 +187,7 @@
|
||||
<NMakeReBuildCommandLine>
|
||||
</NMakeReBuildCommandLine>
|
||||
<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>
|
||||
<SourcePath>$(ProjectDir)project;$(SourcePath)</SourcePath>
|
||||
</PropertyGroup>
|
||||
@ -196,7 +196,7 @@
|
||||
<NMakeReBuildCommandLine>
|
||||
</NMakeReBuildCommandLine>
|
||||
<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>
|
||||
<SourcePath>$(ProjectDir)project;$(SourcePath)</SourcePath>
|
||||
</PropertyGroup>
|
||||
@ -205,7 +205,7 @@
|
||||
<NMakeReBuildCommandLine>
|
||||
</NMakeReBuildCommandLine>
|
||||
<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>
|
||||
<SourcePath>$(ProjectDir)project;$(SourcePath)</SourcePath>
|
||||
</PropertyGroup>
|
||||
@ -236,7 +236,6 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include=".editorconfig" />
|
||||
<None Include="project\components\temp\Readme.md" />
|
||||
<None Include="project\enums\AttributeTokens.csv" />
|
||||
<None Include="project\enums\ECode.csv" />
|
||||
<None Include="project\enums\EOperator.csv" />
|
||||
@ -271,10 +270,6 @@
|
||||
<ClInclude Include="project\components\header_start.hpp" />
|
||||
<ClInclude Include="project\components\inlines.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\dependencies\basic_types.hpp" />
|
||||
<ClInclude Include="project\dependencies\containers.hpp" />
|
||||
@ -325,8 +320,6 @@
|
||||
<ClCompile Include="project\components\interface.upfront.cpp" />
|
||||
<ClCompile Include="project\components\src_start.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\filesystem.cpp" />
|
||||
<ClCompile Include="project\dependencies\hashing.cpp" />
|
||||
|
@ -97,6 +97,15 @@ int gen_main()
|
||||
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
|
||||
{
|
||||
Code header_start = scan_file( "components/header_start.hpp" );
|
||||
@ -145,15 +154,6 @@ int gen_main()
|
||||
header.print( pop_ignores );
|
||||
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
|
||||
header_ecode = Builder::open( "components/gen/ecode.hpp" );
|
||||
header_ecode.print( gen_component_header );
|
||||
@ -223,8 +223,7 @@ int gen_main()
|
||||
|
||||
Builder
|
||||
src_etoktype = Builder::open( "components/gen/etoktype.cpp" );
|
||||
src_etoktype.print_fmt( generation_notice );
|
||||
src_etoktype.print( pragma_once );
|
||||
src_etoktype.print( gen_component_header );
|
||||
src_etoktype.print( nspaced_etoktype );
|
||||
src_etoktype.write();
|
||||
}
|
||||
|
@ -30,9 +30,9 @@ char const* AST::debug_str()
|
||||
case Access_Protected:
|
||||
case Access_Public:
|
||||
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 )
|
||||
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;
|
||||
|
||||
case Untyped:
|
||||
@ -48,9 +48,9 @@ char const* AST::debug_str()
|
||||
case Preprocess_IfDef:
|
||||
case Preprocess_IfNotDef:
|
||||
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 )
|
||||
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 );
|
||||
break;
|
||||
@ -58,9 +58,9 @@ char const* AST::debug_str()
|
||||
case Class:
|
||||
case Struct:
|
||||
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 )
|
||||
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\tAttributes : %S", Attributes ? Attributes->to_string() : "Null" );
|
||||
@ -72,9 +72,9 @@ char const* AST::debug_str()
|
||||
case Class_Fwd:
|
||||
case Struct_Fwd:
|
||||
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 )
|
||||
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\tAttributes : %S", Attributes ? Attributes->to_string() : "Null" );
|
||||
@ -84,9 +84,9 @@ char const* AST::debug_str()
|
||||
|
||||
case Constructor:
|
||||
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 )
|
||||
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\tSpecs : %S", Specs ? Specs->to_string() : "Null" );
|
||||
@ -97,9 +97,9 @@ char const* AST::debug_str()
|
||||
|
||||
case Constructor_Fwd:
|
||||
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 )
|
||||
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\tSpecs : %S", Specs ? Specs->to_string() : "Null" );
|
||||
@ -109,9 +109,9 @@ char const* AST::debug_str()
|
||||
|
||||
case Destructor:
|
||||
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 )
|
||||
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\tSpecs : %S", Specs ? Specs->to_string() : "Null" );
|
||||
@ -124,9 +124,9 @@ char const* AST::debug_str()
|
||||
case Enum:
|
||||
case Enum_Class:
|
||||
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 )
|
||||
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\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" );
|
||||
break;
|
||||
|
||||
case Enum_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;
|
||||
|
||||
case Extern_Linkage:
|
||||
case Namespace:
|
||||
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 )
|
||||
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" );
|
||||
break;
|
||||
|
||||
case Friend:
|
||||
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 )
|
||||
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\tDeclaration: %S", Declaration ? Declaration->to_string() : "Null" );
|
||||
@ -160,9 +168,9 @@ char const* AST::debug_str()
|
||||
|
||||
case Function:
|
||||
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 )
|
||||
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\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" );
|
||||
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:
|
||||
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 )
|
||||
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;
|
||||
|
||||
case Operator:
|
||||
case Operator_Member:
|
||||
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 )
|
||||
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\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 ) );
|
||||
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:
|
||||
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 )
|
||||
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\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" );
|
||||
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:
|
||||
result.append_fmt( "\n\tNumEntries: %d", NumEntries );
|
||||
result.append_fmt( "\n\tLast : %S", Last->Name );
|
||||
@ -233,9 +281,9 @@ char const* AST::debug_str()
|
||||
|
||||
case Template:
|
||||
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 )
|
||||
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\tDeclaration: %S", Declaration ? Declaration->to_string() : "Null" );
|
||||
@ -243,9 +291,9 @@ char const* AST::debug_str()
|
||||
|
||||
case Typedef:
|
||||
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 )
|
||||
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\tUnderlyingType: %S", UnderlyingType ? UnderlyingType->to_string() : "Null" );
|
||||
@ -261,9 +309,9 @@ char const* AST::debug_str()
|
||||
|
||||
case Union:
|
||||
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 )
|
||||
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\tBody : %S", Body ? Body->debug_str() : "Null" );
|
||||
@ -271,9 +319,9 @@ char const* AST::debug_str()
|
||||
|
||||
case Using:
|
||||
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 )
|
||||
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\tAttributes : %S", Attributes ? Attributes->to_string() : "Null" );
|
||||
@ -293,9 +341,9 @@ char const* AST::debug_str()
|
||||
}
|
||||
|
||||
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 )
|
||||
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\tAttributes : %S", Attributes ? Attributes->to_string() : "Null" );
|
||||
@ -387,6 +435,10 @@ String AST::to_string()
|
||||
interface = interface->Next ? interface->Next->cast< CodeType >() : Code { nullptr };
|
||||
}
|
||||
}
|
||||
else if ( Name )
|
||||
{
|
||||
result.append( Name );
|
||||
}
|
||||
|
||||
if ( InlineCmt )
|
||||
{
|
||||
@ -980,6 +1032,10 @@ String AST::to_string()
|
||||
interface = interface->Next ? interface->Next->cast< CodeType >() : Code { nullptr };
|
||||
}
|
||||
}
|
||||
else if ( Name )
|
||||
{
|
||||
result.append( Name );
|
||||
}
|
||||
|
||||
if ( InlineCmt )
|
||||
{
|
||||
|
@ -67,10 +67,10 @@ struct CodeUnion;
|
||||
struct CodeUsing;
|
||||
struct CodeVar;
|
||||
|
||||
// namespace Parser
|
||||
// {
|
||||
// struct Token;
|
||||
// }
|
||||
namespace Parser
|
||||
{
|
||||
struct Token;
|
||||
}
|
||||
|
||||
/*
|
||||
AST* wrapper
|
||||
@ -162,7 +162,7 @@ struct Code_POD
|
||||
static_assert( sizeof(Code) == sizeof(Code_POD), "ERROR: Code is not POD" );
|
||||
|
||||
// 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.
|
||||
@ -220,19 +220,17 @@ struct AST
|
||||
|
||||
constexpr static
|
||||
int ArrSpecs_Cap =
|
||||
#if 1
|
||||
(
|
||||
AST_POD_Size
|
||||
- sizeof(void*) * 4
|
||||
// - sizeof(Parser::Token*)
|
||||
// - sizeof(AST*)
|
||||
- sizeof(void*)
|
||||
- sizeof(int)
|
||||
- sizeof(AST*) * 3
|
||||
- sizeof(Parser::Token*)
|
||||
- sizeof(AST*)
|
||||
- sizeof(StringCached)
|
||||
- sizeof(CodeT)
|
||||
- sizeof(ModuleFlag)
|
||||
- sizeof(int)
|
||||
)
|
||||
/ sizeof(SpecifierT); // -1 for 4 extra bytes
|
||||
#endif
|
||||
/ sizeof(int) - 1; // -1 for 4 extra bytes
|
||||
|
||||
union {
|
||||
struct
|
||||
@ -264,7 +262,7 @@ struct AST
|
||||
};
|
||||
StringCached Content; // Attributes, Comment, Execution, Include
|
||||
struct {
|
||||
SpecifierT ArrSpecs[AST::ArrSpecs_Cap]; // Specifiers
|
||||
SpecifierT ArrSpecs[ArrSpecs_Cap]; // Specifiers
|
||||
AST* NextSpecs; // Specifiers; If ArrSpecs is full, then NextSpecs is used.
|
||||
};
|
||||
};
|
||||
@ -277,7 +275,7 @@ struct AST
|
||||
AST* Next;
|
||||
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;
|
||||
StringCached Name;
|
||||
CodeT Type;
|
||||
@ -336,7 +334,7 @@ struct AST_POD
|
||||
AST* Next;
|
||||
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;
|
||||
StringCached Name;
|
||||
CodeT Type;
|
||||
@ -350,8 +348,12 @@ struct AST_POD
|
||||
};
|
||||
};
|
||||
|
||||
constexpr int specifierT_size = sizeof(SpecifierT);
|
||||
constexpr int AST_SIZE = sizeof(AST);
|
||||
struct test {
|
||||
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.
|
||||
// All extra functionality within the AST namespace should just be syntatic sugar.
|
||||
|
@ -1,6 +1,6 @@
|
||||
#ifdef GEN_INTELLISENSE_DIRECTIVES
|
||||
#pragma once
|
||||
#include "types.hpp"
|
||||
#include "components/types.hpp"
|
||||
#endif
|
||||
|
||||
// This file was generated automatially by gencpp's bootstrap.cpp (See: https://github.com/Ed94/gencpp)
|
||||
|
@ -1,6 +1,6 @@
|
||||
#ifdef GEN_INTELLISENSE_DIRECTIVES
|
||||
#pragma once
|
||||
#include "components/Types.hpp"
|
||||
#include "components/types.hpp"
|
||||
#endif
|
||||
|
||||
// This file was generated automatially by gencpp's bootstrap.cpp (See: https://github.com/Ed94/gencpp)
|
||||
|
@ -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
|
||||
#include "components/types.hpp"
|
||||
#endif
|
||||
|
||||
// This file was generated automatially by gencpp's bootstrap.cpp (See: https://github.com/Ed94/gencpp)
|
||||
|
||||
namespace Parser
|
||||
{
|
||||
|
@ -3921,7 +3921,7 @@ CodeEnum parse_enum( bool inplace_def )
|
||||
|
||||
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 );
|
||||
|
||||
switch ( currtok_noskip.Type )
|
||||
|
@ -1,5 +1,8 @@
|
||||
#ifdef GEN_INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "debug.hpp"
|
||||
# include "basic_types.hpp"
|
||||
# include "src_start.cpp"
|
||||
#endif
|
||||
|
||||
#pragma region Debug
|
||||
|
@ -1,5 +1,7 @@
|
||||
#ifdef GEN_INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "filesystem.hpp"
|
||||
# include "strings.hpp"
|
||||
# include "string_ops.cpp"
|
||||
#endif
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
#ifdef GEN_INTELLISENSE_DIRECTIVES
|
||||
# include "header_start.hpp"
|
||||
#endif
|
||||
|
||||
#pragma region Macros and Includes
|
||||
|
||||
# include <stdio.h>
|
||||
|
@ -1,5 +1,6 @@
|
||||
#ifdef GEN_INTELLISENSE_DIRECTIVES
|
||||
# pragma once
|
||||
# include "string_ops.hpp"
|
||||
# include "debug.cpp"
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user