title: Rewrite rules in ANTLR
body: <p>I am doing an ANTLR specification. In my AST i need to do this one:</p>
  
  <pre><code>characters ('*'^|'+'^|'?'^)?
  </code></pre>
  
  <p>I need to do a rewrite rule that will present in ast instead of * ASTERISK, instead of + PLUS and instead of ? QMARK nodes? </p>
  
  <p>I know that if we would have something like this: </p>
  
  <pre><code>characters '*' 
  </code></pre>
  
  <p>it can be rewrited as </p>
  
  <pre><code>^(ASTERISK characters)
  </code></pre>
  
  <p>but i dont know how to deal with | operator?</p>