Loading ...
Sorry, an error occurred while loading the content.

2681Re: [antlr-interest] Re: Error reporting - Complete patch for 2.7.1

Expand Messages
  • Terence Parr
    Oct 3, 2000
      Monday, October 02, 2000, Ric Klaren hath spoken:
      > schmitt@...-luebeck.de on Sat, Sep 30, 2000 at 06:28:31PM +0200

      > Hi,

      > On Sat, Sep 30, 2000 at 06:28:31PM +0200, Michael Schmitt wrote:
      > I finally managed to complete the patch for improved error reporting.
      > Parsers generated by ANTLR (based on Java and C++) will report errors with
      > filename, line and column information now. The output format is chosen in
      > a way that (x)emacs directly jumps to the erroneous file (at the right
      > line/column) if you click on the error message.

      > Great patch :) Allows me too strike exception class rework from the Todo
      > list :)

      > You can install the patches very easily:

      > When it comes to patches I (personally) prefer diffs it is a lot easier to
      > see what really changes with those. Preferably diff -uwbBpPr oldir/ newdir/.

      > Which leads up to my question:

      > @@ -1284,21 +1280,9 @@ public class JavaCodeGenerator extends C
      > // It is a token or literal reference. Generate the
      > // correct variable type for this grammar
      > println(labeledElementType + " " + a.getLabel() + " = "$
      > - // In addition, generate *_AST variables if
      > - // building ASTs
      > + // In addition, generate *_AST variables if building AS$
      > if (grammar.buildAST) {
      > - if (a instanceof GrammarAtom &&
      > - ((GrammarAtom)a).getASTNodeType()!=null ) {
      > - GrammarAtom ga = (GrammarAtom)a;
      > - println(ga.getASTNodeType()+" " +
      > - a.getLabel() +
      > - "_AST = null;");
      > - }
      > - else {
      > - println(labeledElementASTType+" " +
      > - a.getLabel() +
      > - "_AST = null;");
      > - }
      > + println(labeledElementASTType+" " + a.getLabel() + $
      > }
      > }
      > }

      > Is this a change you made to the JavaCodegenerator, Michael, or? ('-'

      I made this in response to label types for hetero trees from Jerry
      James (last night) ;)

      > BTW Terence. How is development going to continue? In the main branch?
      > Shall I include the C++ changes of this patch? Or you do all?

      Tweaks go in the mainline, but in general dev should happen in your
      dev branch. mainline is essentially stuff that compiles, works, and
      is to be included in next release. Be sure to do a

      p4 sync
      p4 integrate -b klaren.dev
      p4 resolve -at # accept all changes from main
      p4 submit

      from your branch to get a clean copy of main before continuing on.

      I would like to examine the exception hierarchy personally before we
      decide on a path there. I'm sure Michael has done most of the
      thinking for us though! ;):D

      > BTW2 Unicode support is not working in C++ mode this could be stated in the
      > 2.7.1 docs. If I recall right. This will need some changes to the support
      > classes. The lexer and probably also Parser/TreeParser need to be
      > templatized with the character type used (wchar_t for unicode) to make this
      > work.

      Shoot...where should we stick it?

      > BTW3 The website does not mention 2.7.1, yet...

      Ooops...yeah I'll get to that soon.

      Thanks,
      Ter
      --
      Chief Scientist & Co-founder, http://www.jguru.com
      Co-founder, http://www.NoWebPatents.org -- Stop Patent Stupidity
      parrt@...
    • Show all 15 messages in this topic