Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.python

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 07-30-2012, 03:33 AM
Steven D'Aprano
Guest
 
Posts: n/a
Default Re: simplified Python parsing question

On Sun, 29 Jul 2012 19:21:49 -0400, Eric S. Johansson wrote:

> 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


Have you read the docs? It gives full details of the Python syntax.

http://docs.python.org/reference/index.html

For example:

http://docs.python.org/reference/sim...ent-statements

See also:

http://docs.python.org/library/language.html
http://effbot.org/zone/simple-top-down-parsing.htm
http://nedbatchelder.com/text/python-parsers.html


Here's a Python parser using the pyparsing library. It's a bit old
(written for Python 2.4) but it shouldn't be hard to update it to new
syntax:

http://pyparsing.wikispaces.com/file...ammarParser.py



--
Steven
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 07-30-2012, 06:17 AM
Eric S. Johansson
Guest
 
Posts: n/a
Default Re: simplified Python parsing question

On 7/29/2012 11:33 PM, Steven D'Aprano wrote:
> On Sun, 29 Jul 2012 19:21:49 -0400, Eric S. Johansson wrote:
>
>> 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

> Have you read the docs? It gives full details of the Python syntax.


Yes I have. I was hoping for a different perspective because what I'm trying to
do is middle out parsing. Top-down when the scanner focus moves from left to
right and bottom up when the scanner focus moves from right to left.

sounds kind of odd when I describe it that way but both the cursor is on the
middle of a name string and I need to look to either end of that name string
before can do a conversion to a symbol string, I have to look at both ends in
different ways. If you've read the documentation I've provided, would it be a
better example to use for describing some of the issues. Here's a very rough
draft of a storyboard

https://docs.google.com/presentation...vm40wzCo8/edit

the first 13-14 slides are the working content for the storyboard. the rest is
mostly "memory" of things I was thinking about so if it doesn't make sense or
seems wrong, don't give me grief. :-)

> Here's a Python parser using the pyparsing library. It's a bit old
> (written for Python 2.4) but it shouldn't be hard to update it to new
> syntax:
>
> http://pyparsing.wikispaces.com/file...ammarParser.py
>


thanks for the reference. I'll take a look at it as well.
Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 10:25 PM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.