[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: language neutral parser

From: Hans Aberg
Subject: Re: language neutral parser
Date: Fri, 9 Nov 2001 20:08:07 +0100

At 16:49 +0100 2001/11/09, Axel Kittenberger wrote:
>And what could that be in example, maybe it's clearer if showing it on an

For example, if the output is an array where the entries are computed in an
order other than the sequential order of the array. Or if the output is two
arrays, where the entries is computed sequentially, but alternating between
the two arrays.

>> So is your suggestion that Bison should write XML and only that?
>Why not? If it comes additionally with a XML2C and an XML2C++ converter out
>of the box....

So then someone must first demonstrate that this works practically, before
removing the old stuff in Bison.

>> Also you want to traverse trees
>> and the like many times, then the time complexity might become prohibitive,
>> so that whereas times are reasonable with small grammars, they become
>> impossible with large grammars.
>I took as example one of the most worst case uses of bison: the gnu c
>address@hidden:~/gcc/gcc-3.0/gcc > time bison c-parse.y
>real    0m0.122s
>user    0m0.120s
>sys     0m0.000s
>So plenty of space here :o)

You mean with the current complexity. Suppose now that you change by your
method complexity perhaps from O(n) to O(n^2), where n is the number of
states. If the number of states is n = 1000 of a large grammar, you make
your program running at 1000 x overhead of new program slower. If you
switch from LALR(1) to plain LR(1), you knock on an additional 10 on n,
making the program an additional 100 times slower.

>I agree that having faster compile times is something always welcome, but the
>discussion is what your priorities are.

You need to find someone implementing it, demonstrating that it is fast
enough, and that the programming with the XSL tool is convenient etc.,
before you can expect that to remove writing C/C++ directly.

Most likely, the approach will not be just writing any XML file in the
course of the algorithm as the data happens to be produced, but structured
files, similar to those of C.

  Hans Aberg

reply via email to

[Prev in Thread] Current Thread [Next in Thread]