anchor.diff:    /// The priority of this token type.
     final int priority;
   
  +  /// Associativity of this token type. true = left.
  +  final bool leftAssociative;
  +  
  +  /// True, if this token is an operator.
  +  final bool operator;
  +  
  +  /// True, if this token is a function.
  +  final bool function;
  +  
     /**
      * Internal constructor for a [TokenType].
      * To retrieve a token type, directly access the static final fields
      * provided by this class.
      */
  -  const TokenType._internal(String this.value, int this.priority);
  +  const TokenType._internal(String this.value, int this.priority,
  +      {bool this.leftAssociative: true, bool this.operator: false, bool this.function: false});
   
     String toString() {
       return value;
  
positive.code:        * stream until you find an operator with a priority lower or equal as the current tokens.
         * Then add the current Token to the operator buffer.
         */
        if(tempToken.type.priority < operatorBuffer.last.type.priority) {
          while(operatorBuffer.length > 0 && operatorBuffer.last.type.priority > tempToken.type.priority) {
            outputStream.add(operatorBuffer.last);
            operatorBuffer.removeLast();
          }
          operatorBuffer.add(tempToken);
          continue;
        } else {
          operatorBuffer.add(tempToken);
          continue;
        }
      }
      
      /*
       * When the algorithm reaches the end of the input stream, we add the
       * tokens in the operatorBuffer to the outputStream.
       */
      while(!operatorBuffer.isEmpty) {
        outputStream.add(operatorBuffer.last);
        operatorBuffer.removeLast();
      }
  
      return outputStream;
  
negative.code:   Parser(): lex = new Lexer();
  
    /**
     * Parses the given input string into an [Expression]. Throws a [ArgumentError]
     * if the given [inputString] is empty. Throws a [StateError]if the token stream
     * is invalid. Returns a valid [Expression].
     */
    Expression parse(String inputString) {
      if (inputString == null || inputString.trim().isEmpty) {
        throw new ArgumentError("The given input string was empty.");
      }
      
      List<Expression> exprStack = new List<Expression>();
      List<Token> inputStream = lex.tokenizeToRPN(inputString);
  
      for (Token currToken in inputStream){
        Expression currExpr, left, right;
  
        switch(currToken.type) {
          case TokenType.VAL: 
            currExpr = new Number(double.parse(currToken.text));
            break;
          case TokenType.VAR:
            currExpr = new Variable(currToken.text);
            break;
          case TokenType.UNMINUS:
            currExpr = -exprStack.removeLast();
            break;
          case TokenType.PLUS:
            right = exprStack.removeLast();
            left = exprStack.removeLast();
            currExpr = left + right;
            break;
          case TokenType.MINUS:
            right = exprStack.removeLast();
            left = exprStack.removeLast();
            currExpr = left - right;
            break;
          case TokenType.TIMES:
            right = exprStack.removeLast();
            left = exprStack.removeLast();
            currExpr = left * right;
            break;
          case TokenType.DIV:
            right = exprStack.removeLast();
            left = exprStack.removeLast();
            currExpr = left / right;
            break;
          case TokenType.POW:
            right = exprStack.removeLast();
            left = exprStack.removeLast();
            currExpr = left ^ right;
            break;
          case TokenType.EFUNC:
            currExpr = new Exponential(exprStack.removeLast());
            break;
          case TokenType.LOG:
            right = exprStack.removeLast();
            left = exprStack.removeLast();
            currExpr = new Log(left, right);
            break;
          case TokenType.LN:
            currExpr = new Ln(exprStack.removeLast());
            break;
          case TokenType.SQRT:
            currExpr = new Sqrt(exprStack.removeLast());
            break;
          case TokenType.ROOT:
            right = exprStack.removeLast();
            left = exprStack.removeLast();
            currExpr = new Root.fromExpr((left as Number), right);
            break;
          case TokenType.SIN:
            currExpr = new Sin(exprStack.removeLast());
            break;
          case TokenType.COS:
            currExpr = new Cos(exprStack.removeLast());
            break;
          case TokenType.TAN:
            currExpr = new Tan(exprStack.removeLast());
            break;
          default: throw new ArgumentError('Unsupported token: $currToken');
        }
        
        exprStack.add(currExpr);
      }
  
      if(exprStack.length > 1) {
        throw new StateError("The input String is not a correct expression");
      }
  
      return exprStack.last;
    }
  }
  
  