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

null pointer exception bug in 2.7.1*

Expand Messages
  • danr@stanford.edu
    With Java code generation in 2.7.1 (and a4) for a grammar: (ATOKEN #(. (~BTOKEN)* ... ) )? { // Some java code } Causes null pointer exceptions because it
    Message 1 of 1 , Nov 6, 2000
    • 0 Attachment
      With Java code generation in 2.7.1 (and a4) for a grammar:

      (ATOKEN #(.
      (~BTOKEN)*
      ...
      )
      )?
      {
      // Some java code
      }

      Causes null pointer exceptions because it generates:

      ...
      case ATOKEN:
      {
      AST tmp7_AST_in = (AST)_t;
      match(_t,ATOKEN);
      _t = _t.getNextSibling();
      AST __t18 = _t;
      AST tmp8_AST_in = (AST)_t;
      _t = _t.getFirstChild();
      {
      _loop20:
      do {
      if (_t==null) _t=ASTNULL;
      ...

      Between _t=_t.getNextSibling() and the _t=_t.getFirstChild() there
      needs to be a "if (null==_t) ..." check (it seems if _t is null it
      should throw a RecognitionException here), since when getNextSibling
      () returns null the TreeParser throws an uncaught
      nullPointerException.
    Your message has been successfully submitted and would be delivered to recipients shortly.