title: Antlr: Create combined operators
body: <p>I'm using antlr for parse sql condition queries like:</p>
  
  <pre><code>[where] Field1 = "Param1" and Field2 = "Param2"
  </code></pre>
  
  <p>for this case I have an antlr condition:</p>
  
  <pre><code>andExpr
      :   inExpr
          (
              AND^
              inExpr
          )*
      ;
  
  inExpr      
      :    (eqcompareExpr)
          (
              IN^
              args
          )?  
      ;
  
  eqcompareExpr
      :   (compareExpr)
          (
              (EQUAL^|NOTEQ^|IS^|LIKE^)
              (compareExpr)
          )?
      ;
  
  compareExpr
      :   addExpr
          (
              (LESS^|MORE^|LESSEQ^|MOREEQ^)
              addExpr 
          )?
      ;
  </code></pre>
  
  <p>and tokens like:</p>
  
  <pre><code>LIKE    :   "like"
      ;
  AND :   "and"
      ;
  OR  :   "or"
  </code></pre>
  
  <p>How do I change the antlr code for add combined conditions with 'contains' like:</p>
  
  <pre><code>[where] Field1 = "Param1" and Contains (Field2, "Param2")
  </code></pre>
  
  <p>Also the queries can be like this:</p>
  
  <pre><code>[where] Contains (Field2, "Param2")
  </code></pre>
  
  <p>or</p>
  
  <pre><code>[where] Field1 = "Param1" or Contains (Field2, "Param2")
  </code></pre>