Can someone explain how Python code parser works?

This is a discussion on Can someone explain how Python code parser works? within the Tech Board forums, part of the Community Boards category; Hello guys. As a programmer of Python who wants to move to C/C++ I'd like to understand how Python code ...

  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,295
    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%.

  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,496
    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,496
    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, 08:17 PM
  3. Pls explain how this program works...
    By Unregistered in forum C Programming
    Replies: 9
    Last Post: 01-05-2002, 08:53 AM
  4. Can someone explain how this function works?
    By Drew in forum C++ Programming
    Replies: 1
    Last Post: 12-26-2001, 12:09 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21