simplified Python parsing question

Dieter Maurer dieter at handshake.de
Mon Jul 30 11:11:54 CEST 2012


"Eric S. Johansson" <esj at harvee.org> writes:

> When you are sitting on or in a name, you look to the left or look to
> the right what would you see that would tell you that you have gone
> past the end of that name. For example
>
> a = b + c
>
> if you are sitting on a, the boundaries are beginning of line and =,
> if you are sitting on b, the boundaries are = and +, if you are
> sitting on c, the boundaries are + and end of line.  a call the region
> between those boundaries the symbol region.

Check the lexical definitions. They essentially define, what
a "symbol region" is.

In essence, you have names, operators, literals whitespace and comments --
each with quite a simple definition.




More information about the Python-list mailing list