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

2671Re: Error reporting - Complete patch for 2.7.1

Expand Messages
  • Ric Klaren
    Oct 2, 2000
    • 0 Attachment
      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? ('-'
      prefixed lines are the antlr code disappearing the '+' prefixed lines are
      the ones introduced by you) Just checking....

      Rest of the patch looks fine!

      > I would be very grateful if some guys could test the patch. The changes
      > are pretty simple and should not cause any new problem.

      Remember how often I said that =) (Not that this patch caused any trouble
      of course (yet ;) ) just saying that I've grown a little suspicious of
      small patches that really don't change anything even if I made them myself)

      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?

      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.

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

      Ric
      --
      -----+++++*****************************************************+++++++++-------
      -- Ric Klaren - klaren@... ------------------------------------------
      -----+++++*****************************************************+++++++++-------
      'And this 'rebooting' business? Give it a good kicking, do you?' 'Oh, no,
      of course, we ... that is ... well, yes, in fact,' said Ponder. 'Adrian
      goes round the back and ... er ... prods it with his foot. But in a
      technical way,' he added. --- From: Hogfather by Terry Pratchett.
      -------------------------------------------------------------------------------
    • Show all 15 messages in this topic