You are viewing our Forum Archives. To view or take place in current topics click here.
PPC2C Version 2 By XeClutch [Compiled]
Posted:

PPC2C Version 2 By XeClutch [Compiled]Posted:

Teh1337Online_
  • New Member
Status: Offline
Joined: Mar 15, 20186Year Member
Posts: 10
Reputation Power: 2
Status: Offline
Joined: Mar 15, 20186Year Member
Posts: 10
Reputation Power: 2
Hello, I have decided to Compile the source provided by XeClutch and Compile it considering the compiled version is not public as it was taken down, and no one knew how to compile the source. So all credits given to XeClutch.

[ Register or Signin to view external links. ]

Download: [ Register or Signin to view external links. ]

Virus Scan: [ Register or Signin to view external links. ]


Supported Instructions:


add
addi
addis
and
andi
andis
beq
bgt
bl
blr
blt
bne
divw
eqv
lbz
lbzu
lhz
lhzu
li
lis
lwz
lwzu
mfcr
mulli
mullw
mr
or
ori
oris
slw
slwi
srw
srwi
stb
stbu
sth
sthu
stw
stwu
subf
subi
xor
xori
xoris



Source:


//XeClutchs PPC2C Compiled by Teh1337Online
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using SyntaxHighlighter;
using System.IO;
using System.Linq;

namespace SyntaxHighlighter
{
    public partial class Form1 : Form
    {
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
        private string ProcessInstruction(string instruction)
        {
            string str = "";
            #region PPC:add
            if (instruction.StartsWith("add "))
            {
                instruction = instruction.Replace("add ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = {1} + {2};", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} += {1};", operands[1], operands[2]);
            }
            #endregion
            #region PPC:addi
            else if (instruction.StartsWith("addi "))
            {
                instruction = instruction.Replace("addi ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = {1} + {2};", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} += {1};", operands[1], operands[2]);
            }
            #endregion
            #region PPC:and
            else if (instruction.StartsWith("and "))
            {
                instruction = instruction.Replace("and ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = {1} & {2};", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} &= {1};", operands[1], operands[2]);
            }
            #endregion
            #region PPC:andi
            else if (instruction.StartsWith("andi "))
            {
                instruction = instruction.Replace("andi ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = {1} & {2};", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} &= {1};", operands[1], operands[2]);
            }
            #endregion
            #region PPC:andis
            else if (instruction.StartsWith("andis "))
            {
                instruction = instruction.Replace("andis ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = ({1} & {2}) << 16;", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} &= {1} << 16;", operands[1], operands[2]);
            }
            #endregion
            #region PPC:beq
            else if (instruction.StartsWith("beq "))
            {
                instruction = instruction.Replace("beq ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("if ({0} == 4) {1};", operands[0], operands[1].StartsWith("sub") ? (operands[1] + "()") : ("goto " + operands[1]));
            }
            #endregion
            #region PPC:bgt
            else if (instruction.StartsWith("bgt "))
            {
                instruction = instruction.Replace("bgt ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("if ({0} == 2) {1};", operands[0], operands[1].StartsWith("sub") ? (operands[1] + "()") : ("goto " + operands[1]));
            }
            #endregion
            #region PPC:bl
            else if (instruction.StartsWith("bl "))
            {
                instruction = instruction.Replace("bl ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("{0};", operands[0].StartsWith("sub") ? (operands[0] + "()") : ("goto " + operands[0]));
            }
            #endregion
            #region PPC:blr
            else if (instruction.StartsWith("blr "))
                str = "return;";
            #endregion
            #region PPC:blt
            else if (instruction.StartsWith("blt "))
            {
                instruction = instruction.Replace("blt ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("if ({0} == 1) {1};", operands[0], operands[1].StartsWith("sub") ? (operands[1] + "()") : ("goto " + operands[1]));
            }
            #endregion
            #region PPC:bne
            else if (instruction.StartsWith("bne "))
            {
                instruction = instruction.Replace("bne ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("if ({0} != 4) {1};", operands[0], operands[1].StartsWith("sub") ? (operands[1] + "()") : ("goto " + operands[1]));
            }
            #endregion
            #region PPC:divw
            else if (instruction.StartsWith("divw "))
            {
                instruction = instruction.Replace("divw ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = {1} / {2};", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} /= {1};", operands[1], operands[2]);
            }
            #endregion
            #region PPC:eqv
            else if (instruction.StartsWith("eqv "))
            {
                instruction = instruction.Replace("eqv ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = {1} ^ {2};", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} ^= {1};", operands[1], operands[2]);
            }
            #endregion
            #region PPC:lbz
            else if (instruction.StartsWith("lbz "))
            {
                instruction = instruction.Replace("lbz ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("{0} = *(byte*)({1} + {2});", operands[0], operands[1].Split("(".ToCharArray())[0], operands[1].Split("(".ToCharArray())[1].Replace(")", ""));
            }
            #endregion
            #region PPC:lbzu
            else if (instruction.StartsWith("lbzu "))
            {
                instruction = instruction.Replace("lbzu ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("{0} = *(byte*)({1} = ({2} + {3}));", operands[0], operands[1].Split("(".ToCharArray())[0], operands[1].Split("(".ToCharArray())[0], operands[1].Split("(".ToCharArray())[1].Replace(")", ""));
            }
            #endregion
            #region PPC:lhz
            else if (instruction.StartsWith("lhz "))
            {
                instruction = instruction.Replace("lhz ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("{0} = *(word*)({1} + {2});", operands[0], operands[1].Split("(".ToCharArray())[0], operands[1].Split("(".ToCharArray())[1].Replace(")", ""));
            }
            #endregion
            #region PPC:lhzu
            else if (instruction.StartsWith("lhzu "))
            {
                instruction = instruction.Replace("lhzu ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("{0} = *(word*)({1} = ({2} + {3}));", operands[0], operands[1].Split("(".ToCharArray())[0], operands[1].Split("(".ToCharArray())[0], operands[1].Split("(".ToCharArray())[1].Replace(")", ""));
            }
            #endregion
            #region PPC:li
            else if (instruction.StartsWith("li "))
            {
                instruction = instruction.Replace("li ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("{0} = {1};", operands[0], operands[1]);
            }
            #endregion
            #region PPC:lis
            else if (instruction.StartsWith("lis "))
            {
                instruction = instruction.Replace("lis ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("{0} = {1} << 16;", operands[0], operands[1]);
            }
            #endregion
            #region PPC:lwz
            else if (instruction.StartsWith("lwz "))
            {
                instruction = instruction.Replace("lwz ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("{0} = *(dword*)({1} + {2});", operands[0], operands[1].Split("(".ToCharArray())[0], operands[1].Split("(".ToCharArray())[1].Replace(")", ""));
            }
            #endregion
            #region PPC:lwzu
            else if (instruction.StartsWith("lwzu "))
            {
                instruction = instruction.Replace("lwzu ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("{0} = *(dword*)({1} = ({2} + {3}));", operands[0], operands[1].Split("(".ToCharArray())[0], operands[1].Split("(".ToCharArray())[0], operands[1].Split("(".ToCharArray())[1].Replace(")", ""));
            }
            #endregion
            #region PPC:mfcr
            else if (instruction.StartsWith("mfcr "))
            {
                instruction = instruction.Replace("mfcr ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("{0} = CR;", operands[0]);
            }
            #endregion
            #region PPC:mr
            else if (instruction.StartsWith("mr "))
            {
                instruction = instruction.Replace("mr ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("{0} = {1};", operands[0], operands[1]);
            }
            #endregion
            #region PPC:mulli
            else if (instruction.StartsWith("mulli "))
            {
                instruction = instruction.Replace("mulli ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = {1} * {2};", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} *= {1};", operands[1], operands[2]);
            }
            #endregion
            #region PPC:mullw
            else if (instruction.StartsWith("mullw "))
            {
                instruction = instruction.Replace("mullw ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = {1} * {2};", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} *= {1};", operands[1], operands[2]);
            }
            #endregion
            #region PPC:or
            else if (instruction.StartsWith("or "))
            {
                instruction = instruction.Replace("or ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = {1} | {2};", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} |= {1};", operands[1], operands[2]);
            }
            #endregion
            #region PPC:ori
            else if (instruction.StartsWith("ori "))
            {
                instruction = instruction.Replace("ori ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = {1} | {2};", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} |= {1};", operands[1], operands[2]);
            }
            #endregion
            #region PPC:oris
            else if (instruction.StartsWith("oris "))
            {
                instruction = instruction.Replace("oris ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = ({1} | {2}) << 16;", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} |= {1} << 16;", operands[1], operands[2]);
            }
            #endregion
            #region PPC:slw
            else if (instruction.StartsWith("slw "))
            {
                instruction = instruction.Replace("slw ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = {1} << {2}", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} <<= {1}", operands[1], operands[2]);
            }
            #endregion
            #region PPC:slwi
            else if (instruction.StartsWith("slwi "))
            {
                instruction = instruction.Replace("slwi ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = {1} << {2}", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} <<= {1}", operands[1], operands[2]);
            }
            #endregion
            #region PPC:srw
            else if (instruction.StartsWith("srw "))
            {
                instruction = instruction.Replace("srw ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = {1} >> {2}", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} >>= {1}", operands[1], operands[2]);
            }
            #endregion
            #region PPC:srwi
            else if (instruction.StartsWith("srwi "))
            {
                instruction = instruction.Replace("srwi ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = {1} >> {2}", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} >>= {1}", operands[1], operands[2]);
            }
            #endregion
            #region PPC:stb
            else if (instruction.StartsWith("stb "))
            {
                instruction = instruction.Replace("stb ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("*(byte*)({0} + {1}) = (byte){2};", operands[1].Split("(".ToCharArray())[0], operands[1].Split("(".ToCharArray())[1].Replace(")", ""), operands[0]);
            }
            #endregion
            #region PPC:stbu
            else if (instruction.StartsWith("stbu "))
            {
                instruction = instruction.Replace("stbu ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("*(byte*)({0} = ({1} + {2})) = (byte){3};", operands[1].Split("(".ToCharArray())[0], operands[1].Split("(".ToCharArray())[0], operands[1].Split("(".ToCharArray())[1].Replace(")", ""), operands[0]);
            }
            #endregion
            #region PPC:sth
            else if (instruction.StartsWith("sth "))
            {
                instruction = instruction.Replace("sth ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("*(word*)({0} + {1}) = (word){2};", operands[1].Split("(".ToCharArray())[0], operands[1].Split("(".ToCharArray())[1].Replace(")", ""), operands[0]);
            }
            #endregion
            #region PPC:sthu
            else if (instruction.StartsWith("sthu "))
            {
                instruction = instruction.Replace("sthu ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("*(byte*)({0} = ({1} + {2})) = (byte){3};", operands[1].Split("(".ToCharArray())[0], operands[1].Split("(".ToCharArray())[0], operands[1].Split("(".ToCharArray())[1].Replace(")", ""), operands[0]);
            }
            #endregion
            #region PPC:stw
            else if (instruction.StartsWith("stw "))
            {
                instruction = instruction.Replace("stw ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("*(dword*)({0} + {1}) = (dword){2};", operands[1].Split("(".ToCharArray())[0], operands[1].Split("(".ToCharArray())[1].Replace(")", ""), operands[0]);
            }
            #endregion
            #region PPC:stwu
            else if (instruction.StartsWith("stwu "))
            {
                instruction = instruction.Replace("stwu ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                str = string.Format("*(byte*)({0} = ({1} + {2})) = (byte){3};", operands[1].Split("(".ToCharArray())[0], operands[1].Split("(".ToCharArray())[0], operands[1].Split("(".ToCharArray())[1].Replace(")", ""), operands[0]);
            }
            #endregion
            #region PPC:subf
            else if (instruction.StartsWith("subf "))
            {
                instruction = instruction.Replace("subf ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = {1} - {2};", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} -= {1};", operands[1], operands[2]);
            }
            #endregion
            #region PPC:subi
            else if (instruction.StartsWith("subi "))
            {
                instruction = instruction.Replace("subi ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = {1} - {2};", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} -= {1};", operands[1], operands[2]);
            }
            #endregion
            #region PPC:xor
            else if (instruction.StartsWith("xor "))
            {
                instruction = instruction.Replace("xor ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = {1} ^ {2};", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} ^= {1};", operands[1], operands[2]);
            }
            #endregion
            #region PPC:xori
            else if (instruction.StartsWith("xori "))
            {
                instruction = instruction.Replace("xori ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = {1} ^ {2};", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} ^= {1};", operands[1], operands[2]);
            }
            #endregion
            #region PPC:xoris
            else if (instruction.StartsWith("xoris "))
            {
                instruction = instruction.Replace("xoris ", "");
                string[] operands = instruction.Replace(" ", "").Split(",".ToCharArray());
                if (operands[0] != operands[1])
                    str = string.Format("{0} = ({1} ^ {2}) << 16;", operands[0], operands[1], operands[2]);
                else
                    str = string.Format("{0} ^= {1} << 16;", operands[1], operands[2]);
            }
            #endregion
            #region PPC:?
            else if (instruction != "")
                str = "//" + instruction.Replace("#", "");
            #endregion
            #region PPC:#
            str = str.Replace("#", "//");
            #endregion
            return str + "\n";
        }
        public Form1()
        {
            InitializeComponent();
            /// Format PPC code box
            // Comments
            syntaxRichTextBox1.Settings.Comment = "#";
            syntaxRichTextBox1.Settings.CommentColor = Color.Green;
            syntaxRichTextBox1.Settings.EnableComments = true;
            // Integers
            syntaxRichTextBox1.Settings.IntegerColor = Color.Orange;
            syntaxRichTextBox1.Settings.EnableIntegers = true;
            // Strings
            syntaxRichTextBox1.Settings.StringColor = Color.Red;
            syntaxRichTextBox1.Settings.EnableStrings = true;
            // Keywords
            syntaxRichTextBox1.Settings.Keywords.Add("add");
            syntaxRichTextBox1.Settings.Keywords.Add("addi");
            syntaxRichTextBox1.Settings.Keywords.Add("addis");
            syntaxRichTextBox1.Settings.Keywords.Add("and");
            syntaxRichTextBox1.Settings.Keywords.Add("andi");
            syntaxRichTextBox1.Settings.Keywords.Add("andis");
            syntaxRichTextBox1.Settings.Keywords.Add("beq");
            syntaxRichTextBox1.Settings.Keywords.Add("bgt");
            syntaxRichTextBox1.Settings.Keywords.Add("bl");
            syntaxRichTextBox1.Settings.Keywords.Add("blr");
            syntaxRichTextBox1.Settings.Keywords.Add("blt");
            syntaxRichTextBox1.Settings.Keywords.Add("bne");
            syntaxRichTextBox1.Settings.Keywords.Add("divw");
            syntaxRichTextBox1.Settings.Keywords.Add("eqv");
            syntaxRichTextBox1.Settings.Keywords.Add("lbz");
            syntaxRichTextBox1.Settings.Keywords.Add("lbzu");
            syntaxRichTextBox1.Settings.Keywords.Add("lhz");
            syntaxRichTextBox1.Settings.Keywords.Add("lhzu");
            syntaxRichTextBox1.Settings.Keywords.Add("li");
            syntaxRichTextBox1.Settings.Keywords.Add("lis");
            syntaxRichTextBox1.Settings.Keywords.Add("lwz");
            syntaxRichTextBox1.Settings.Keywords.Add("lwzu");
            syntaxRichTextBox1.Settings.Keywords.Add("mfcr");
            syntaxRichTextBox1.Settings.Keywords.Add("mulli");
            syntaxRichTextBox1.Settings.Keywords.Add("mullw");
            syntaxRichTextBox1.Settings.Keywords.Add("mr");
            syntaxRichTextBox1.Settings.Keywords.Add("or");
            syntaxRichTextBox1.Settings.Keywords.Add("ori");
            syntaxRichTextBox1.Settings.Keywords.Add("oris");
            syntaxRichTextBox1.Settings.Keywords.Add("slw");
            syntaxRichTextBox1.Settings.Keywords.Add("slwi");
            syntaxRichTextBox1.Settings.Keywords.Add("srw");
            syntaxRichTextBox1.Settings.Keywords.Add("srwi");
            syntaxRichTextBox1.Settings.Keywords.Add("stb");
            syntaxRichTextBox1.Settings.Keywords.Add("stbu");
            syntaxRichTextBox1.Settings.Keywords.Add("sth");
            syntaxRichTextBox1.Settings.Keywords.Add("sthu");
            syntaxRichTextBox1.Settings.Keywords.Add("stw");
            syntaxRichTextBox1.Settings.Keywords.Add("stwu");
            syntaxRichTextBox1.Settings.Keywords.Add("subf");
            syntaxRichTextBox1.Settings.Keywords.Add("subi");
            syntaxRichTextBox1.Settings.Keywords.Add("xor");
            syntaxRichTextBox1.Settings.Keywords.Add("xori");
            syntaxRichTextBox1.Settings.Keywords.Add("xoris");
            syntaxRichTextBox1.Settings.KeywordColor = Color.Blue;
            syntaxRichTextBox1.CompileKeywords();

            /// Format C code box
            // Comments
            syntaxRichTextBox2.Settings.Comment = "//";
            syntaxRichTextBox2.Settings.CommentColor = Color.Green;
            syntaxRichTextBox2.Settings.EnableComments = true;
            // Integers
            syntaxRichTextBox2.Settings.IntegerColor = Color.Orange;
            syntaxRichTextBox2.Settings.EnableIntegers = true;
            // Strings
            syntaxRichTextBox2.Settings.StringColor = Color.Red;
            syntaxRichTextBox2.Settings.EnableStrings = true;
            // Keywords
            syntaxRichTextBox2.Settings.Keywords.Add("byte");
            syntaxRichTextBox2.Settings.Keywords.Add("dword");
            syntaxRichTextBox2.Settings.Keywords.Add("if");
            syntaxRichTextBox2.Settings.Keywords.Add("goto");
            syntaxRichTextBox2.Settings.Keywords.Add("word");
            syntaxRichTextBox2.Settings.Keywords.Add(">>");
            syntaxRichTextBox2.Settings.Keywords.Add("<<");
            syntaxRichTextBox2.Settings.Keywords.Add("=");
            syntaxRichTextBox2.Settings.Keywords.Add("|");
            syntaxRichTextBox2.Settings.Keywords.Add("&");
            syntaxRichTextBox2.Settings.Keywords.Add("!");
            syntaxRichTextBox2.Settings.Keywords.Add("^");
            syntaxRichTextBox2.Settings.Keywords.Add("~");
            syntaxRichTextBox2.Settings.KeywordColor = Color.Blue;
            syntaxRichTextBox2.CompileKeywords();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (syntaxRichTextBox1.Text == "")
                return;
            syntaxRichTextBox2.Text = "// Converted using PPC2C2 by XeClutch\n";
            string[] lines = syntaxRichTextBox1.Text.Split("\n".ToCharArray());

            foreach (string line in lines)
                syntaxRichTextBox2.Text += ProcessInstruction(line);
            syntaxRichTextBox2.Text = syntaxRichTextBox2.Text.TrimEnd("\n".ToCharArray());
            syntaxRichTextBox1.ProcessAllLines();
            syntaxRichTextBox2.ProcessAllLines();
        }

        private void syntaxRichTextBox1_TextChanged(object sender, EventArgs e)
        {
            syntaxRichTextBox1.ProcessAllLines();
        }

        private void syntaxRichTextBox2_TextChanged(object sender, EventArgs e)
        {
            syntaxRichTextBox2.ProcessAllLines();
        }

     
    }
}


The following 1 user thanked Teh1337Online_ for this useful post:

Moon1337 (05-03-2018)
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.