anchor.diff:     ;
   
   factor
  -   : atom (POW atom)*
  +   : signedAtom (POW signedAtom)*
  +   ;
  +
  +signedAtom //allows for expressions like --++--1
  +   : (MINUS | PLUS)? atom
      ;
   
   atom
  -   : scientific
  -   | variable
  +   : SCIENTIFIC_NUMBER
  +   | VARIABLE
      | LPAREN expression RPAREN
  -   ;
  -
  -scientific
  -   : number (E number)?
      ;
   
   relop
  
positive.code:    | LT
     ;
  
     
  number
     : MINUS? NUMBER
     ;
  
  variable
     : MINUS? VARIABLE
     ;
  
  VARIABLE:
     (('a'..'z')|('A'..'Z')|'_')(('a'..'z')|('A'..'Z')|('0'..'9')|'_')*;
  
  NUMBER:
    ('0'..'9')+ ('.' ('0'..'9')*)?;
  
  
  LPAREN
     : '('
  
negative.code:    : '.'
     ;
  
  POW
     : '^'
     ;
  
  WS
     : [ \r\n\t] + -> channel (HIDDEN)
     ;
  