anchor.diff:  // --------------------- primitive types -------------------
   
   TERM_CODE_REF : '[' NAME_CHAR+ ( '(' NAME_CHAR+ ')' )? '::' NAME_CHAR+ ']' ;  // e.g. [ICD10AM(1998)::F23]; [ISO_639-1::en]
  -URI : [a-z]+ ':' ( '//' | '/' )? ~[ \t\n]+? ; // just a simple recogniser, the full thing isn't required
  +URI : [a-z]+ ':' ( '//' | '/' )? (~[ \t\n>]+)? ; // just a simple recogniser, the full thing isn't required
   
   INTEGER : DIGIT+ E_SUFFIX? ;
   REAL :    DIGIT+ '.' DIGIT+ E_SUFFIX? ;
   fragment E_SUFFIX : [eE][+-]? DIGIT+ ;
   
   STRING : '"' STRING_CHAR*? '"' ;
  -fragment STRING_CHAR : ~('\\'|["\r\n]) | ESCAPE_SEQ | UTF8CHAR ;
  +fragment STRING_CHAR : ~[\\"] | ESCAPE_SEQ | UTF8CHAR ;
   
   
   CHARACTER : '\'' CHAR '\'' ;
  -fragment CHAR : ~('\\'|['\r\n]) | ESCAPE_SEQ | UTF8CHAR  ;
  +fragment CHAR : ~[\\'\r\n] | ESCAPE_SEQ | UTF8CHAR  ;
   
   fragment ESCAPE_SEQ: '\\' ['"?abfnrtv\\] ;
  -
  -SYM_TRUE : [Tt][Rr][Uu][Ee] ;
  -SYM_FALSE : [Ff][Aa][Ll][Ss][Ee] ;
   
   // ------------------- character fragments ------------------
   
  
positive.code: ARCHETYPE_REF       : ARCHETYPE_HRID_ROOT '.v' INTEGER ( '.' DIGIT+ )* ;
  ARCHETYPE_HRID_ROOT : (NAMESPACE '::')? IDENTIFIER '-' IDENTIFIER '-' IDENTIFIER '.' IDENTIFIER ;
  
  NAMESPACE           : LABEL ('.' LABEL)+ ;
  fragment LABEL      : ALPHA_CHAR ( NAME_CHAR* ALPHANUM_CHAR )? ;
  fragment IDENTIFIER : ALPHA_CHAR WORD_CHAR* ;
  VERSION_ID : DIGIT+ DOT_SEGMENT DOT_SEGMENT (('-rc' | '-alpha') DOT_SEGMENT? )? ;
  
negative.code: 
  SYM_MATCHES : ([Mm][Aa][Tt][Cc][Hh][Ee][Ss] | [Ii][Ss]'_'[Ii][Nn] | '\u2208');
  
  SYM_TRUE : [Tt][Rr][Uu][Ee] ;
  SYM_FALSE : [Ff][Aa][Ll][Ss][Ee] ;
  
  // ---------- whitespace & comments ----------
  
  WS :        [ \t\r]+      -> skip ;
  