anchor.diff:   existence_test
    subquery
    scalar_exp
  + scalar_sub_exp
    scalar_exp_commalist
    atom
    parameter_ref
  
positive.code: 
      %% operators
  
  Left        100 'OR'.
  Left        110 'AND'.
  Left        120 'NOT'.
  Nonassoc    200 COMPARISON. %% = <> < > <= >=
  Left        300 '+' '-'.
  Left        400 '*' '/'.
  
negative.code: 
      %% scalar expressions
  
  scalar_exp -> scalar_sub_exp                                                                    : '$1'.
  scalar_exp -> scalar_sub_exp NAME                                                               : {as, '$1', unwrap_bin('$2')}. 
  scalar_exp -> scalar_sub_exp AS NAME                                                            : {as, '$1', unwrap_bin('$3')}. 
  
  scalar_sub_exp -> scalar_sub_exp '+' scalar_sub_exp                                             : {'+','$1','$3'}.
  scalar_sub_exp -> scalar_sub_exp '-' scalar_sub_exp                                             : {'-','$1','$3'}.
  scalar_sub_exp -> scalar_sub_exp '*' scalar_sub_exp                                             : {'*','$1','$3'}.
  scalar_sub_exp -> scalar_sub_exp '/' scalar_sub_exp                                             : {'/','$1','$3'}.
  scalar_sub_exp -> '+' scalar_sub_exp                                                            : {'+','$2'}. %prec UMINU
  scalar_sub_exp -> '-' scalar_sub_exp                                                            : {'-','$2'}. %prec UMINU
  scalar_sub_exp -> '+' literal                                                                   : '$2'.
  scalar_sub_exp -> '-' literal                                                                   : list_to_binary(["-",'$2']).
  scalar_sub_exp -> NULLX                                                                         : <<"NULL">>.
  scalar_sub_exp -> atom                                                                          : '$1'.
  scalar_sub_exp -> subquery                                                                      : '$1'.
  scalar_sub_exp -> column_ref                                                                    : '$1'.
  scalar_sub_exp -> function_ref                                                                  : '$1'.
  scalar_sub_exp -> '(' scalar_sub_exp ')'                                                        : '$2'.
  
  scalar_exp_commalist -> scalar_exp                                                              : ['$1'].
  scalar_exp_commalist -> scalar_exp_commalist ',' scalar_exp                                     : '$1' ++ ['$3'].
  