Skip to content

Commit

Permalink
View history
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando committed May 3, 2022
1 parent 95f800c commit 67fb863
Show file tree
Hide file tree
Showing 74 changed files with 66 additions and 8 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.vs
bin
obj
debug
*.ini
Expand All @@ -15,6 +14,3 @@ debug
*.dia~
*.props
Debug
Docs/Generated
old
output
32 changes: 32 additions & 0 deletions PTMC/Compiler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PTMC
{
public class Compiler
{
public bool Success { get; private set; } = false;

public void Run(string ptmlSourceFile)
{
string outputFolder = Environment.CurrentDirectory;
string outputExeFileName = Path.GetFileNameWithoutExtension(ptmlSourceFile) + ".exe";
string outputExePath = Path.Combine(outputFolder, outputExeFileName);

var psi = new ProcessStartInfo(Environment.CurrentDirectory + "\\mingw\\bin\\gcc");
psi.UseShellExecute = false;
psi.EnvironmentVariables["PATH"] = Environment.CurrentDirectory + "\\mingw\\bin";
psi.Arguments = $"-static-libgcc api.c main.c -o \"{outputExePath}\" -lmingw32 -lSDL2main -lSDL2 -mwindows";
Process.Start(psi);

string sdlFilePath = Path.Combine(outputFolder, "SDL2.dll");
if (!File.Exists(sdlFilePath))
File.Copy("SDL2.dll", sdlFilePath);
}
}
}
10 changes: 6 additions & 4 deletions PTMC/EntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ public class EntryPoint
{
public static void Main(string[] args)
{
var file = File.ReadAllLines("test.ptml");
string ptmlSourceFile = "test.ptml";

foreach (var line in file)
{
}
var transpiler = new Transpiler();
transpiler.Run(ptmlSourceFile);

var compiler = new Compiler();
compiler.Run(ptmlSourceFile);
}
}
}
5 changes: 5 additions & 0 deletions PTMC/PTMC.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="Compiler.cs" />
<Compile Include="EntryPoint.cs" />
<Compile Include="Transpiler.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
Expand Down
23 changes: 23 additions & 0 deletions PTMC/Transpiler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PTMC
{
public class Transpiler
{
public bool Success { get; private set; } = false;

public void Run(string ptmlSourceFile)
{
var file = File.ReadAllLines(ptmlSourceFile);

foreach (var line in file)
{
}
}
}
}
Binary file added mingw/bin/SDL2.dll
Binary file not shown.
Binary file added mingw/bin/addr2line.exe
Binary file not shown.
Binary file added mingw/bin/ar.exe
Binary file not shown.
Binary file added mingw/bin/as.exe
Binary file not shown.
Binary file added mingw/bin/c++.exe
Binary file not shown.
Binary file added mingw/bin/c++filt.exe
Binary file not shown.
Binary file added mingw/bin/cpp.exe
Binary file not shown.
Binary file added mingw/bin/dlltool.exe
Binary file not shown.
Binary file added mingw/bin/dllwrap.exe
Binary file not shown.
Binary file added mingw/bin/elfedit.exe
Binary file not shown.
Binary file added mingw/bin/g++.exe
Binary file not shown.
Binary file added mingw/bin/gcc-ar.exe
Binary file not shown.
Binary file added mingw/bin/gcc-nm.exe
Binary file not shown.
Binary file added mingw/bin/gcc-ranlib.exe
Binary file not shown.
Binary file added mingw/bin/gcc.exe
Binary file not shown.
Binary file added mingw/bin/gcov-dump.exe
Binary file not shown.
Binary file added mingw/bin/gcov-tool.exe
Binary file not shown.
Binary file added mingw/bin/gcov.exe
Binary file not shown.
Binary file added mingw/bin/gdb.exe
Binary file not shown.
Binary file added mingw/bin/gdbserver.exe
Binary file not shown.
Binary file added mingw/bin/gprof.exe
Binary file not shown.
Binary file added mingw/bin/ld.bfd.exe
Binary file not shown.
Binary file added mingw/bin/ld.exe
Binary file not shown.
Binary file added mingw/bin/libatomic-1.dll
Binary file not shown.
Binary file added mingw/bin/libgcc_s_dw2-1.dll
Binary file not shown.
Binary file added mingw/bin/libgmp-10.dll
Binary file not shown.
Binary file added mingw/bin/libgomp-1.dll
Binary file not shown.
Binary file added mingw/bin/libiconv-2.dll
Binary file not shown.
Binary file added mingw/bin/libintl-8.dll
Binary file not shown.
Binary file added mingw/bin/libisl-15.dll
Binary file not shown.
Binary file added mingw/bin/libmpc-3.dll
Binary file not shown.
Binary file added mingw/bin/libmpfr-4.dll
Binary file not shown.
Binary file added mingw/bin/libquadmath-0.dll
Binary file not shown.
Binary file added mingw/bin/libssp-0.dll
Binary file not shown.
Binary file added mingw/bin/libstdc++-6.dll
Binary file not shown.
Binary file added mingw/bin/mingw-get.exe
Binary file not shown.
Binary file added mingw/bin/mingw32-c++.exe
Binary file not shown.
Binary file added mingw/bin/mingw32-g++.exe
Binary file not shown.
Binary file added mingw/bin/mingw32-gcc-8.2.0.exe
Binary file not shown.
Binary file added mingw/bin/mingw32-gcc-ar.exe
Binary file not shown.
Binary file added mingw/bin/mingw32-gcc-nm.exe
Binary file not shown.
Binary file added mingw/bin/mingw32-gcc-ranlib.exe
Binary file not shown.
Binary file added mingw/bin/mingw32-gcc.exe
Binary file not shown.
Binary file added mingw/bin/mingw32-make.exe
Binary file not shown.
Binary file added mingw/bin/mingwm10.dll
Binary file not shown.
Binary file added mingw/bin/nm.exe
Binary file not shown.
Binary file added mingw/bin/objcopy.exe
Binary file not shown.
Binary file added mingw/bin/objdump.exe
Binary file not shown.
Binary file added mingw/bin/ranlib.exe
Binary file not shown.
Binary file added mingw/bin/readelf.exe
Binary file not shown.
Binary file added mingw/bin/size.exe
Binary file not shown.
Binary file added mingw/bin/strings.exe
Binary file not shown.
Binary file added mingw/bin/strip.exe
Binary file not shown.
Binary file added mingw/bin/windmc.exe
Binary file not shown.
Binary file added mingw/bin/windres.exe
Binary file not shown.
Binary file added mingw/bin/zlib1.dll
Binary file not shown.
Binary file added mingw/mingw32/bin/ar.exe
Binary file not shown.
Binary file added mingw/mingw32/bin/as.exe
Binary file not shown.
Binary file added mingw/mingw32/bin/dlltool.exe
Binary file not shown.
Binary file added mingw/mingw32/bin/ld.bfd.exe
Binary file not shown.
Binary file added mingw/mingw32/bin/ld.exe
Binary file not shown.
Binary file added mingw/mingw32/bin/nm.exe
Binary file not shown.
Binary file added mingw/mingw32/bin/objcopy.exe
Binary file not shown.
Binary file added mingw/mingw32/bin/objdump.exe
Binary file not shown.
Binary file added mingw/mingw32/bin/ranlib.exe
Binary file not shown.
Binary file added mingw/mingw32/bin/readelf.exe
Binary file not shown.
Binary file added mingw/mingw32/bin/strip.exe
Binary file not shown.
Binary file modified ptmc.exe
Binary file not shown.
Binary file added test.exe
Binary file not shown.

0 comments on commit 67fb863

Please sign in to comment.