Hello Yauhen, On Thu, 9 Sep 2010 12:50:00 +0200, Yauhen Yakimovich <[email protected]> wrote: > On Wed, Sep 8, 2010 at 10:12 PM, Benjamin Eberlei <[email protected]> > wrote: >> Hello, >> >> I have sent this to antlr-interest before, i didn't realize that there >> is also a dev list, so here is that mail again. >> >> We are currently building an open-source PHP ORM >> (http://www.doctrine-project.org) that utilizes a hand-written Top-Down, >> Recursive-Descent Parser for our Query Language. That is why we are >> looking for ways how to automate the parser generation for a future >> major release to increase maintainability. This his going to be a >> potential long-run refactoring for our project, so we are looking into >> possible solutions as early as possible. >> >> We know Antlr exists and have found the ongoing effort to write an Antlr >> Target for PHP at http://code.google.com/p/antlrphpruntime/. However it >> seems development of that target has come to halt. > > Please take a look at yy branch > http://code.google.com/p/antlrphpruntime/source/browse/#svn/branches/yy >
It seems the branch added two new files on the main-level to genreate the antlr-php-target.jar and only moved some folders around to the runtime/Php/src/Antlr/Runtime directory. This is about the same that I did, i moved the files to: runtime/Php/Antlr/Runtime/* i could just move them into a src/ also for consistency and our branches are the same again from the file layout. Additionally i was thinking about moving the tests also, but aside from the directory changes and two new commandline tools I see no differences to the git repository i branched off (i did check that before also). >> Additionally we had doubts with regard to some design decisions in the >> Runtime engine. > > Well, there have been no crucial decisions made, since this is a pure > mirroring effort. > >> Over the weekend I have forked that project at >> http://github.com/beberlei/antlr-php-runtime and changed the >> following stuff: >> >> * Migrated Runtime to PHP 5.3 Namespaces (Antlr\Runtime\*) > > Already done in yy target > It seems you only moved the directories, the namespace directives were not yet included and the template updated in that direction. >> * Fixed formatting of all files to comply to PEAR/Zend Coding Standards >> (Php.stg is not yet generation compliant code) > > Did you used a codesniffer for this one? > I used Netbeans PHP Plugin formatting capabilities, which allows to specify coding standard rules and format php code according to it. >> * Fixed functional testsuite to pass up to test 41 of the Python >> testsuite (with the exception of Test 22) >> * Refactored testsuite to have distinct sub-directories for grammer and >> generated code to enhance readibility/maintainability. >> * Removed class "Set" and implemented follow sets with simple PHP arrays >> for performance reasons. >> * Removed "public static" token and "constants" and used PHP class >> constants for performance reasons (compile vs runtime generation) >> * Rewrote DFA code (although this still does not support unicode and >> probably has other bugs) >> * Lots of other refactorings to make use of PHP internal features. > will have to take a more closer look at last changes > >> How should the development of this target continue given that the >> original code is in the Google SVN? For the namespace and test-cleanup >> refactoring I moved almost all files to new directories, so this could >> be a bit cumbersome to merge back (sorry for that! :() > > How troubling this could be to merge your code with yy branch? Please > give some estimate. > I think I did already do all the changes that you did in your yy branch, except for the new testing layout and the two new tools in the main directory. I would suggest i mirror all your additional change sinto my Git repository, so they don't get lost. We could then merge the changes back into the trunk and open up new branches from there. Personally I favor Git over SVN though, especially for such a decentralized project. > >> Additionally for further development it would be helpful if anyone could >> help me with these questions: >> >> 1. Is it really required to have a Runtime of "StringTemplate" library >> in PHP? What is it used for at runtime? When is the ST.stg template used >> at all? > > Yes. It is a very important point. Features like template substitute > in ANTLR grammars require this. > I am currently occupied with porting StringTemplate to PHP. > That is awesome, are you willing to share some code already? :-) >> 3. How stable are the runtimes? I see very little commits to them, so >> probably very stable. But how will that change with Antlr v4 in >> development? > > a lot. We will have to rewrite a lot of things. But v3 is stable and > popular enough, so it is worth the effort. > Libraries like StringTemplate can be exploited by v4 but written for v3. > Such "legacy" is a part of ANTLR design. I am beginning to port more and more of the Java testsuite to my PHP branch, even to a point where today I have lots of the Tree support already working against the "TestTree.java", "TestTreeNodeStream.java" and "TestTreeWizard.java" testsuites, so that I can commit that in the next days. With the PHP port being very stable in regards to the java testsuite I guess we won't get into too much trouble with future refactorings of the Java Runtime. > >> 4. After the basic Parser/Lexer support, what would be the next step in >> target development? AST support with the Tree Runtime namespace? > > Yes. AST rewrite and StringTemplate support. > > There have been some email correspondence in June regarding the PHP target. > Probably I can forward it to you if you like. Little activity has been > seen since. > I was working in isolated mode on StringTemplate. Yes could you please forward that correspondence? I am working on the AST/Tree support, so we can probably merge efforts with your StringTemplate implementation. > > The GIT target you have been working with was a bad place to resume. > As I've said take a look at yy branch. > As far as I know from Sidharth Kuruvila, he has no plans for further > contributing. I have not seen further activity > from Geoff Speicher or Rolland (rollxx). So if you want to coordinate > your effort regarding the target, I am > probably the best person to talk to. Again, I think the changes in your yy branch are not that major compared to the branch I started from. I will just port the additional tools and move the directory structure according to yours and this should be it. _______________________________________________ antlr-dev mailing list [email protected] http://www.antlr.org/mailman/listinfo/antlr-dev
