Re: pyparsing and 'keywords'

2004-12-14 Thread Paul McGuire
"Berteun Damman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Tue, 14 Dec 2004 18:39:19 GMT, Paul McGuire > <[EMAIL PROTECTED]> wrote: > >> If I try however to parse the String "if test; testagain; fi;", it does > >> not work, because the fi is interpreted as an expr, not as the

Re: pyparsing and 'keywords'

2004-12-14 Thread Paul McGuire
"Berteun Damman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > > I'm having some problems with pyparsing, I could not find how to tell > it to view certain words as keywords, i.e. not as a possible variable > name (in an elegant way), > for example, I have this little gramm

Re: pyparsing and 'keywords'

2004-12-14 Thread Berteun Damman
On Tue, 14 Dec 2004 18:39:19 GMT, Paul McGuire <[EMAIL PROTECTED]> wrote: >> If I try however to parse the String "if test; testagain; fi;", it does >> not work, because the fi is interpreted as an expr, not as the end of >> the if statement, and of course, adding another fi doesn't solve this >> e

pyparsing and 'keywords'

2004-12-14 Thread Berteun Damman
Hello, I'm having some problems with pyparsing, I could not find how to tell it to view certain words as keywords, i.e. not as a possible variable name (in an elegant way), for example, I have this little grammar: terminator = Literal(";") expr = Word(alphas) body = Forward(); ifstat = "if" + bod