On 4 May 2011 06:33, Trevor Parscal <[email protected]> wrote: > I think the idea that we might break the existing PHP "parser" out into a > library for general use is rather silly. > > The "parser" is not a parser, it's a macro expander with a pile of > regular-expressions used to convert short-hand HTML into actual HTML. The
Oh don't be silly. It may not be an LALR(1) parser or an LL parser or even a recursive descent parser but last I checked parsing was the act of breaking down a text into its elements, which the parser does. It just does it in a pretty clunky way. Whether it stores the results in an AST or in bunches of random state all over the place doesn't mean it's doing something other than parsing. A more accurate argument is that it's not just a parser since goes directly on to transforming the input into HTML, which is the equivalent of code generation. > code that it outputs is highly dependent on the state of the wiki's > configuration and database content at the moment of "parsing". It also is > useless to anyone wanting to do anything other than render a page into HTML, > because the output is completely opaque as to where any of it > was derived. Dividing the "parser" off into a library would require an > substantial amount of MediaWiki code to be ported too just to get it > working. On it's own, it would be essentially useless. It seems we're getting bogged won in semantics because in MediaWiki we use the word "parser" in two incompatible ways. 1) The PHP classes which convert wikitext to HTML 2) A hypothetical or postulated part of MediaWiki which does not exist to generate an intermediate form (AST) between wikitext and HTML. So the first thing we need to do is decide which of these two concepts of parser we're talking about. Would it be useful to have a library that can convert wikitext to HTML? Yes. Would it be useful to have a library that can convert wikitext to an AST? Unclear. Would it be useful to have a library that can convert such AST to HTML? Because of the semantic soup nobod has even brought this up yet. > So, it's probably not an issue what license this hypothetical code would be > released under. > > - Trevor I'm pretty sure the offline wikitext parsing community would care about the licensing as a separate issue to what kind of parser technology it uses internally. Andrew Dunbar (hippietrail) > On Tue, May 3, 2011 at 1:25 PM, David Gerard <[email protected]> wrote: > >> On 3 May 2011 21:15, Domas Mituzas <[email protected]> wrote: >> >> >> Thoughts? Also, for re-licensing, what level of approval do we need? >> >> All authors of the parser, or the current people in an svn blame? >> >> > Current people are doing 'derivative work' on previous authors work. I >> think all are needed. Pain oh pain. >> >> >> This is the other reason to reduce it to mathematics, which can then >> be freely reimplemented. >> >> >> - d. >> >> _______________________________________________ >> Wikitech-l mailing list >> [email protected] >> https://lists.wikimedia.org/mailman/listinfo/wikitech-l >> > _______________________________________________ > Wikitech-l mailing list > [email protected] > https://lists.wikimedia.org/mailman/listinfo/wikitech-l > _______________________________________________ Wikitech-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikitech-l
