title: Generating symbol table using Antlr4
body: <p>I am learning how to generate a symbol table using Antlr4. I came across <a href="https://github.com/parrt/cs652/tree/master/lectures/code/symtab/src" rel="nofollow noreferrer">this</a> example (and the only one so far) but it gives compilation errors for the files generated by Antlr4. </p>
  
  <p>(commands: 
  <code>antlr4 Simple.g4</code> and <code>javac Simple*.java</code>) </p>
  
  <pre><code>-bash-4.1$ javac Simple*.java
  SimpleBaseListener.java:3: error: package org.antlr.symbols does not exist
  import org.antlr.symbols.*;
  ^
  SimpleListener.java:3: error: package org.antlr.symbols does not exist
  import org.antlr.symbols.*;
  ^
  SimpleParser.java:3: error: package org.antlr.symbols does not exist
  import org.antlr.symbols.*;
  ^
  SimpleParser.java:87: error: cannot find symbol
              public Scope scope;
                     ^
  symbol:   class Scope
  location: class FileContext
  SimpleParser.java:166: error: cannot find symbol
              public Scope scope;
                     ^
  symbol:   class Scope
  location: class FuncContext
  SimpleParser.java:356: error: cannot find symbol
              public Scope scope;
                     ^
  symbol:   class Scope
  location: class BlockContext
  SimpleLexer.java:3: error: package org.antlr.symbols does not exist
  import org.antlr.symbols.*;
  ^
  7 errors
  </code></pre>
  
  <p>My guess is that this implementation uses an old verison of Antlr. </p>
  
  <p>Is there an example for Antlr4? I tried the official <a href="https://www.antlr.org/api/Java/" rel="nofollow noreferrer">documentation</a> but it is not very helpful for a newbie.  </p>