title: ANTLR version2 grammar syntax?
body: <p>My professor gave us an assignment about ANTLR,</p>
  
  <p>but I found that the given grammar file does not work with current ANTLR versions.</p>
  
  <p>Actually, it is an example code included in ANTLR v2, which there are few documents left I can find and has been stopped to be supported by any IDE tools such as Eclipse or ANTLRWorks.</p>
  
  <p>Because of this, it took quite long time for me to find out that the grammar file is from the ancient.</p>
  
  <p>I need to modify the given grammar file to find whlie loops that are immediately enclosed by else branch, but cannot understand some part of the grammar.</p>
  
  <p><strong>Somebody please teach me what does '=>' means in this example?</strong> </p>
  
  <pre><code>
  program
      :   ( declaration )* EOF
      ;
  
  declaration
      :   (variable) => variable
      |   function
      ;
  
  declarator
      :   id:ID
      |   STAR id2:ID
      ;
  
  variable
      :   type declarator SEMI
      ;
  
  function
      :   type id:ID LPAREN
          (formalParameter (COMMA formalParameter)*)?
          RPAREN
          block
      ;
  
  statement
      :   (declaration) => declaration
      |   expr SEMI
      |   if_statement
      |   while_statement
      |   block
      ;
  </code></pre>