anchor.diff:      | SPECIAL
       ;
   
  -GRAPHIC_TOKEN: GRAPHIC | '\\' ;
  +GRAPHIC_TOKEN: (GRAPHIC | '\\')+ ;
   fragment GRAPHIC: [#$&*+-./:<=>?@^~] ; // 6.5.1 graphic char
   
   QUOTED_TOKEN: NON_QUOTE_CHAR | '\'\'' | '"' | '`' ;
  
positive.code: grammar prolog;
  
  program 
      : clauselist query? EOF
      ;
  
  clauselist 
      :  clause*
      ;
  
  clause 
      : (predicate '.')
      | (predicate ':-') (predicatelist '.')
      ;
  
  predicatelist 
      :  predicate (',' predicate)*
      ;
  
  predicate 
      : atom
      | atom '(' termlist ')'
      ;
  
  termlist 
      : term ( ',' term )*
      ;
  
  term 
      : VARIABLE
      | atom
      | integer
      | FLOAT
      | structure
      ;
  
  structure 
      : atom '(' termlist ')'
      ;
  
  query 
      : '?-' predicatelist '.'
      ;
  
  atom 
      : '[' ']'
      | '{' '}'
      | SMALLATOM
      | GRAPHIC_TOKEN
      | QUOTED_TOKEN
      | '\'' STRING '\'' //FIXME escapes in strings
      | '"' STRING '"'
      | '`' STRING '`'
      | ';'
      | '!'
      ;
  
  
  
negative.code: 
  VARIABLE
      : UCLETTER CHARACTER*
      | '_' CHARACTER+
      ;
  
  DECIMAL: DIGIT+ ;
  