I am in desperate need of some help on creating a parser that has to deal with two different classes that will output a complex math problem. I have written all but the parser in which i don't understand how to start, the purpose is to take the real number and an imaginary number out of the input box and then separates the two for the calculations. What I'm dealing with is like complex numbers. The number of the form is a+bi where a and b are rational and a is the real part of the number and b is the imaginary part.

Also the parser will check to make sure that valid objects are entered. Here is the class that is needing the parser
Code:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Rational { class CGauss { private CRational fcrReal; private CRational fcrImg; private bool fbValid; public CGauss() { fbValid = true; } public CGauss(string strCGauss) { Parse(strCGauss); } public override string ToString() { string strGauss; if (!fbValid) strGauss = "NaN"; else { strGauss = fcrReal.ToString() + fcrImg.ToString() + "i"; } return strGauss; } public void Parse(string strCGauss) { bool bSlash = false, bLegal = true, bNeg = false; string strReal = "0/1", strImg = "1/3"; } public static CGauss operator + (CGauss gNum1, CGauss gNum2) { CGauss gSum = new CGauss(); gSum.fcrReal = gNum1.fcrReal + gNum2.fcrReal; gSum.fcrImg = gNum1.fcrImg + gNum2.fcrImg; gSum.fbValid = true; return gSum; } public static CGauss operator - (CGauss gNum1, CGauss gNum2) { CGauss gSum = new CGauss(); gSum.fcrReal = gNum1.fcrReal - gNum2.fcrReal; gSum.fcrImg = gNum1.fcrImg - gNum2.fcrImg; return gSum; } public static CGauss operator * (CGauss gNum1, CGauss gNum2) { CGauss gSum = new CGauss(); gSum.fcrReal = (gNum1.fcrReal * gNum2.fcrReal) - (gNum1.fcrImg * gNum2.fcrImg); gSum.fcrImg = (gNum1.fcrReal * gNum2.fcrImg) + (gNum1.fcrReal + gNum2.fcrReal); return gSum; } public static CGauss operator / (CGauss gNum1, CGauss gNum2) { CGauss gSum = new CGauss(); gSum.fcrReal = (gNum1.fcrReal * gNum2.fcrReal) + (gNum1.fcrImg * gNum2.fcrImg) / (gNum2.fcrReal * gNum2.fcrReal) + (gNum2.fcrImg * gNum2.fcrImg); gSum.fcrImg = (gNum1.fcrImg * gNum2.fcrReal) - (gNum1.fcrReal * gNum2.fcrImg) / (gNum2.fcrReal * gNum2.fcrReal) + (gNum2.fcrImg * gNum2.fcrImg); return gSum; } } }