title: Code Editor using ANTLR
body: <p>I'm in the process of writing a code editor for a custom language.  We're using ANTLR for the lexer and parser, and CodeMirror for the editor framework (running in a browser).</p>
  
  <p>I can do some basic things like syntax coloring of keywords, as well as providing rudimentary code completion.</p>
  
  <p>What I'm finding is that the user is frequently in the middle of editing something, so the ANTLR parser is not very useful since the current input stream is not fully parseable (and often leads ANTLR down the wrong path due to an incomplete input stream).</p>
  
  <p>Therefore, I'm using the token stream to figure out what's going on and attempt to provide context-sensitive help.</p>
  
  <p>I'm wondering if anyone can provide some guidance around using ANTLR as part of a code editor.  Am I on the right track using the token stream instead of the parse tree?</p>
  
  <p>Can the ANTLR API be leveraged to do things like looking ahead for tokens to figure out the overall context of what the user is currently editing?</p>
  
  <p>Sorry if this is kind of vague.  Just getting started on this project. :-)</p>
  
  <p>Thanks for any help.</p>