anchor.diff:  
   // extends PN_LOCAL to allow curly brackets, and force at least one (opening) curly bracket
   PN_LOCAL_EXT
  -  : '{' RIGHT_PART_TAIL_EXT + | RIGHT_PART_FIRST_CHAR RIGHT_PART_TAIL_EXT_MAND
  +  : '{' ((RIGHT_PART_CHAR | '{' | '}')* (RIGHT_PART_END_CHAR | '}')) +
  +  | (PN_CHARS_U | ':' | '#' | [0-9] | PLX) (RIGHT_PART_CHAR | '{' | '}')* '{' (RIGHT_PART_CHAR | '{' | '}')* (RIGHT_PART_END_CHAR | '}')
     ;
   
   // extends PN_LOCAL in the original grammar to allow '/' and '#'
   // original (PN_CHARS_U | ':' | [0-9] | PLX) ((PN_CHARS | '.' | ':' | PLX)* (PN_CHARS | ':' | PLX))?
   PN_LOCAL
  -  : RIGHT_PART_FIRST_CHAR RIGHT_PART_TAIL?
  +  : (PN_CHARS_U | ':' | '#' | [0-9] | PLX) (RIGHT_PART_CHAR* RIGHT_PART_END_CHAR)?
     ;
   
   PLX // ok
  
positive.code:   : '\\' ('_' | '~' | '.' | '-' | '!' | '$' | '&' | '\'' | '(' | ')' | '*' | '+' | ',' | ';' | '=' | '/' | '?' | '#' | '@' | '%')
    ;
  
  fragment RIGHT_PART_FIRST_CHAR
    : (PN_CHARS_U | ':' | '#' | [0-9] | PLX)
    ;
  
  fragment RIGHT_PART_FIRST_CHAR_EXT
    : (RIGHT_PART_FIRST_CHAR | '{')
    ;
  
  fragment RIGHT_PART_CHAR
    : (PN_CHARS | '.' | ':' | '/' | '#' | ';' | PLX)
    ;
  
  fragment RIGHT_PART_CHAR_EXT
    : (RIGHT_PART_CHAR | '{' | '}')
    ;
  
  fragment RIGHT_PART_END_CHAR
    : (PN_CHARS | ':' | '/'| PLX)
    ;
  
  fragment RIGHT_PART_END_CHAR_EXT
    : (RIGHT_PART_END_CHAR | '}')
    ;
  
  fragment RIGHT_PART_TAIL
    : RIGHT_PART_CHAR* RIGHT_PART_END_CHAR
    ;
  
  fragment RIGHT_PART_TAIL_EXT
    : RIGHT_PART_CHAR_EXT* RIGHT_PART_END_CHAR_EXT
    ;
  
  fragment RIGHT_PART_TAIL_EXT_MAND
    : RIGHT_PART_CHAR_EXT* '{' RIGHT_PART_CHAR_EXT* RIGHT_PART_END_CHAR_EXT
    ;
  
  fragment IRIREF_INNER_CHAR
    :  (PN_CHARS | '"' | '.' | ':' | '/' | '\\' | '#' | '@' | '%' | '&' | ';' | UCHAR)
    ;
  
negative.code:   : '_:'  PN_LOCAL_EXT
    ;
  
  // The characters _ and digits may appear anywhere in a blank node label.
  // The character . may appear anywhere except the first or last character.
  // The characters -, U+00B7, U+0300 to U+036F and U+203F to U+2040 are permitted anywhere except the first character.
  BLANK_NODE_LABEL // ok
    : '_:' (PN_CHARS_U | [0-9]) ((PN_CHARS | '.')* PN_CHARS)?
    ;
  
  /* LANGTAG */
  