Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'essentially': 0.04; 'subject:Python': 0.05; 'definitions.': 0.07; 'subject:question': 0.08; 'boundaries': 0.09; 'define,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:parsing': 0.09; 'definition.': 0.16; 'lexical': 0.16; 'literals': 0.16; 'operators,': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'example': 0.23; 'header:User-Agent:1': 0.26; 'header:X -Complaints-To:1': 0.28; 'whitespace': 0.29; 'writes:': 0.29; 'comments': 0.33; 'symbol': 0.33; 'to:addr:python-list': 0.33; 'received:org': 0.36; 'charset:us-ascii': 0.36; 'quite': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'end': 0.40; 'is.': 0.62; 'between': 0.63; 'gone': 0.64; 'region.': 0.65; 'received:217': 0.68; 'sitting': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dieter Maurer Subject: Re: simplified Python parsing question Date: Mon, 30 Jul 2012 11:11:54 +0200 References: <5015C58D.4040101@harvee.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gmane-NNTP-Posting-Host: pd9e08fb7.dip0.t-ipconnect.de User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux) Cancel-Lock: sha1:N0Z5hMwDQX5+/HaKnPchA34781Q= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1343639530 news.xs4all.nl 6866 [2001:888:2000:d::a6]:51029 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:26236 "Eric S. Johansson" 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.