blitz: Remove old compiler code
This commit is contained in:
-152
@@ -1,152 +0,0 @@
|
|||||||
# Microsoft Developer Studio Project File - Name="blitz" - Package Owner=<4>
|
|
||||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
|
||||||
# ** DO NOT EDIT **
|
|
||||||
|
|
||||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
|
||||||
|
|
||||||
CFG=blitz - Win32 Debug
|
|
||||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
|
||||||
!MESSAGE use the Export Makefile command and run
|
|
||||||
!MESSAGE
|
|
||||||
!MESSAGE NMAKE /f "blitz.mak".
|
|
||||||
!MESSAGE
|
|
||||||
!MESSAGE You can specify a configuration when running NMAKE
|
|
||||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
|
||||||
!MESSAGE
|
|
||||||
!MESSAGE NMAKE /f "blitz.mak" CFG="blitz - Win32 Debug"
|
|
||||||
!MESSAGE
|
|
||||||
!MESSAGE Possible choices for configuration are:
|
|
||||||
!MESSAGE
|
|
||||||
!MESSAGE "blitz - Win32 Release" (based on "Win32 (x86) Console Application")
|
|
||||||
!MESSAGE "blitz - Win32 Debug" (based on "Win32 (x86) Console Application")
|
|
||||||
!MESSAGE "blitz - Win32 Blitz3DRelease" (based on "Win32 (x86) Console Application")
|
|
||||||
!MESSAGE "blitz - Win32 Blitz2DRelease" (based on "Win32 (x86) Console Application")
|
|
||||||
!MESSAGE
|
|
||||||
|
|
||||||
# Begin Project
|
|
||||||
# PROP AllowPerConfigDependencies 0
|
|
||||||
# PROP Scc_ProjName ""
|
|
||||||
# PROP Scc_LocalPath ""
|
|
||||||
CPP=cl.exe
|
|
||||||
RSC=rc.exe
|
|
||||||
|
|
||||||
!IF "$(CFG)" == "blitz - Win32 Release"
|
|
||||||
|
|
||||||
# PROP BASE Use_MFC 0
|
|
||||||
# PROP BASE Use_Debug_Libraries 0
|
|
||||||
# PROP BASE Output_Dir "Release"
|
|
||||||
# PROP BASE Intermediate_Dir "Release"
|
|
||||||
# PROP BASE Target_Dir ""
|
|
||||||
# PROP Use_MFC 0
|
|
||||||
# PROP Use_Debug_Libraries 0
|
|
||||||
# PROP Output_Dir "Release"
|
|
||||||
# PROP Intermediate_Dir "Release"
|
|
||||||
# PROP Ignore_Export_Lib 0
|
|
||||||
# PROP Target_Dir ""
|
|
||||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
|
||||||
# ADD CPP /nologo /MT /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
|
||||||
# ADD BASE RSC /l 0x1409 /d "NDEBUG"
|
|
||||||
# ADD RSC /l 0x1409 /d "NDEBUG"
|
|
||||||
BSC32=bscmake.exe
|
|
||||||
# ADD BASE BSC32 /nologo
|
|
||||||
# ADD BSC32 /nologo
|
|
||||||
LINK32=link.exe
|
|
||||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
|
||||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\blitzbasic\bin\blitzcc.exe"
|
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "blitz - Win32 Debug"
|
|
||||||
|
|
||||||
# PROP BASE Use_MFC 0
|
|
||||||
# PROP BASE Use_Debug_Libraries 1
|
|
||||||
# PROP BASE Output_Dir "Debug"
|
|
||||||
# PROP BASE Intermediate_Dir "Debug"
|
|
||||||
# PROP BASE Target_Dir ""
|
|
||||||
# PROP Use_MFC 0
|
|
||||||
# PROP Use_Debug_Libraries 1
|
|
||||||
# PROP Output_Dir "Debug"
|
|
||||||
# PROP Intermediate_Dir "Debug"
|
|
||||||
# PROP Target_Dir ""
|
|
||||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
|
||||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
|
||||||
# ADD BASE RSC /l 0x1409 /d "_DEBUG"
|
|
||||||
# ADD RSC /l 0x1409 /d "_DEBUG"
|
|
||||||
BSC32=bscmake.exe
|
|
||||||
# ADD BASE BSC32 /nologo
|
|
||||||
# ADD BSC32 /nologo
|
|
||||||
LINK32=link.exe
|
|
||||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
|
||||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "blitz - Win32 Blitz3DRelease"
|
|
||||||
|
|
||||||
# PROP BASE Use_MFC 0
|
|
||||||
# PROP BASE Use_Debug_Libraries 0
|
|
||||||
# PROP BASE Output_Dir "blitz___Win32_Blitz3DRelease"
|
|
||||||
# PROP BASE Intermediate_Dir "blitz___Win32_Blitz3DRelease"
|
|
||||||
# PROP BASE Ignore_Export_Lib 0
|
|
||||||
# PROP BASE Target_Dir ""
|
|
||||||
# PROP Use_MFC 0
|
|
||||||
# PROP Use_Debug_Libraries 0
|
|
||||||
# PROP Output_Dir "blitz___Win32_Blitz3DRelease"
|
|
||||||
# PROP Intermediate_Dir "blitz___Win32_Blitz3DRelease"
|
|
||||||
# PROP Ignore_Export_Lib 0
|
|
||||||
# PROP Target_Dir ""
|
|
||||||
# ADD BASE CPP /nologo /MT /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
|
||||||
# ADD CPP /nologo /G6 /Gz /MT /W3 /GX /O1 /D "_CONSOLE" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "PRO" /FD /c
|
|
||||||
# SUBTRACT CPP /YX
|
|
||||||
# ADD BASE RSC /l 0x1409 /d "NDEBUG"
|
|
||||||
# ADD RSC /l 0x1409 /d "NDEBUG"
|
|
||||||
BSC32=bscmake.exe
|
|
||||||
# ADD BASE BSC32 /nologo
|
|
||||||
# ADD BSC32 /nologo
|
|
||||||
LINK32=link.exe
|
|
||||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\blitzbasic\bin\blitzcc.exe"
|
|
||||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../_release/bin/blitzcc.exe"
|
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "blitz - Win32 Blitz2DRelease"
|
|
||||||
|
|
||||||
# PROP BASE Use_MFC 0
|
|
||||||
# PROP BASE Use_Debug_Libraries 0
|
|
||||||
# PROP BASE Output_Dir "blitz___Win32_Blitz2DRelease"
|
|
||||||
# PROP BASE Intermediate_Dir "blitz___Win32_Blitz2DRelease"
|
|
||||||
# PROP BASE Ignore_Export_Lib 0
|
|
||||||
# PROP BASE Target_Dir ""
|
|
||||||
# PROP Use_MFC 0
|
|
||||||
# PROP Use_Debug_Libraries 0
|
|
||||||
# PROP Output_Dir "blitz___Win32_Blitz2DRelease"
|
|
||||||
# PROP Intermediate_Dir "blitz___Win32_Blitz2DRelease"
|
|
||||||
# PROP Ignore_Export_Lib 0
|
|
||||||
# PROP Target_Dir ""
|
|
||||||
# ADD BASE CPP /nologo /MT /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
|
||||||
# ADD CPP /nologo /MT /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
|
||||||
# ADD BASE RSC /l 0x1409 /d "NDEBUG"
|
|
||||||
# ADD RSC /l 0x1409 /d "NDEBUG"
|
|
||||||
BSC32=bscmake.exe
|
|
||||||
# ADD BASE BSC32 /nologo
|
|
||||||
# ADD BSC32 /nologo
|
|
||||||
LINK32=link.exe
|
|
||||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\..\release\blitz3drelease\bin\blitzcc.exe"
|
|
||||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\..\release\blitz2drelease\bin\blitzcc.exe"
|
|
||||||
|
|
||||||
!ENDIF
|
|
||||||
|
|
||||||
# Begin Target
|
|
||||||
|
|
||||||
# Name "blitz - Win32 Release"
|
|
||||||
# Name "blitz - Win32 Debug"
|
|
||||||
# Name "blitz - Win32 Blitz3DRelease"
|
|
||||||
# Name "blitz - Win32 Blitz2DRelease"
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\libs.cpp
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\libs.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\main.cpp
|
|
||||||
# End Source File
|
|
||||||
# End Target
|
|
||||||
# End Project
|
|
||||||
@@ -1,213 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="RelWithDebInfo|Win32">
|
|
||||||
<Configuration>RelWithDebInfo</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<SccProjectName />
|
|
||||||
<SccLocalPath />
|
|
||||||
<ProjectGuid>{C23AF61E-9509-411F-933E-17DB18884B21}</ProjectGuid>
|
|
||||||
<ProjectName>BlitzCC</ProjectName>
|
|
||||||
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<PlatformToolset>v141</PlatformToolset>
|
|
||||||
<UseOfMfc>false</UseOfMfc>
|
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<PlatformToolset>v140_xp</PlatformToolset>
|
|
||||||
<UseOfMfc>false</UseOfMfc>
|
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<PlatformToolset>v140_xp</PlatformToolset>
|
|
||||||
<UseOfMfc>false</UseOfMfc>
|
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<ImportGroup Label="ExtensionSettings">
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
|
||||||
</ImportGroup>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<OutDir>..\#Build\$(ProjectName)\$(Configuration)-$(PlatformTarget)\</OutDir>
|
|
||||||
<IntDir>..\#Intermediate\$(ProjectName)\$(Configuration)-$(PlatformTarget)\</IntDir>
|
|
||||||
<LinkIncremental>true</LinkIncremental>
|
|
||||||
<IncludePath>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um;$(IncludePath)</IncludePath>
|
|
||||||
<LibraryPath>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\um\x86;$(LibraryPath)</LibraryPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<OutDir>..\#Build\$(ProjectName)\$(Configuration)-$(PlatformTarget)\</OutDir>
|
|
||||||
<IntDir>..\#Intermediate\$(ProjectName)\$(Configuration)-$(PlatformTarget)\</IntDir>
|
|
||||||
<LinkIncremental>false</LinkIncremental>
|
|
||||||
<IncludePath>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um;$(IncludePath)</IncludePath>
|
|
||||||
<LibraryPath>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\um\x86;$(LibraryPath)</LibraryPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">
|
|
||||||
<OutDir>..\#Build\$(ProjectName)\$(Configuration)-$(PlatformTarget)\</OutDir>
|
|
||||||
<IntDir>..\#Intermediate\$(ProjectName)\$(Configuration)-$(PlatformTarget)\</IntDir>
|
|
||||||
<LinkIncremental>false</LinkIncremental>
|
|
||||||
<IncludePath>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um;$(IncludePath)</IncludePath>
|
|
||||||
<LibraryPath>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\um\x86;$(LibraryPath)</LibraryPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
|
||||||
<FunctionLevelLinking>false</FunctionLevelLinking>
|
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
|
||||||
<MinimalRebuild>true</MinimalRebuild>
|
|
||||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
|
||||||
<ControlFlowGuard>false</ControlFlowGuard>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<CallingConvention>StdCall</CallingConvention>
|
|
||||||
<ExceptionHandling>Async</ExceptionHandling>
|
|
||||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
|
||||||
</ClCompile>
|
|
||||||
<Midl>
|
|
||||||
<TypeLibraryName>.\Debug\blitz.tlb</TypeLibraryName>
|
|
||||||
</Midl>
|
|
||||||
<ResourceCompile>
|
|
||||||
<Culture>0x1409</Culture>
|
|
||||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
</ResourceCompile>
|
|
||||||
<Bscmake>
|
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
|
||||||
<OutputFile>.\Debug\blitz.bsc</OutputFile>
|
|
||||||
</Bscmake>
|
|
||||||
<Link>
|
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
|
||||||
<FunctionLevelLinking>false</FunctionLevelLinking>
|
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<MinimalRebuild>true</MinimalRebuild>
|
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
|
||||||
<ControlFlowGuard>false</ControlFlowGuard>
|
|
||||||
<CallingConvention>StdCall</CallingConvention>
|
|
||||||
<ExceptionHandling>Async</ExceptionHandling>
|
|
||||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
|
||||||
<Optimization>Full</Optimization>
|
|
||||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
|
||||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
|
||||||
<OmitFramePointers>true</OmitFramePointers>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<StructMemberAlignment>4Bytes</StructMemberAlignment>
|
|
||||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
|
||||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
|
||||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
|
||||||
<FloatingPointModel>Fast</FloatingPointModel>
|
|
||||||
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
|
||||||
<CompileAsManaged>false</CompileAsManaged>
|
|
||||||
<SDLCheck>
|
|
||||||
</SDLCheck>
|
|
||||||
<MultiProcessorCompilation>false</MultiProcessorCompilation>
|
|
||||||
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
|
||||||
</ClCompile>
|
|
||||||
<Midl>
|
|
||||||
<TypeLibraryName>.\Release\blitz.tlb</TypeLibraryName>
|
|
||||||
</Midl>
|
|
||||||
<ResourceCompile>
|
|
||||||
<Culture>0x1409</Culture>
|
|
||||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
</ResourceCompile>
|
|
||||||
<Bscmake>
|
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
|
||||||
<OutputFile>.\Release\blitz.bsc</OutputFile>
|
|
||||||
</Bscmake>
|
|
||||||
<Link>
|
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
|
||||||
<FunctionLevelLinking>false</FunctionLevelLinking>
|
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<MinimalRebuild>true</MinimalRebuild>
|
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
|
||||||
<ControlFlowGuard>false</ControlFlowGuard>
|
|
||||||
<CallingConvention>StdCall</CallingConvention>
|
|
||||||
<ExceptionHandling>Async</ExceptionHandling>
|
|
||||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
|
||||||
</ClCompile>
|
|
||||||
<Midl>
|
|
||||||
<TypeLibraryName>.\Release\blitz.tlb</TypeLibraryName>
|
|
||||||
</Midl>
|
|
||||||
<ResourceCompile>
|
|
||||||
<Culture>0x1409</Culture>
|
|
||||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
</ResourceCompile>
|
|
||||||
<Bscmake>
|
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
|
||||||
<OutputFile>.\Release\blitz.bsc</OutputFile>
|
|
||||||
</Bscmake>
|
|
||||||
<Link>
|
|
||||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="libs.cpp" />
|
|
||||||
<ClCompile Include="main.cpp" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClInclude Include="libs.h" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\compiler\compiler.vcxproj">
|
|
||||||
<Project>{d884a075-e3b8-44e1-838d-74f28b33391b}</Project>
|
|
||||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\stdutil\stdutil.vcxproj">
|
|
||||||
<Project>{6bcfc5ca-ea71-4ae9-8b96-28b8701f939e}</Project>
|
|
||||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
|
||||||
</ImportGroup>
|
|
||||||
</Project>
|
|
||||||
-317
@@ -1,317 +0,0 @@
|
|||||||
|
|
||||||
#include "libs.h"
|
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
int bcc_ver;
|
|
||||||
int lnk_ver;
|
|
||||||
int run_ver;
|
|
||||||
int dbg_ver;
|
|
||||||
|
|
||||||
string home;
|
|
||||||
Linker *linkerLib;
|
|
||||||
Runtime *runtimeLib;
|
|
||||||
|
|
||||||
Module *runtimeModule;
|
|
||||||
Environ *runtimeEnviron;
|
|
||||||
vector<string> keyWords;
|
|
||||||
vector<UserFunc> userFuncs;
|
|
||||||
|
|
||||||
static HMODULE linkerHMOD, runtimeHMOD;
|
|
||||||
|
|
||||||
static Type *bbtypeof(int c) {
|
|
||||||
switch (c) {
|
|
||||||
case '%':return Type::int_type;
|
|
||||||
case '#':return Type::float_type;
|
|
||||||
case '$':return Type::string_type;
|
|
||||||
}
|
|
||||||
return Type::void_type;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int curr;
|
|
||||||
static string text;
|
|
||||||
|
|
||||||
static int bbnext(istream &in) {
|
|
||||||
|
|
||||||
text = "";
|
|
||||||
|
|
||||||
int t = 0;
|
|
||||||
|
|
||||||
for (;;) {
|
|
||||||
while (isspace(in.peek())) in.get();
|
|
||||||
if (in.eof()) return curr = 0;
|
|
||||||
t = in.get(); if (t != ';') break;
|
|
||||||
while (!in.eof() && in.get() != '\n') {}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isalpha(t)) {
|
|
||||||
text += (char)t;
|
|
||||||
while (isalnum(in.peek()) || in.peek() == '_') text += (char)in.get();
|
|
||||||
return curr = -1;
|
|
||||||
}
|
|
||||||
if (t == '\"') {
|
|
||||||
while (in.peek() != '\"') text = text + (char)in.get();
|
|
||||||
in.get();
|
|
||||||
return curr = -2;
|
|
||||||
}
|
|
||||||
|
|
||||||
return curr = t;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const char *linkRuntime() {
|
|
||||||
|
|
||||||
while (const char *sym = runtimeLib->nextSym()) {
|
|
||||||
|
|
||||||
string s(sym);
|
|
||||||
|
|
||||||
int pc = runtimeLib->symValue(sym);
|
|
||||||
|
|
||||||
//internal?
|
|
||||||
if (s[0] == '_') {
|
|
||||||
runtimeModule->addSymbol(("_" + s).c_str(), pc);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool cfunc = false;
|
|
||||||
|
|
||||||
if (s[0] == '!') {
|
|
||||||
cfunc = true;
|
|
||||||
s = s.substr(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
keyWords.push_back(s);
|
|
||||||
|
|
||||||
//global!
|
|
||||||
size_t start = 0, end, k;
|
|
||||||
Type *t = Type::void_type;
|
|
||||||
if (!isalpha(s[0])) { start = 1; t = bbtypeof(s[0]); }
|
|
||||||
for (k = 1; k < s.size(); ++k, end = k) {
|
|
||||||
if (!isalnum(s[k]) && s[k] != '_') break;
|
|
||||||
}
|
|
||||||
DeclSeq *params = new DeclSeq();
|
|
||||||
string n = s.substr(start, end - start);
|
|
||||||
while (k < s.size()) {
|
|
||||||
Type *t = bbtypeof(s[k++]);
|
|
||||||
int from = k;
|
|
||||||
for (; isalnum(s[k]) || s[k] == '_'; ++k) {}
|
|
||||||
string str = s.substr(from, k - from);
|
|
||||||
ConstType *defType = 0;
|
|
||||||
if (s[k] == '=') {
|
|
||||||
int from = ++k;
|
|
||||||
if (s[k] == '\"') {
|
|
||||||
for (++k; s[k] != '\"'; ++k) {}
|
|
||||||
string t = s.substr(from + 1, k - from - 1);
|
|
||||||
defType = new ConstType(t); ++k;
|
|
||||||
} else {
|
|
||||||
if (s[k] == '-') ++k;
|
|
||||||
for (; isdigit(s[k]); ++k) {}
|
|
||||||
if (t == Type::int_type) {
|
|
||||||
int n = atoi(s.substr(from, k - from));
|
|
||||||
defType = new ConstType(n);
|
|
||||||
} else {
|
|
||||||
float n = (float)atof(s.substr(from, k - from));
|
|
||||||
defType = new ConstType(n);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Decl *d = params->insertDecl(str, t, DECL_PARAM, defType);
|
|
||||||
}
|
|
||||||
|
|
||||||
FuncType *f = new FuncType(t, params, false, cfunc);
|
|
||||||
n = tolower(n);
|
|
||||||
runtimeEnviron->funcDecls->insertDecl(n, f, DECL_FUNC);
|
|
||||||
runtimeModule->addSymbol(("_f" + n).c_str(), pc);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static set<string> _ulibkws;
|
|
||||||
|
|
||||||
static const char *loadUserLib(const string &userlib) {
|
|
||||||
|
|
||||||
string t = home + "/userlibs/" + userlib;
|
|
||||||
|
|
||||||
string lib = "";
|
|
||||||
ifstream in(t.c_str());
|
|
||||||
|
|
||||||
bbnext(in);
|
|
||||||
while (curr) {
|
|
||||||
if (curr == '.') {
|
|
||||||
|
|
||||||
if (bbnext(in) != -1) return "expecting identifier after '.'";
|
|
||||||
|
|
||||||
if (text == "lib") {
|
|
||||||
if (bbnext(in) != -2) return "expecting string after lib directive";
|
|
||||||
lib = text;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
return "unknown decl directive";
|
|
||||||
}
|
|
||||||
bbnext(in);
|
|
||||||
|
|
||||||
} else if (curr == -1) {
|
|
||||||
|
|
||||||
if (!lib.size()) return "function decl without lib directive";
|
|
||||||
|
|
||||||
string id = text;
|
|
||||||
string lower_id = tolower(id);
|
|
||||||
|
|
||||||
if (_ulibkws.count(lower_id)) return "duplicate identifier";
|
|
||||||
_ulibkws.insert(lower_id);
|
|
||||||
|
|
||||||
Type *ty = 0;
|
|
||||||
switch (bbnext(in)) {
|
|
||||||
case '%':ty = Type::int_type; break;
|
|
||||||
case '#':ty = Type::float_type; break;
|
|
||||||
case '$':ty = Type::string_type; break;
|
|
||||||
}
|
|
||||||
if (ty) bbnext(in);
|
|
||||||
else ty = Type::void_type;
|
|
||||||
|
|
||||||
DeclSeq *params = new DeclSeq();
|
|
||||||
|
|
||||||
if (curr != '(') return "expecting '(' after function identifier";
|
|
||||||
bbnext(in);
|
|
||||||
if (curr != ')') {
|
|
||||||
for (;;) {
|
|
||||||
if (curr != -1) break;
|
|
||||||
string arg = text;
|
|
||||||
|
|
||||||
Type *ty = 0;
|
|
||||||
switch (bbnext(in)) {
|
|
||||||
case '%':ty = Type::int_type; break;
|
|
||||||
case '#':ty = Type::float_type; break;
|
|
||||||
case '$':ty = Type::string_type; break;
|
|
||||||
case '*':ty = Type::null_type; break;
|
|
||||||
}
|
|
||||||
if (ty) bbnext(in);
|
|
||||||
else ty = Type::int_type;
|
|
||||||
|
|
||||||
ConstType *defType = 0;
|
|
||||||
|
|
||||||
Decl *d = params->insertDecl(arg, ty, DECL_PARAM, defType);
|
|
||||||
|
|
||||||
if (curr != ',') break;
|
|
||||||
bbnext(in);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (curr != ')') return "expecting ')' after function decl";
|
|
||||||
|
|
||||||
keyWords.push_back(id);
|
|
||||||
|
|
||||||
FuncType *fn = new FuncType(ty, params, true, true);
|
|
||||||
|
|
||||||
runtimeEnviron->funcDecls->insertDecl(lower_id, fn, DECL_FUNC);
|
|
||||||
|
|
||||||
if (bbnext(in) == ':') { //real name?
|
|
||||||
bbnext(in);
|
|
||||||
if (curr != -1 && curr != -2) return "expecting identifier or string after alias";
|
|
||||||
id = text;
|
|
||||||
bbnext(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
userFuncs.push_back(UserFunc(lower_id, id, lib));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const char *linkUserLibs() {
|
|
||||||
|
|
||||||
_ulibkws.clear();
|
|
||||||
|
|
||||||
WIN32_FIND_DATA fd;
|
|
||||||
|
|
||||||
HANDLE h = FindFirstFile((home + "/userlibs/*.decls").c_str(), &fd);
|
|
||||||
|
|
||||||
if (h == INVALID_HANDLE_VALUE) return 0;
|
|
||||||
|
|
||||||
const char *err = 0;
|
|
||||||
|
|
||||||
do {
|
|
||||||
if (err = loadUserLib(fd.cFileName)) {
|
|
||||||
static char buf[64];
|
|
||||||
sprintf(buf, "Error in userlib '%s' - %s", fd.cFileName, err);
|
|
||||||
err = buf; break;
|
|
||||||
}
|
|
||||||
|
|
||||||
} while (FindNextFile(h, &fd));
|
|
||||||
|
|
||||||
FindClose(h);
|
|
||||||
|
|
||||||
_ulibkws.clear();
|
|
||||||
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *openLibs() {
|
|
||||||
|
|
||||||
/*char *p = getenv("blitzpath");
|
|
||||||
if (!p) return "Can't find blitzpath environment variable";
|
|
||||||
*/
|
|
||||||
char* buf = new char[MAX_PATH];
|
|
||||||
GetModuleFileName(NULL, buf, MAX_PATH);
|
|
||||||
home = string(buf);
|
|
||||||
delete buf;
|
|
||||||
|
|
||||||
string::size_type pos = home.find_last_of("\\/");
|
|
||||||
home = home.substr(0, pos);
|
|
||||||
|
|
||||||
linkerHMOD = LoadLibrary((home + "\\linker.dll").c_str());
|
|
||||||
if (!linkerHMOD) return "Unable to open linker.dll";
|
|
||||||
|
|
||||||
typedef Linker *(_cdecl*GetLinker)();
|
|
||||||
GetLinker gl = (GetLinker)GetProcAddress(linkerHMOD, "linkerGetLinker");
|
|
||||||
if (!gl) return "Error in linker.dll";
|
|
||||||
linkerLib = gl();
|
|
||||||
|
|
||||||
runtimeHMOD = LoadLibrary((home + "\\runtime.dll").c_str());
|
|
||||||
if (!runtimeHMOD) return "Unable to open runtime.dll";
|
|
||||||
|
|
||||||
typedef Runtime *(_cdecl*GetRuntime)();
|
|
||||||
GetRuntime gr = (GetRuntime)GetProcAddress(runtimeHMOD, "runtimeGetRuntime");
|
|
||||||
if (!gr) return "Error in runtime.dll";
|
|
||||||
runtimeLib = gr();
|
|
||||||
|
|
||||||
bcc_ver = VERSION;
|
|
||||||
lnk_ver = linkerLib->version();
|
|
||||||
run_ver = runtimeLib->version();
|
|
||||||
|
|
||||||
if ((lnk_ver >> 16) != (bcc_ver >> 16) ||
|
|
||||||
(run_ver >> 16) != (bcc_ver >> 16) ||
|
|
||||||
(lnk_ver >> 16) != (bcc_ver >> 16)) return "Library version error";
|
|
||||||
|
|
||||||
runtimeLib->startup(GetModuleHandle(0));
|
|
||||||
|
|
||||||
runtimeModule = linkerLib->createModule();
|
|
||||||
runtimeEnviron = new Environ("", Type::int_type, 0, 0);
|
|
||||||
|
|
||||||
keyWords.clear();
|
|
||||||
userFuncs.clear();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *linkLibs() {
|
|
||||||
|
|
||||||
if (const char *p = linkRuntime()) return p;
|
|
||||||
|
|
||||||
if (const char *p = linkUserLibs()) return p;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void closeLibs() {
|
|
||||||
|
|
||||||
delete runtimeEnviron;
|
|
||||||
if (linkerLib) linkerLib->deleteModule(runtimeModule);
|
|
||||||
if (runtimeLib) runtimeLib->shutdown();
|
|
||||||
if (runtimeHMOD) FreeLibrary(runtimeHMOD);
|
|
||||||
if (linkerHMOD) FreeLibrary(linkerHMOD);
|
|
||||||
|
|
||||||
runtimeEnviron = 0;
|
|
||||||
linkerLib = 0;
|
|
||||||
runtimeLib = 0;
|
|
||||||
runtimeHMOD = 0;
|
|
||||||
linkerHMOD = 0;
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
|
|
||||||
#ifndef LIBS_H
|
|
||||||
#define LIBS_H
|
|
||||||
|
|
||||||
#include <map>
|
|
||||||
#include <list>
|
|
||||||
#include <vector>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#include "../LinkerLib/linker.h"
|
|
||||||
#include "../compiler/environ.h"
|
|
||||||
#include "../compiler/parser.h"
|
|
||||||
#include "../Runtime/bbruntime_dll.h"
|
|
||||||
|
|
||||||
extern int bcc_ver;
|
|
||||||
extern int lnk_ver;
|
|
||||||
extern int run_ver;
|
|
||||||
extern int dbg_ver;
|
|
||||||
|
|
||||||
//openLibs
|
|
||||||
extern string home;
|
|
||||||
extern Linker *linkerLib;
|
|
||||||
extern Runtime *runtimeLib;
|
|
||||||
|
|
||||||
//linkLibs
|
|
||||||
extern Module *runtimeModule;
|
|
||||||
extern Environ *runtimeEnviron;
|
|
||||||
extern vector<string> keyWords;
|
|
||||||
extern vector<UserFunc> userFuncs;
|
|
||||||
|
|
||||||
const char *openLibs();
|
|
||||||
|
|
||||||
const char *linkLibs();
|
|
||||||
|
|
||||||
void closeLibs();
|
|
||||||
|
|
||||||
#endif
|
|
||||||
-321
@@ -1,321 +0,0 @@
|
|||||||
|
|
||||||
#pragma warning(disable:4786)
|
|
||||||
|
|
||||||
#include "libs.h"
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "../config/config.h"
|
|
||||||
#include "../stdutil/stdutil.h"
|
|
||||||
|
|
||||||
#include <set>
|
|
||||||
#include <map>
|
|
||||||
#include <list>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <fstream>
|
|
||||||
#include <iostream>
|
|
||||||
#include <iomanip>
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#include "../LinkerLib/linker.h"
|
|
||||||
#include "../compiler/environ.h"
|
|
||||||
#include "../compiler/parser.h"
|
|
||||||
#include "../compiler/assem_x86/assem_x86.h"
|
|
||||||
#include "../compiler/codegen_x86/codegen_x86.h"
|
|
||||||
#include "../Runtime/bbruntime_dll.h"
|
|
||||||
|
|
||||||
static void showInfo() {
|
|
||||||
const int major = (VERSION & 0xffff) / 100, minor = (VERSION & 0xffff) % 100;
|
|
||||||
cout << "BlitzCC V" << major << "." << minor << endl;
|
|
||||||
cout << "(C)opyright 2000-2003 Blitz Research Ltd" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void showUsage() {
|
|
||||||
cout << "Usage: blitzcc [-h|-q|+q|-c|-d|-k|+k|-v|-o exefile] [sourcefile.bb]" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void showHelp() {
|
|
||||||
showUsage();
|
|
||||||
cout << "-h : show this help" << endl;
|
|
||||||
cout << "-q : quiet mode" << endl;
|
|
||||||
cout << "+q : very quiet mode" << endl;
|
|
||||||
cout << "-c : compile only" << endl;
|
|
||||||
cout << "-d : debug compile" << endl;
|
|
||||||
cout << "-k : dump keywords" << endl;
|
|
||||||
cout << "+k : dump keywords and syntax" << endl;
|
|
||||||
cout << "-v : version info" << endl;
|
|
||||||
cout << "-o exefile : generate executable" << endl;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static void err(const string &t) {
|
|
||||||
cout << t << endl;
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void usageErr() {
|
|
||||||
err("Usage error");
|
|
||||||
}
|
|
||||||
|
|
||||||
static string quickHelp(const string &kw) {
|
|
||||||
|
|
||||||
Environ *e = runtimeEnviron;
|
|
||||||
Decl *d = e->funcDecls->findDecl(tolower(kw));
|
|
||||||
if (!d || d->type->funcType() == 0) return "No quick help available for " + kw;
|
|
||||||
string t = kw;
|
|
||||||
FuncType *f = d->type->funcType();
|
|
||||||
if (f->returnType == Type::float_type) t += '#';
|
|
||||||
else if (f->returnType == Type::string_type) t += '$';
|
|
||||||
|
|
||||||
t += " ";
|
|
||||||
|
|
||||||
if (f->returnType != Type::void_type) t += "( ";
|
|
||||||
|
|
||||||
for (int k = 0; k < f->params->size(); ++k) {
|
|
||||||
string s;
|
|
||||||
if (k) s += ',';
|
|
||||||
Decl *p = f->params->decls[k]; s += p->name;
|
|
||||||
if (p->type == Type::float_type) s += '#';
|
|
||||||
else if (p->type == Type::string_type) s += '$';
|
|
||||||
else if (p->type == Type::void_type) s += '*';
|
|
||||||
if (p->defType) s = '[' + s + ']';
|
|
||||||
t += s;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (f->returnType != Type::void_type) {
|
|
||||||
t += f->params->size() ? " )" : ")";
|
|
||||||
}
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void dumpKeys(bool lang, bool mod, bool help) {
|
|
||||||
|
|
||||||
if (lang) {
|
|
||||||
map<string, int>::iterator it;
|
|
||||||
map<string, int> &keywords = Toker::getKeywords();
|
|
||||||
for (it = keywords.begin(); it != keywords.end(); ++it) {
|
|
||||||
if (it->first.find(' ') != string::npos) continue;
|
|
||||||
cout << it->first << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!mod) return;
|
|
||||||
|
|
||||||
for (int k = 0; k < keyWords.size(); ++k) {
|
|
||||||
string t = keyWords[k];
|
|
||||||
|
|
||||||
if (t[0] == '_') continue;
|
|
||||||
if (!isalpha(t[0])) t = t.substr(1);
|
|
||||||
for (int n = 0; n < t.size(); ++n) {
|
|
||||||
if (!isalnum(t[n]) && t[n] != '_') {
|
|
||||||
t = t.substr(0, n);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (help) t = quickHelp(t);
|
|
||||||
cout << t << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static string verstr(int ver) {
|
|
||||||
return itoa((ver & 65535) / 100) + "." + itoa((ver & 65535) % 100);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void versInfo() {
|
|
||||||
cout << "Compiler version:" << verstr(bcc_ver) << endl;
|
|
||||||
cout << "Runtime version:" << verstr(run_ver) << endl;
|
|
||||||
cout << "Debugger version:" << verstr(dbg_ver) << endl;
|
|
||||||
cout << "Linker version:" << verstr(lnk_ver) << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void demoError() {
|
|
||||||
cout << "Compiler can not be used standalone in demo version." << endl;
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
|
||||||
try {
|
|
||||||
|
|
||||||
string in_file, out_file, args;
|
|
||||||
|
|
||||||
bool debug = false, quiet = false, veryquiet = false, compileonly = false;
|
|
||||||
bool dumpkeys = false, dumphelp = false, showhelp = false, dumpasm = false;
|
|
||||||
bool versinfo = false;
|
|
||||||
|
|
||||||
for (int k = 1; k < argc; ++k) {
|
|
||||||
string t = argv[k];
|
|
||||||
t = tolower(t);
|
|
||||||
|
|
||||||
if (t == "-h") {
|
|
||||||
showhelp = true;
|
|
||||||
}
|
|
||||||
else if (t == "-a") {
|
|
||||||
dumpasm = true;
|
|
||||||
}
|
|
||||||
else if (t == "-q") {
|
|
||||||
quiet = true;
|
|
||||||
}
|
|
||||||
else if (t == "+q") {
|
|
||||||
quiet = veryquiet = true;
|
|
||||||
}
|
|
||||||
else if (t == "-c") {
|
|
||||||
compileonly = true;
|
|
||||||
}
|
|
||||||
else if (t == "-d") {
|
|
||||||
debug = true;
|
|
||||||
}
|
|
||||||
else if (t == "-k") {
|
|
||||||
dumpkeys = true;
|
|
||||||
}
|
|
||||||
else if (t == "+k") {
|
|
||||||
dumpkeys = dumphelp = true;
|
|
||||||
}
|
|
||||||
else if (t == "-v") {
|
|
||||||
versinfo = true;
|
|
||||||
}
|
|
||||||
else if (t == "-o") {
|
|
||||||
if (out_file.size() || k == argc - 1)
|
|
||||||
usageErr();
|
|
||||||
|
|
||||||
out_file = argv[++k];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (in_file.size() || t[0] == '-' || t[0] == '+')
|
|
||||||
usageErr();
|
|
||||||
|
|
||||||
in_file = argv[k];
|
|
||||||
for (++k; k < argc; ++k) {
|
|
||||||
string t = argv[k];
|
|
||||||
if (t.find(' ') != string::npos) t = '\"' + t + '\"';
|
|
||||||
if (args.size()) args += ' ';
|
|
||||||
args += t;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (out_file.size() && !in_file.size()) usageErr();
|
|
||||||
|
|
||||||
if (const char *er = openLibs()) err(er);
|
|
||||||
|
|
||||||
if (const char *er = linkLibs()) err(er);
|
|
||||||
|
|
||||||
if (showhelp) showHelp();
|
|
||||||
if (dumpkeys) dumpKeys(true, true, dumphelp);
|
|
||||||
if (versinfo) versInfo();
|
|
||||||
|
|
||||||
if (!in_file.size()) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (in_file[0] == '\"') {
|
|
||||||
if ((in_file.size() < 3) || (in_file[in_file.size() - 1] != '\"')) {
|
|
||||||
usageErr();
|
|
||||||
}
|
|
||||||
in_file = in_file.substr(1, in_file.size() - 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
ifstream in(in_file.c_str());
|
|
||||||
if (!in) err("Unable to open input file");
|
|
||||||
if (!quiet) {
|
|
||||||
showInfo();
|
|
||||||
cout << "Compiling \"" << in_file << "\"" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
int n = in_file.rfind('/');
|
|
||||||
if (n == string::npos) n = in_file.rfind('\\');
|
|
||||||
if (n != string::npos) {
|
|
||||||
if (!n || in_file[n - 1] == ':') ++n;
|
|
||||||
SetCurrentDirectory(in_file.substr(0, n).c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
ProgNode *prog = 0;
|
|
||||||
Environ *v_environ = 0;
|
|
||||||
Module *module = 0;
|
|
||||||
|
|
||||||
try {
|
|
||||||
//parse
|
|
||||||
if (!veryquiet) cout << "Parsing..." << endl;
|
|
||||||
Toker toker(in);
|
|
||||||
Parser parser(toker);
|
|
||||||
prog = parser.parse(in_file);
|
|
||||||
|
|
||||||
//semant
|
|
||||||
if (!veryquiet) cout << "Generating..." << endl;
|
|
||||||
v_environ = prog->semant(runtimeEnviron);
|
|
||||||
|
|
||||||
//translate
|
|
||||||
if (!veryquiet) cout << "Translating..." << endl;
|
|
||||||
qstreambuf qbuf;
|
|
||||||
iostream asmcode(&qbuf);
|
|
||||||
Codegen_x86 codegen(asmcode, debug);
|
|
||||||
|
|
||||||
prog->translate(&codegen, userFuncs);
|
|
||||||
|
|
||||||
if (dumpasm) {
|
|
||||||
cout << endl << string(qbuf.data(), qbuf.size()) << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
//assemble
|
|
||||||
if (!veryquiet) cout << "Assembling..." << endl;
|
|
||||||
module = linkerLib->createModule();
|
|
||||||
Assem_x86 assem(asmcode, module);
|
|
||||||
assem.assemble();
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Ex &x) {
|
|
||||||
|
|
||||||
string file = '\"' + x.file + '\"';
|
|
||||||
int row = ((x.pos >> 16) & 65535) + 1, col = (x.pos & 65535) + 1;
|
|
||||||
cout << file << ":" << row << ":" << col << ":" << row << ":" << col << ":" << x.ex << endl;
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
delete prog;
|
|
||||||
|
|
||||||
if (out_file.size()) {
|
|
||||||
if (!veryquiet) cout << "Creating executable \"" << out_file << "\"..." << endl;
|
|
||||||
if (!module->createExe(out_file.c_str(), (home + "/bin/runtime.dll").c_str())) {
|
|
||||||
err("Error creating executable");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (!compileonly) {
|
|
||||||
void *entry = module->link(runtimeModule);
|
|
||||||
if (!entry) return 0;
|
|
||||||
|
|
||||||
HMODULE dbgHandle = 0;
|
|
||||||
Debugger *debugger = 0;
|
|
||||||
|
|
||||||
if (debug) {
|
|
||||||
dbgHandle = LoadLibrary((home + "\\debugger.dll").c_str());
|
|
||||||
if (dbgHandle) {
|
|
||||||
typedef Debugger *(_cdecl*GetDebugger)(Module*, Environ*);
|
|
||||||
GetDebugger gd = (GetDebugger)GetProcAddress(dbgHandle, "debuggerGetDebugger");
|
|
||||||
if (gd) debugger = gd(module, v_environ);
|
|
||||||
}
|
|
||||||
if (!debugger) err("Error launching debugger");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!veryquiet) cout << "Executing..." << endl;
|
|
||||||
|
|
||||||
runtimeLib->execute((void(*)())entry, args.c_str(), debugger);
|
|
||||||
|
|
||||||
if (dbgHandle) FreeLibrary(dbgHandle);
|
|
||||||
}
|
|
||||||
|
|
||||||
delete module;
|
|
||||||
delete v_environ;
|
|
||||||
|
|
||||||
closeLibs();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
catch (std::exception& e) {
|
|
||||||
std::cout << "Unexpected exception: " << e.what() << std::endl;
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (...) {
|
|
||||||
std::cout << "Unexpected error." << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user