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.

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.

-- 
Greg
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to