On Nov 3, 10:49 am, Paul McGuire [EMAIL PROTECTED] wrote:
grammar ((word + grammar) | (word + Literal(end)))
which works.
[Clarifies that the common (and similar) solution doesn't work -- this
works only because the literal binds tightly to the word, so you can't
get a word that matches on
Kay Schluehr wrote:
Could you please learn some parser theory 101 and then come back when
you have complaints about one or the other implemententation of a
particular Python parser? When some guy enters a forum with a newbie
question most of the time people are willing to give a fair and
On Nov 9, 12:28 am, [david] [EMAIL PROTECTED] wrote:
Kay Schluehr wrote:
Could you please learn some parser theory 101 and then come back when
you have complaints about one or the other implemententation of a
particular Python parser? When some guy enters a forum with a newbie
question
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 2007-11-05, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Kay Schluehr [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I'm not sure one needs to start again with a naive approach
just
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 2007-11-07, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
You might be interested in the Early parsing algorithm. It is
On 2007-11-07, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
You might be interested in the Early parsing algorithm. It is
more efficient than the naive approach used in your prototype,
and still
On Nov 7, 2007 3:15 PM, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
In short, it hasn't really evovled into a user-friendly package
yet.
Thank you.
How is it that I seem to be the only one in the market for a correct
parser? Earley has a runtine of O(n^3)
On Wed, 07 Nov 2007 21:15:50 +, Just Another Victim of the Ambient
Morality wrote:
Why can't I find a pyparsing-esque library with this implementation?
I'm tempted to roll my own except that it's a fairly complicated
algorithm and I don't really understand how it's any more efficient than
Chris Mellon [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Nov 7, 2007 3:15 PM, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
In short, it hasn't really evovled into a user-friendly package
yet.
Thank you.
How is it that I seem to be the
Steven D'Aprano [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Wed, 07 Nov 2007 21:15:50 +, Just Another Victim of the Ambient
Morality wrote:
Why can't I find a pyparsing-esque library with this implementation?
I'm tempted to roll my own except that it's a fairly
On Nov 7, 2007 5:15 PM, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Chris Mellon [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Nov 7, 2007 3:15 PM, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
In short, it hasn't really
Chris Mellon [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Nov 7, 2007 5:15 PM, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Chris Mellon [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Nov 7, 2007 3:15 PM, Just Another Victim of the
What do you mean by disambiguate? Do you mean disambiguate the
grammar? One of the conditions of the problem is that you have no control
over the grammar, so that's really not an option. Also, an implicit
condition of solving a problem is that the problem be... solved, so not
accepting
On 2007-11-05, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Kay Schluehr [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I'm not sure one needs to start again with a naive approach
just to avoid any parser theory. For a user of a parser it is
quite important
On Nov 2, 6:47 am, Paul McGuire [EMAIL PROTECTED] wrote:
Well I'll be darned! All this time, I thought recursive descent
described the recursive behavior of the parser, which pyparsing
definitely has. I never knew that backing up in the face of parse
mismatches was a required part of the
On 2007-11-05, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
There are different kinds of recursion. Compare:
While interesting, none of this actually addresses the
point I was making. I
On 4 Nov., 03:07, Neil Cerutti [EMAIL PROTECTED] wrote:
On 2007-11-04, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 2007-11-03, Paul McGuire [EMAIL PROTECTED] wrote:
On Nov 3, 12:33 am,
On 2007-11-04, Kay Schluehr [EMAIL PROTECTED] wrote:
On 4 Nov., 03:07, Neil Cerutti [EMAIL PROTECTED] wrote:
I wouldn't characterize it as pretending. How would you parse:
hello end hello end
WORD END WORD END and WORD WORD WORD END are both valid
interpretations, according to the
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 2007-11-04, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Is there not an ambiguity in the grammar?
In EBNF:
goal --
On 2007-11-04, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Consider writing a recursive decent parser by hand to parse
the language '[ab]+b'.
goal -- ab_list 'b'
ab_list -- 'a' list_tail
ab_list -- 'b' list_tail
list_tail -- 'a' list_tail
list_tail -- 'b'
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 2007-11-04, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Consider writing a recursive decent parser by hand to parse
the language '[ab]+b'.
goal -- ab_list 'b'
ab_list -- 'a' list_tail
On 2007-11-04, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I believe there's no cure for the confusion you're having except
for implementing a parser for your proposed grammar.
Alternatively, try
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 2007-11-04, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I believe there's no cure for the confusion you're having except
On Nov 4, 10:44 pm, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED]
I believe there is a cure and it's called recursive descent parsing.
It's slow, obviously, but it's correct and, sometimes (arguably, often),
that's more important the execution speed.
Recursive decendent
Kay Schluehr [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Nov 4, 10:44 pm, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED]
I believe there is a cure and it's called recursive descent parsing.
It's slow, obviously, but it's correct and, sometimes (arguably,
On 2007-11-05, Just Another Victim of the Ambient Morality [EMAIL PROTECTED]
wrote:
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 2007-11-04, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Neil Cerutti [EMAIL PROTECTED] wrote in message
On 2007-11-05, Just Another Victim of the Ambient Morality [EMAIL PROTECTED]
wrote:
Kay Schluehr [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Nov 4, 10:44 pm, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED]
I believe there is a cure and it's called recursive
On 2007-11-05, Neil Cerutti [EMAIL PROTECTED] wrote:
def Ack(x, y):
The Ackermann function. Creates a humongous mess even
with quite tiny numbers.
if x 0 or y 0:
raise ValueError('non-negative integer')
elif x == 0:
return y + 1
elif y == 0:
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 2007-11-05, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Kay Schluehr [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Nov 4, 10:44 pm, Just Another Victim of the Ambient Morality
On Nov 5, 3:05 am, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Kay Schluehr [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Nov 4, 10:44 pm, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED]
I believe there is a cure and it's called
On Nov 3, 6:33 am, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Paul McGuire [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Nov 2, 5:47 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
Pyparsing is no recursive descent parser. It doesn't go
On Nov 3, 12:33 am, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
It has recursion in it but that's not sufficient to call it a recursive
descent parser any more than having a recursive implementation of the
factorial function. The important part is what it recurses
On 2007-11-03, Paul McGuire [EMAIL PROTECTED] wrote:
On Nov 3, 12:33 am, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
It has recursion in it but that's not sufficient to call it a recursive
descent parser any more than having a recursive implementation of the
Paul McGuire [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Nov 3, 12:33 am, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
It has recursion in it but that's not sufficient to call it a
recursive
descent parser any more than having a recursive
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 2007-11-03, Paul McGuire [EMAIL PROTECTED] wrote:
On Nov 3, 12:33 am, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
It has recursion in it but that's not sufficient to call it a
recursive
On 2007-11-04, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED] wrote:
Neil Cerutti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 2007-11-03, Paul McGuire [EMAIL PROTECTED] wrote:
On Nov 3, 12:33 am, Just Another Victim of the Ambient Morality
[EMAIL PROTECTED]
On Nov 2, 5:47 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
Pyparsing is no recursive descent parser. It doesn't go back in the input
stream. The ``OneOrMore(Word(alphas))`` part eats the 'end' and when it
can't get more, the parser moves to the ``Literal('end')`` part which
fails
On Fri, 02 Nov 2007 06:05:13 +, Just Another Victim of the Ambient
Morality wrote:
Is pyparsing really a recursive descent parser? I ask this because
there are grammars it can't parse that my recursive descent parser would
parse, should I have written one. For instance:
from
Paul McGuire [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Nov 2, 5:47 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
Pyparsing is no recursive descent parser. It doesn't go back in the
input
stream. The ``OneOrMore(Word(alphas))`` part eats the 'end' and when
it
Is pyparsing really a recursive descent parser? I ask this because
there are grammars it can't parse that my recursive descent parser would
parse, should I have written one. For instance:
from pyparsing import *
grammar = OneOrMore(Word(alphas)) + Literal('end')
grammar.parseString
40 matches
Mail list logo