public void Parse()
        {
            StringtoElementsParser toElementsParser = new StringtoElementsParser(text);
            toElementsParser.Parse();

            ElementsToLayersParser toLayersParser = new ElementsToLayersParser(toElementsParser.Elements);
            toLayersParser.Parse();

            topLayer = toLayersParser.TopLayer;
        }
Ejemplo n.º 2
0
 public static Equation FromString(string s)
 {
     StringtoElementsParser elementsParser = new StringtoElementsParser(s);
     elementsParser.Parse();
     return Equation.FromElements(elementsParser.Elements);
 }
Ejemplo n.º 3
0
        public void Modify(string modification)
        {
            StringtoElementsParser stringParser = new StringtoElementsParser(modification);
            stringParser.Parse();
            List<IElement> elements = stringParser.Elements;
            IElement operation = elements[0];
            elements.RemoveAt(0);
            Term term = Term.FromElements(elements);

            if (operation is PlusElement) Add(term);
            if (operation is MinusElement) Subtract(term);
            if (operation is MultiplyElement) Multiply(term);
            if (operation is DivideElement) Divide(term);
        }