From d05675306912e0f6e8c300dbab7cf9c2bf2aa6c6 Mon Sep 17 00:00:00 2001 From: KevinKor01 Date: Fri, 31 Oct 2025 02:31:33 +0200 Subject: [PATCH] First Push basic rule-set , main bin --- Compiler/Fparser.py | 9 +++++++ Compiler/dataTypes.py | 1 + Compiler/ppc.py | 61 +++++++++++++++++++++++++++++++++++++++++++ PseudoRules.txt | 22 ++++++++++++++++ testFile.pc | 11 ++++++++ 5 files changed, 104 insertions(+) create mode 100644 Compiler/Fparser.py create mode 100644 Compiler/dataTypes.py create mode 100644 Compiler/ppc.py create mode 100644 PseudoRules.txt create mode 100644 testFile.pc diff --git a/Compiler/Fparser.py b/Compiler/Fparser.py new file mode 100644 index 0000000..bf785ca --- /dev/null +++ b/Compiler/Fparser.py @@ -0,0 +1,9 @@ + + + + +def readfile(filepath): + with open(filepath, "r") as file: + lines = file.readlines() + for line in lines: + print(line.strip()) diff --git a/Compiler/dataTypes.py b/Compiler/dataTypes.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Compiler/dataTypes.py @@ -0,0 +1 @@ + diff --git a/Compiler/ppc.py b/Compiler/ppc.py new file mode 100644 index 0000000..1f2c2fe --- /dev/null +++ b/Compiler/ppc.py @@ -0,0 +1,61 @@ +import configparser +import argparse +import Fparser +version = 1.0 + + +parser = argparse.ArgumentParser( + + prog="Pseudo (to) Pseudoglossa Compiler", + epilog="hi", + description="Compiles Pseudo code to psebdoglossa while adding stuff like: Rendering Functions | Math | Libraries | Srtings etc .. " + +) + +parser.add_argument("-d", "--devmode", action='store_true') +parser.add_argument("-f", "--file") +parser.add_argument("-p", "--project") +args = parser.parse_args() + + +print("Pseudo to Pseudoglossa Compiler V" + str(version)) +config = configparser.ConfigParser() +print("=============================================") + + +def checkDeps(): + import Fparser + pass + + + +def compileSingle(file): + Fparser.readfile(file) + + + + + +def runArgs(): + print(str(args.file) , "|" , str(args.project)) + if(str(args.file )!= "None"): + print(f"Single file Project -> {str(args.file)}") + compileSingle(str(args.file)) + elif(str(args.project )!= "None"): + print(f"Using {str(args.project)} as Project folder") + + + + + + + + + + + + + + +checkDeps() +runArgs() diff --git a/PseudoRules.txt b/PseudoRules.txt new file mode 100644 index 0000000..92ff5b7 --- /dev/null +++ b/PseudoRules.txt @@ -0,0 +1,22 @@ +*=================================================================* +| PseudoGlossa - The stupidest waste of time yet? | +| | +| Compiles Pseudo code to psebdoglossa while adding stuff like: | +| Rendering Functions | Math | Libraries | Srtings etc .. idk yet | +| | +*=================================================================* + +Pseudo file tags: + +To mark a file for compilation it must have a file extension of +Code File [.pc] | Denfinition File (header file) [.pd] | Library File [.pl] | Asset File [.pa] + +I think im gonna add a thing that reads the top line and adds other info for the compiler..... + + + + +Pseudo code table: + + + diff --git a/testFile.pc b/testFile.pc new file mode 100644 index 0000000..13bf3cd --- /dev/null +++ b/testFile.pc @@ -0,0 +1,11 @@ + +App adder(){ + + int value1 = 0 + int value2 = 0 + + print("total" + intToString(value1 + value2)) + + + return 0; +}