This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 164497 - Wrong AST for non-compiled code
Summary: Wrong AST for non-compiled code
Status: RESOLVED WONTFIX
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 6.x
Hardware: Sun All
: P3 blocker (vote)
Assignee: nnnnnk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-05 14:34 UTC by Alexander Simon
Modified: 2009-05-12 11:28 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Simon 2009-05-05 14:34:03 UTC
Code example:
-----------------------
//#define TAO_LoadBalancing_Export
namespace TAO {
  template<> 
  struct TAO_LoadBalancing_Export Value_Traits<TAO_LB::ObjectReferenceFactory> {
    static void add_ref (TAO_LB::ObjectReferenceFactory *);
    static void remove_ref (TAO_LB::ObjectReferenceFactory *);
    static void release (TAO_LB::ObjectReferenceFactory *);
  };
}
-----------------------
Parser produced wrong AST for template.
Expected:
1. CSM_TEMPLATE_EXPLICIT_SPECIALIZATION should have a template name
or
2. Skip creating node CSM_TEMPLATE_EXPLICIT_SPECIALIZATION in AST

IDE now reports AstRendererException:
org.netbeans.modules.cnd.modelimpl.csm.AstRendererException: 
/export/home/as204739/Projects/sfbay/ACE_wrappers/CppApplication_3/main.cpp:3:3: error: Empty function name.
        at org.netbeans.modules.cnd.modelimpl.csm.FunctionImpl.<init>(FunctionImpl.java:116)
        at org.netbeans.modules.cnd.modelimpl.csm.FunctionImpl.<init>(FunctionImpl.java:106)
        at org.netbeans.modules.cnd.modelimpl.csm.core.AstRenderer.render(AstRenderer.java:183)
        at org.netbeans.modules.cnd.modelimpl.csm.core.AstRenderer.render(AstRenderer.java:94)
        at org.netbeans.modules.cnd.modelimpl.csm.core.AstRenderer.render(AstRenderer.java:78)
        at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl.render(FileImpl.java:589)
        at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl._reparse(FileImpl.java:606)
        at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl.ensureParsed(FileImpl.java:454)
        at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThread._run(ParserThread.java:125)
        at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThread.run(ParserThread.java:68)
        at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThreadManager$Wrapper.run(ParserThreadManager.java:87)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:576)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1013)
Comment 1 nnnnnk 2009-05-12 11:28:13 UTC
It's ok that parser sometimes produces incorrect AST.
To avoid this we have to have full predicate for every semantic construction or extend rollback.