anchor.diff:                          )*
                           ;
   
  -attribute_kv_attr      returns [ArrayList keyval] :
  +attribute_kv_attr      returns [java.util.ArrayList keyval] :
                           attribute_name_attr '=' attribute_value_attr {
  +                          $keyval = new java.util.ArrayList();
                             $keyval.add($attribute_name_attr.text);
                             $keyval.add($attribute_value_attr.text);
                           }
                           ;
  +
   attribute_name_attr    : TERM_VALUE ('.' TERM_VALUE)* ;
   attribute_value_attr   : QUOTED_VALUE | DIGITS | (DIGITS '.' DIGITS) ;
   
  -attribute: 'X-OCCI-Attribute' ':' attributes_attr ;
  +attribute              returns [java.util.HashMap attrs] :
  +                         'X-OCCI-Attribute' ':'
  +                         attributes_attr{
  +                           $attrs = $attributes_attr.attrs;
  +                         }
  +                         ;
   
   DIGITS        : ('0'..'9')* ;
   QUOTE         : '"' | '\'' ;
  
positive.code:         com.example.drive0.interface="ide0", com.example.drive1.interface="ide1"
  */
  
  link                   : 'Link' ':' link_values;
  link_values            : link_value (',' link_value)*;
  link_value             : target_attr rel_attr self_attr? category_attr? attribute_attr? ;
  
  target_attr            : '<' (TARGET_VALUE) ('?action=' TERM_VALUE)? '>' ;
  
  self_attr              returns [String value] :
                          ';' 'self' '=' QUOTED_VALUE{
  
negative.code:   language = Java;
  }
  
  category               returns [java.util.ArrayList cats] :
                           'Category' ':'
                           category_values{
                             $cats = $category_values.cats;
                           }
                           ;
  
  	category_values      returns [java.util.ArrayList cats] :
  	                       cv1=category_value{
  	                         $cats = new ArrayList();
  	                         $cats.add($cv1.cat);
  	                       }
  	                       (
  	                       ',' cv2=category_value{
  	                             $cats.add($cv2.cat);
  	                           }
  	                       )*
  	                       ;
  
  	category_value       returns [java.util.HashMap cat] :
  	                       term_attr scheme_attr klass_attr title_attr? rel_attr? location_attr? c_attributes_attr? actions_attr?{
  	                         $cat = new java.util.HashMap();
  
  	                         $cat.put("occi.core.term", $term_attr.value);
  	                         $cat.put("occi.core.scheme", $scheme_attr.value);
  	                         $cat.put("occi.core.class", $klass_attr.value);
  
                             if($title_attr.value !=null)
                                $cat.put("occi.core.title", $title_attr.value);
  
                             if($rel_attr.value != null)
                                $cat.put("occi.core.rel", $rel_attr.value);
  
                             if($location_attr.value != null)
                                $cat.put("occi.core.location", $location_attr.value);
  
                             if($c_attributes_attr.value != null)
                                $cat.put("occi.core.attributes", $c_attributes_attr.value);
  
                             if($actions_attr.value != null)
                                $cat.put("occi.core.actions", $actions_attr.value);
  	                       }
                           ;
  
  	term_attr            returns [String value] :
  	                       TERM_VALUE{
  	                         $value = $TERM_VALUE.text;
  	                       }
  	                       ;
  
  	//this value can be passed on to the uri rule in Location for validation
  	scheme_attr          returns [String value] :
  	                       ';' 'scheme' '='
  	                       QUOTED_VALUE{
  	                         $value = $QUOTED_VALUE.text;
  	                       }
  	                       ;
  
  	klass_attr           returns [String value] :
  	                       ';' 'class' '='
  	                       QUOTED_VALUE{
  	                         $value = $QUOTED_VALUE.text;
  	                       }
  	                       ;
  
  	title_attr           returns [String value] :
  	                       ';' 'title' '='
  	                       QUOTED_VALUE{
  	                         $value = $QUOTED_VALUE.text;
  	                       }
  	                       ;
  
  	//this value can be passed on to the uri rule in Location for validation
  	rel_attr             returns [String value] :
  	                     ';' 'rel' '='
  	                     QUOTED_VALUE{
  	                       $value = $QUOTED_VALUE.text;
  	                     }
  	                     ;
  
    //this value can be passed on to the uri rule in Location for validation
  	location_attr        returns [String value] :
  	                       ';' 'location' '='
  	                       TARGET_VALUE{
  	                         $value = $TARGET_VALUE.text;
  	                       }
  	                       ;
  
    //these value once extracted can be passed on to the attributes_attr rule
  	c_attributes_attr    returns [String value] :
  	                       ';' 'attributes' '='
  	                       QUOTED_VALUE{
  	                         $value = $QUOTED_VALUE.text;
  	                       }
  	                       ;
  
  	//this value can be passed on to the uri rule in Location for validation
  	actions_attr         returns [String value] :
  	                       ';' 'actions' '='
  	                       QUOTED_VALUE{
  	                         $value = $QUOTED_VALUE.text;
  	                       }
  	                       ;
  
  /* e.g.
          Link:
  