Thread: Can someone explain how Python code parser works?

  1. #1
    Registered User
    Join Date
    Feb 2014
    Location
    Warsaw, Poland
    Posts
    3

    Question Can someone explain how Python code parser works?

    Hello guys. As a programmer of Python who wants to move to C/C++ I'd like to understand how Python code parser works . Can someone explain? Thanks

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Why is understanding how a Python code parser works necessary in order to move from Python to C/C++?
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  3. #3
    Registered User
    Join Date
    Feb 2014
    Location
    Warsaw, Poland
    Posts
    3
    Quote Originally Posted by grumpy View Post
    Why is understanding how a Python code parser works necessary in order to move from Python to C/C++?
    It is not necessary. I just want to understand how the Python code parser works

  4. #4
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    What happens when you Google "how python interpreter works", "how interpreter works" or "how compiler works"? Those seemed to give lots of good information, I suggest you read through several links and see what you can understand from them. If you're still confused or need help then come on back and ask some more specific questions. There's lots of existing, well-written information with diagrams and whatnot, which is far more effective than asking a forum for an impromptu lesson.

    Note, you should clarify if it's just the parser you're interested in, or the whole interpreter, etc. Familiarizing yourself with the vocabulary well enough to ask an accurate question is very helpful.

  5. #5
    Registered User
    Join Date
    Feb 2014
    Location
    Warsaw, Poland
    Posts
    3
    Quote Originally Posted by anduril462 View Post
    What happens when you Google "how python interpreter works", "how interpreter works" or "how compiler works"? Those seemed to give lots of good information, I suggest you read through several links and see what you can understand from them. If you're still confused or need help then come on back and ask some more specific questions. There's lots of existing, well-written information with diagrams and whatnot, which is far more effective than asking a forum for an impromptu lesson.

    Note, you should clarify if it's just the parser you're interested in, or the whole interpreter, etc. Familiarizing yourself with the vocabulary well enough to ask an accurate question is very helpful.
    Yeah, I will take a look . I didn't think about google for some reason....
    And I am interested ONLY in parser. After reading some stuff in Wikipedia, I understand how compilers and interpreters work.
    I thought code is parsed by regexes, but after taking a quick look thought the source code, I found out that it uses no regexes (or at least I didn't noticed any), and I got interested how the language is parsed

  6. #6
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    Note, if you're concerned specifically about Python and how it chooses to do these things, rather than the general idea behind parsing, consider downloading the Python interpreter source code as well.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 06-13-2012, 06:49 PM
  2. C++ Parser Code Problem
    By pipercubusa in forum C++ Programming
    Replies: 6
    Last Post: 03-17-2005, 09:17 PM
  3. Pls explain how this program works...
    By Unregistered in forum C Programming
    Replies: 9
    Last Post: 01-05-2002, 09:53 AM
  4. Can someone explain how this function works?
    By Drew in forum C++ Programming
    Replies: 1
    Last Post: 12-26-2001, 01:09 PM

Tags for this Thread