anchor.diff:  grammar occi_http_text;
   
  +//TODO So the generated lexer and parser are useable by all languages and to not be dependant on embedded target code (e.g. actions)
  +//      the parser should return well-formed json which can be deserialised by most languages.
  +
  +//Caveat! JSON strings are created via concatenation. This is not efficent. If you want more efficency, modify the
  +//        grammar so that it utilises more direct means of in-memory/domain specific model creation.
  +
   options {
  +  //Change me: if you want a different targetted language for the parser/lexer generation
  +  //Values: {ActionScript, C, CPP, CSharp2, CSharp3, Java, Delphi, JavaScript, ObjC, Perl5, Ruby, Python}
     language = Java;
   }
   
   tokens{
  +  //OCCI header names
     CATEGORY_HEADER = 'Category:';
     LINK_HEADER = 'Link:';
     ATTR_HEADER = 'X-OCCI-Attribute:';
     LOCATION_HEADER = 'X-OCCI-Location:';
  +
  +  //Category attribute names
     SCHEME_ATTR = 'scheme';
     CLASS_ATTR = 'class';
     TITLE_ATTR = 'title';
     REL_ATTR = 'rel';
     LOCATION_ATTR = 'location';
     ATTRIBUTES_ATTR = 'attributes';
  +
  +  //Link attribute names
     SELF_ATTR = 'self';
     CAT_ATTR = 'category';
  +
  +  //General tokens
     CAT_ATTR_SEP = ';';
     VAL_ASSIGN = '=';
     QUOTE = '"';
     OPEN_PATH = '<';
     CLOSE_PATH = '>';
  +  COMMA = ',';
   }
   
  +//Change me: @header contains target language specific decls
   @header {
     package be.edmonds.occi;
   }
  +
  +//Change me: @lexer::header contains target language specific decls
   @lexer::header {
     package be.edmonds.occi;
   }
  
positive.code:       attributes="occi.storage.size occi.storage.state";
        actions="http://schemas.ogf.org/occi/infrastructure/storage/action#resize ...";
  */
  //TODO allow for multiple categories per line seperated by ','
  category_header:
    CATEGORY_HEADER category_header_val
  ;
  category_header_val:
    term_attr scheme_attr class_attr (title_attr | rel_attr | location_attr | cat_attributes_attr)*
  ;
  term_attr:
    TOKEN
  ;
  
  scheme_attr:
    CAT_ATTR_SEP SCHEME_ATTR VAL_ASSIGN QUOTE scheme_val QUOTE
  ;
  scheme_val:
    URI
  ;
  
  class_attr:
    CAT_ATTR_SEP CLASS_ATTR VAL_ASSIGN QUOTE class_val QUOTE
  ;
  class_val:
    CLASS
  ;
  
  title_attr:
    CAT_ATTR_SEP TITLE_ATTR VAL_ASSIGN QUOTE title_val QUOTE
  ;
  title_val:
    TOKEN
  ;
  
  rel_attr:
    CAT_ATTR_SEP REL_ATTR VAL_ASSIGN QUOTE rel_val QUOTE
  ;
  rel_val:
    TOKEN
  ;
  
  location_attr:
    CAT_ATTR_SEP LOCATION_ATTR VAL_ASSIGN QUOTE location_val QUOTE
  ;
  location_val:
    TOKEN
  ;
  
  cat_attributes_attr:
    CAT_ATTR_SEP ATTRIBUTES_ATTR VAL_ASSIGN QUOTE attributes_names QUOTE
  ;
  attributes_names:
    attribute_attr_name (attribute_attr_name)*
  ;
  
  // ----------------------------------------
  // -------------- Link Header -------------
  // ----------------------------------------
  
negative.code: // ----------------------------------------
  
  occi_header:
    (
      multiple_category_header
    | category_header
  
    | multiple_link_header
    | link_header
  
    | attribute_header
  
    | location_header
    )+
    EOF
  