Re: simplified Python parsing question

Discussion in 'Python' started by Laszlo Nagy, Jul 30, 2012.

  1. Laszlo Nagy

    Laszlo Nagy Guest


    >
    > 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. :-(
    Laszlo Nagy, Jul 30, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Grey

    simplified chinese encoding

    Grey, Apr 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    489
  2. Eric S. Johansson

    simplified Python parsing question

    Eric S. Johansson, Jul 30, 2012, in forum: Python
    Replies:
    2
    Views:
    181
    Eric S. Johansson
    Jul 30, 2012
  3. Dieter Maurer

    Re: simplified Python parsing question

    Dieter Maurer, Jul 30, 2012, in forum: Python
    Replies:
    0
    Views:
    113
    Dieter Maurer
    Jul 30, 2012
  4. Eric S. Johansson

    Re: simplified Python parsing question

    Eric S. Johansson, Jul 30, 2012, in forum: Python
    Replies:
    0
    Views:
    135
    Eric S. Johansson
    Jul 30, 2012
  5. Eric S. Johansson

    Re: simplified Python parsing question

    Eric S. Johansson, Jul 30, 2012, in forum: Python
    Replies:
    6
    Views:
    197
    BartC
    Aug 3, 2012
Loading...

Share This Page