FIXED TPG error when using 't' as the first letter of a token

Andrew James drew at gremlinhosting.com
Thu Nov 18 13:23:59 EST 2004


Gentlemen,
Fixed what turned out to be my appalling knowledge of regexps. It turns
out that inline tokens are parsed as regular expressions by TPG and I
hadn't properly escaped the '[' characters. This means the START rule
has been changed to this:

START -> CatExpr ('\[' MetaExpr '\]')?

Now things work as expected, but I'm still unsure as to why this symptom
was only occurring with the uncapitalised character 't'.... can anyone
enlighten me?

Regards,
Andrew

On Thu, 2004-11-18 at 15:36 +0000, Andrew James wrote:
> Greg,
> Thanks for your response. Thought about this and tried with a lowercase
> 'n' and a few other letters to check it out. It ran fine, so I'm back to
> square one ;-/
> 
> TPG is a parser generator for Python (which is really quite cool) and
> can be found at: http://christophe.delord.free.fr/en/tpg/
> 
> Can anyone else offer any insight?
> 
> Regards,
> Andrew
> 
> On Thu, 2004-11-18 at 13:48 +0000, Greg Krohn wrote:
> > Andrew James wrote:
> > > Gentlemen,
> > > 
> > > I'm running into a problem whilst testing the parsing of a language I've
> > > created with TPG . It seems that for some reason, TPG balks when I try
> > > to parse an expression whose first letter is 't' (or, in fact, at any
> > > time when 't' is at the beginning of a token). This doesn't happen with
> > > any other letter (as far as I know), nor if the 'T' is capitalised.
> > 
> > I have no idea what TPG is, but if it's only having trouble with a lower 
> > case t, could it be that the t is somehow getting escaped and TPG thinks 
> > it's a tab character?
> > 
> > Just a thought.
> > 
> > greg
> -- 
> Andrew James <drew at gremlinhosting.com>
> 
-- 
Andrew James <drew at gremlinhosting.com>




More information about the Python-list mailing list