[Python-Dev] newb question

Ty Newton ty.newton at copperchipgames.com
Wed Aug 29 22:06:46 CEST 2007


Hi,
I'm new to the Python source and I have a (hopefully) quick question 
that someone more familiar with it should be able to answer so I can 
continue on my way to understanding how Python is put together.

I have started looking at the parser and have gotten a little confused 
about how the grammar is instantiated (perhaps the wrong term).

Here's how I understand things at the moment.  graminit.c contains the 
definition of the grammar in terms of static structures.  Everything 
seems simple enough until I get to the DFA (in graminit.c):

static dfa dfas[84] = {
{256, "single_input", 0, 3, states_0, 
"\004\050\014\000\000\000\000\025\074\005\023\310\011\020\004\000\300\020\222\006\201"},
...

I assume that the last bit of my snippet (\004\050\014\ ...) is a bitset 
structure.  When I look at bitset it is defined as a char array.

Can someone explain how this works please?  I've never come across 
escape sequences like this; I've only ever seen \0 (nul) before; not \2, 
\3 etc.  or are they not escape sequences, but literal forward slashes.


Thanks,
Ty


More information about the Python-Dev mailing list