title: Can we define a non context-free grammar with ANTLR?
body: <p>I'm pretty new to ANTLR4 and now I'm trying to undertand which kind of grammars we might define with it. </p>
  
  <p>As far as I got, there're two kind of rules in ANTLR: <strong><em>parser rules</em></strong> (lower case words) and <strong><em>lexer rules</em></strong> (upper-case words). Example:</p>
  
  <pre><code>grammar Test;
  
  init: prog(','prog)*;
  
  prog: A
       | prog
       ;
  
  A: [a-z]+;
  </code></pre>
  
  <p>Form the grammar production rule standpoint I would say that parser rules are NON-TERMINAL symbols which can be replaced with a sequence of tokens defined by a lexer rules.</p>
  
  <p>So, it's perfectly clear that the grammar is context-free by <a href="https://en.wikipedia.org/wiki/Context-free_grammar" rel="nofollow">the definition</a>. The alpahbet of the language generated by the grammar consists of all words making up from lower-case latin letter.</p>
  
  <p><strong><em>Question:</em></strong> Can we define a non context-free grammar using <code>ANTLR4</code>?</p>