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:  * For example, to access the token type PLUS:
   *     plusType = TokenType.PLUS;
   * 
   * Also defines the priority (precedence) of the token.
   *     (+,-) < (*,/) < (^) < functions
   * 
   */
  class TokenType {
    // Variables and values
    static final TokenType VAR = const TokenType._internal("VAR",10);
    static final TokenType VAL = const TokenType._internal("VAL",10);
  
    // Braces
    static final TokenType LBRACE = const TokenType._internal("LBRACE",-1);
    static final TokenType RBRACE = const TokenType._internal("RBRACE",-1);
  
    // Operators
    static final TokenType PLUS = const TokenType._internal("PLUS",1);
    static final TokenType MINUS = const TokenType._internal("MINUS",1);
    static final TokenType TIMES = const TokenType._internal("TIMES",2);
    static final TokenType DIV = const TokenType._internal("DIV",2);
    static final TokenType POW = const TokenType._internal("POW",3);
    static final TokenType UNMINUS = const TokenType._internal("UNMINUS",5);
  
    // Functions
    static final TokenType SQRT = const TokenType._internal("SQRT",4);
    static final TokenType ROOT = const TokenType._internal("ROOT",4);
    static final TokenType LOG = const TokenType._internal("LOG",4);
    static final TokenType LN = const TokenType._internal("LN",4);
    static final TokenType COS = const TokenType._internal("COS",4);
    static final TokenType SIN = const TokenType._internal("SIN",4);
    static final TokenType TAN = const TokenType._internal("TAN",4);
    static final TokenType EFUNC = const TokenType._internal("EFUNC",4);
  
    /// The string value of this token type.
    final String value;
  
negative.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(curToken.type.operator) {
          while(!operatorBuffer.isEmpty && ((curToken.type.leftAssociative && curToken.type.priority <= operatorBuffer.last.type.priority)
              || (!curToken.type.leftAssociative && curToken.type.priority < operatorBuffer.last.type.priority))) {
            outputStream.add(operatorBuffer.removeLast());
          }
          operatorBuffer.add(curToken);
          continue;
        }
        
        // If the current Token is a left brace, put it on the operator buffer.
        if(curToken.type == TokenType.LBRACE) {
          operatorBuffer.add(curToken);
          continue;
        }
  
        // If the current Token is a right brace, empty the operator buffer until you find a left brace.
        if(curToken.type == TokenType.RBRACE) {
          while(!operatorBuffer.isEmpty && operatorBuffer.last.type != TokenType.LBRACE) {
            outputStream.add(operatorBuffer.removeLast());
          }
          
          // Remove left parenthesis
          if(!operatorBuffer.isEmpty && operatorBuffer.last.type == TokenType.LBRACE) {
            operatorBuffer.removeLast();
          } else {
            throw new StateError('Mismatched parenthesis.');
          }
          
          // If the token at the top of the stack is a function token, pop it onto the output queue.
          if (!operatorBuffer.isEmpty && operatorBuffer.last.type.function) {
            outputStream.add(operatorBuffer.removeLast());
          }
        }
      }
      
      /*
       * When the algorithm reaches the end of the input stream, we add the
       * tokens in the operatorBuffer to the outputStream. If the operator
       * on top of the stack is a parenthesis, there are mismatched parenthesis.
       */
      while(!operatorBuffer.isEmpty) {
        if (operatorBuffer.last.type == TokenType.LBRACE ||
            operatorBuffer.last.type == TokenType.RBRACE) {
          throw new StateError('Mismatched parenthesis.');
        }
        outputStream.add(operatorBuffer.removeLast());
      }
  
      return outputStream;
  