Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Recognizing parse errors in DOMBuilder?
Recognizing parse errors in DOMBuilder? [message #15063] Tue, 06 May 2003 11:17 Go to next message
Eclipse UserFriend
Originally posted by: florian.hawlitzek.hawlitzek-consulting.de

I'm creating new methods (type org.eclipse.jdt.core.jdom.IDOMMethod)
with DOMFactory.createMethod(source)
Internally the source code is validated by an eclipse parser invoked
by org.eclipse.jdt.internal.core.jdom.DOMBuilder. I can see that
parsing errors get recognized but I have no access to the error
code or message.
Does anyone know how to register a ProblemFactory to DOMFactory?
(DOMBuilder is creating an anoynmous DefaultProblemFactory which
ignores all errors. This is not what I have in mind...)

Thanks,
Florian Hawlitzek.

------------------------------------------------------------ -----------
Florian Hawlitzek | "In a world with no fences
florian@hawlitzek.de (office) | who needs gates?
Florian.Hawlitzek@munich.com (priv.) | Think Java!"
www.hawlitzek.de (homepage) | JavaOne 1998
------------------------------------------------------------ -----------
Re: Recognizing parse errors in DOMBuilder? [message #16102 is a reply to message #15063] Wed, 07 May 2003 05:12 Go to previous messageGo to next message
Eclipse UserFriend
This is not currently possible. Please enter a feature request against
JDT/Core.

Jerome

"Florian Hawlitzek" <florian.hawlitzek@hawlitzek-consulting.de> wrote in
message news:3EB7D1F2.6272B4A7@hawlitzek-consulting.de...
> I'm creating new methods (type org.eclipse.jdt.core.jdom.IDOMMethod)
> with DOMFactory.createMethod(source)
> Internally the source code is validated by an eclipse parser invoked
> by org.eclipse.jdt.internal.core.jdom.DOMBuilder. I can see that
> parsing errors get recognized but I have no access to the error
> code or message.
> Does anyone know how to register a ProblemFactory to DOMFactory?
> (DOMBuilder is creating an anoynmous DefaultProblemFactory which
> ignores all errors. This is not what I have in mind...)
>
> Thanks,
> Florian Hawlitzek.
>
> ------------------------------------------------------------ -----------
> Florian Hawlitzek | "In a world with no fences
> florian@hawlitzek.de (office) | who needs gates?
> Florian.Hawlitzek@munich.com (priv.) | Think Java!"
> www.hawlitzek.de (homepage) | JavaOne 1998
> ------------------------------------------------------------ -----------
Re: Recognizing parse errors in DOMBuilder? [message #19787 is a reply to message #15063] Mon, 12 May 2003 07:26 Go to previous message
Eclipse UserFriend
From org.eclipse.jdt.core.dom.AST spec for parseCompilationUnit* methods:

* If a syntax error is detected while parsing, the relevant node(s) of the
* tree will be flagged as <code>MALFORMED</code>.

Also use org.eclipse.jdt.core.dom.CompilationUnit.getProblems() to reach
compilation problems:

/**
* Returns the list of detailed problem reports noted by the compiler
* during the parsing or the type checking of this compilation unit. This
* list might be a subset of errors detected and reported by a Java
* compiler.
* <p>
* Simple clients that do little more than log the messages or display
* them to the user should probably call <code>getMessages</code> instead.
* </p>
*
* @return the list of detailed problem objects, possibly empty
* @see #getMessages
* @see AST#parseCompilationUnit
* @since 2.1
*/
public IProblem[] getProblems()


"Florian Hawlitzek" <florian.hawlitzek@hawlitzek-consulting.de> wrote in
message news:3EB7D1F2.6272B4A7@hawlitzek-consulting.de...
> I'm creating new methods (type org.eclipse.jdt.core.jdom.IDOMMethod)
> with DOMFactory.createMethod(source)
> Internally the source code is validated by an eclipse parser invoked
> by org.eclipse.jdt.internal.core.jdom.DOMBuilder. I can see that
> parsing errors get recognized but I have no access to the error
> code or message.
> Does anyone know how to register a ProblemFactory to DOMFactory?
> (DOMBuilder is creating an anoynmous DefaultProblemFactory which
> ignores all errors. This is not what I have in mind...)
>
> Thanks,
> Florian Hawlitzek.
>
> ------------------------------------------------------------ -----------
> Florian Hawlitzek | "In a world with no fences
> florian@hawlitzek.de (office) | who needs gates?
> Florian.Hawlitzek@munich.com (priv.) | Think Java!"
> www.hawlitzek.de (homepage) | JavaOne 1998
> ------------------------------------------------------------ -----------
Previous Topic:(setting classpath programatically for a java project)
Next Topic:unable to resolve imports after project rebuild
Goto Forum:
  


Current Time: Tue Jul 01 16:03:29 EDT 2025

Powered by FUDForum. Page generated in 0.03841 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top