On May 9, 2008, at 6:12 PM, Greg Ewing wrote: > Robert Bradshaw wrote: >> I think the C declarations are representable by a generative grammar, >> so this method could work. > > It's not the grammar that's the issue, it's the parsing > algorithm. To do it with an LL(1) parser, you need to > be able to tell whether you're looking at a type name. > The current parser does this by remembering all the > names it's seen being declared as types, and this affects > the decisions it makes later on. It would be hard to do > this without being able to embed arbitrary actions in > the grammar rules.
Yes, determining whether or not a identifier is a type or not would happen at a higher level. This needs to be dealt with anyways to handle parameterized types. > There are also other places where it uses contextual > information. For example, it passes down a flag indicating > whether a statement is inside a cdef extern block, and > if so, it treats everything as though it had 'cdef' in > front of it. This isn't a blocker, it would be written into the grammar in a more direct way. - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
