Re: pyparsing and 'keywords'

2004-12-14 Thread Berteun Damman
as such? Or to provide a table with keywords, which pyparsing is able to automatically recognize? So you would be able to do IF = Keyword(if), just as a Literal now is created, but now the parser knows this word shouldn't be interpreted any other way than as a keyword. Or would that be a bad idea

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 grammar:

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 + body +

Re: pyparsing and 'keywords'

2004-12-14 Thread Paul McGuire
it possible to have some sort of lexing phase which already identifies keywords as such? Or to provide a table with keywords, which pyparsing is able to automatically recognize? So you would be able to do IF = Keyword(if), just as a Literal now is created, but now the parser knows this word