anchor.diff:   * Contributors:
    *     Blaise Doughan - 2.4 - initial implementation
    ******************************************************************************/
  - 
  +
   grammar JSON;
  +options
  +{
  +        language=Java;
  +        output=AST;
  +}
   
   OBJECT : '{' (PAIR (',' PAIR)*)? '}';
  - 
  -PAIR : WHITE_SPACE STRING WHITE_SPACE ':' WHITE_SPACE VALUE WHITE_SPACE;
   
  -ARRAY : '[' (VALUE (',' VALUE)*)? ']';
  +fragment PAIR : WHITESPACE STRING WHITESPACE ':' WHITESPACE VALUE WHITESPACE;
   
  -VALUE   :       STRING
  -        |       NUMBER
  -        |       OBJECT
  -        |       ARRAY
  -        |       'true'
  -        |       'false'
  -        |       'null'
  -        ;
  +fragment ARRAY : '[' WHITESPACE (VALUE ( WHITESPACE ',' WHITESPACE VALUE)*)? WHITESPACE ']';
   
  -STRING  : '"' CHAR* '"';
  +fragment VALUE : STRING
  +        |        NUMBER
  +        |        OBJECT
  +        |        ARRAY
  +        |        'true'
  +        |        'false'
  +        |        'null';
  +
  +fragment STRING  : '"' CHAR* '"';
   
   fragment CHAR   : ~('"'| '\\')
                   | '\\"'
  
positive.code: 
  fragment EXP : E DIGITS;
  
  fragment DIGITS : '0'..'9'*;
  
  fragment E :('e'|'E') ('+'|'-')?;
  
  fragment WHITE_SPACE    : (' ' | '\r' | '\t' | '\u000C' | '\n')*;
negative.code:                 | '\\f'
                  | '\\n'
                  | '\\r'
                  | '\\t'
                  | '\\u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT;
  
  fragment HEX_DIGIT : ('0'..'9'|'a'..'f'|'A'..'F');
  
  fragment NUMBER  : INT FRAC? EXP?;
  
  fragment INT : '-'? DIGITS;
  
  