Example #1
0
 public Elemento(Sinal sinal, char variavel, int potencia)
 {
     Sinal = sinal;
     this.potencia = new Elemento();
     this.potencia.Numero = potencia;
     Numero = NULL_NUMERO;
     Variavel = variavel;
 }
Example #2
0
 public Elemento(Sinal sinal, int numero, int potencia)
 {
     Sinal = sinal;
     this.potencia = new Elemento();
     this.potencia.Numero = potencia;
     Numero = numero;
     Variavel = NULL_VARIAVEL;
 }
 //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
 //ORIGINAL LINE: private void acao40(Token token) throws Exception
 private void acao40(Token token)
 {
     Elemento elemento = (Elemento) pilha.Peek();
     Elemento elementoPotencia = new Elemento();
     elemento.Potencia = elementoPotencia;
     pilha.Push(elementoPotencia);
 }
 private void acao20(Token token)
 {
     Termo termo = (Termo) this.pilha.Peek();
     Elemento elemento = new Elemento();
     termo.addElementos(elemento);
     this.pilha.Push(elemento);
 }
Example #5
0
 public virtual void addElementos(Elemento elemento)
 {
     ultimoElemento = elemento;
     elemento.Origem = this;
     this.elementos.Add(elemento);
 }
Example #6
0
        private void substituir(Elemento elementoSubstituido, List<Elemento> elementosSubstituidores)
        {
            int indexElementoSubstituido = this.elementos.IndexOf(elementoSubstituido);
            this.elementos.RemoveAt(indexElementoSubstituido);

            foreach (Elemento elementoSubstituidor in elementosSubstituidores)
            {
                Sinal novoSinal = elementoSubstituidor.Sinal.multiplicar(elementoSubstituido.Sinal);
                elementoSubstituidor.Sinal = novoSinal;
                elementoSubstituidor.Origem = this;
                this.elementos.Insert(indexElementoSubstituido++, elementoSubstituidor);
            }
        }