Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: simplified Python parsing question

Reply
Thread Tools

Re: simplified Python parsing question

 
 
Eric S. Johansson
Guest
Posts: n/a
 
      07-30-2012
On 7/30/2012 5:25 AM, Laszlo Nagy wrote:
>
> Did you try to use pygments?
>
> http://pygments.org/docs/api/
>


thanks, I'll take a look.

>
> I would first tokenize the code, then divide it by statement keywords.
> Finally, you just need to find expression/assignment statements in the
> remaining sections. (Maybe there is a better way to do it.)
>
>
>


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? I suspect not but this is what I
need to generate using speech recognition because it's easily spoken. A more
complex example might be something like

new base = OS path-base name (old path)

or

if OS base exists (current path): new base name = OS path base name(current path)

What's particularly cute here is that using the translation technique I can
actually describe the full object method path with a minimum of speaking
overhead. Python is great.

But the questions remain, will these tools are stuff like this?


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: simplified Python parsing question Eric S. Johansson Python 6 08-03-2012 08:04 PM
Re: simplified Python parsing question Laszlo Nagy Python 0 07-30-2012 02:59 PM
Re: simplified Python parsing question Dieter Maurer Python 0 07-30-2012 09:11 AM
simplified Python parsing question Eric S. Johansson Python 2 07-30-2012 06:17 AM
Cisco Networking Simplified - book review and a sample chapter Michael Cisco 0 11-19-2003 11:09 PM



Advertisments