Re: [pdt-dev] 'unparsing' the AST
While those two examples were immensely helpful, I am still trying to figure out how to use the org.eclipse.php.internal.core.format package. For example, I'm a bit confused as to how the class PhpFormatter actually works (or rather, how it is intended to be used, the documentation is a little sparse). Its constructor requires a start and length parameter, which - I assume - is so one can selectively format parts of a document. The format() function then requires an org.w3c.dom.Node, which is presumably the root of the AST? Why is it then, that it does not accept org.eclipse.php.internal.core.ast.nodes.ASTNode? Do I need to convert the AST to DOM? Or am I missing something entirely here? Also, what's the point of implementing the strategy pattern when all indentation strategies are hard-coded into private final members? Basically all I want to do is read a PHP file, fiddle with the AST and then pretty-print it back out. Is PhpFormatter the wrong way to go here? regards raph ___ pdt-dev mailing list pdt-dev@eclipse.org https://dev.eclipse.org/mailman/listinfo/pdt-dev
[pdt-dev] 'unparsing' the AST
Hi everyone, I'm looking for a way to 'unparse' the AST of a PHP program back into source code. I've looked around the source and found the org.eclipse.php.internal.core.format package which is probably what I need to use, but I haven't figured out yet how to wire everything up. Any help is appreciated. Thanks a lot in advance Raphael ___ pdt-dev mailing list pdt-dev@eclipse.org https://dev.eclipse.org/mailman/listinfo/pdt-dev
[pdt-dev] Problems using the PDT parser standalone (IExecutableExtension not found)
Hello everyone, I'm currently trying to use PDT's PHP parser in a standalone application (i.e. outside Eclipse) and I used org.eclipse.php.core.tests.compiler_ast.parser.CompilerParserTests.java as a starting point. However, I can't get it to compile, Eclipse complains that it can't find org.eclipse.core.runtime.IExecutableExtension. From what I've gathered, this should be in eclipse/plugins/org.eclipse.core.runtime_3.5.0.jar but it is not (it is, however, in older versions of Eclipse such as 3.0.2). Any ideas? Thanks in advance Raphael ___ pdt-dev mailing list pdt-dev@eclipse.org https://dev.eclipse.org/mailman/listinfo/pdt-dev
Re: [pdt-dev] Problems using the PDT parser standalone (IExecutableExtension not found)
On 03.12.2009 11:13, 赵忠伟 wrote: org.eclipse.core.runtime.IExecutableExtension in org.eclipse.equinox.registry_xxx.jar Yes, of course. How obvious. ;-) Thanks a bunch! raph ___ pdt-dev mailing list pdt-dev@eclipse.org https://dev.eclipse.org/mailman/listinfo/pdt-dev