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

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 07-30-2012, 02:59 PM
Laszlo Nagy
Guest
 
Posts: n/a
Default Re: simplified Python parsing question


>
> yeah the problem is also little more complicated than simple parsing
> of Python code. For example, one example (from the white paper)
>
> *meat space blowback = Friends and family [well-meaning attempt]
>
> *could that be parsed by the tools you mention?


It is not valid Python code. Pygments is able to tokenize code that is
not valid Python code. Because it is not parsing, it is just tokenizing.
But if you put a bunch of random tokens into a file, then of course you
will never be able to split that into statements.

Probably, you will need to process ident/dedent tokens, identify the
"level" of the satement. And then you can tell what file, class, inner
class, method you are staying in. Inside one "level" or code block, you
could try to divide the code into statements.

Otherwise, I have no idea how a blind person could navigate in a Python
source. In fact I have no idea how they use regular programs. So I'm
affraid I cannot help too much with this. :-(


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

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 06:36 PM.


Copyright ©2009

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