Programs and data , Python Programming

Programs and Data

Object-oriented programming is a popular way  of managing programs, which  groups together data  with  the procedures that  works on them,  thus  facilitating some  types  of abstraction and modularity.  In the case  of our  PCAP  framework, object-oriented programming can provides us methods for capturing common patterns in data and the procedures that operate on that data, via procedures, generic  class, and inheritance.

 

In many  computer languages, adding Python, programs are  studied and  executed by a computer program known as  an interpreter. Interpreters are surprisingly easy:  the principle  de?ning the semantics or meaning of a programming language are typically short and compact;  and the in­ terpreter basically  encodes these rules and applies them to any legal expression in the language. The enormous complexity and  richness of computer programs comes  from  the  composition of primitive elements with  simple  principle.   The interpreter, in essence,  shows the  semantics of the language by taking the rules  governing the value  or behavior of program primitives, and  of what  it seems to collide the primitives in various paths.  We will examine the meaning of computer programs by understanding how the interpreter operates on them.

 

An interpreter is build  up of four sections:

 

  • The reader or tokenizer takes as input a string of characters and divides them into tokens, which are numbers (like -3.42), words (like while or a), and special characters (like :).

 

  • The parser gets as input the string of tokens and understands them as constructs in the programming language, such as for loops, procedure de?nitions, or return variable.

 

  • The evaluator (which is also sometimes called the interpreter, as well) has the really interesting job of determining the value and effects of the program that you ask it to interpret.

 

  • The printer gets the value given by the evaluator and prints it out for the user to see.

 

Programs should never  be a mystery to you:  you can learn  the simple  semantic rules  of the language  and, if compulsory, examine what  the interpreter would do, in order  to study any computer code which  you are acting.  Of course,  in general, one does  not has  to work  through the tedious procedure  of simulating the interpreter, but this foundation of calculating the interpreter 's process  enables  you to reason  about  the evaluation of any program. #question..

 

Posted Date: 8/11/2012 1:25:30 AM | Location : United States







Related Discussions:- Programs and data , Assignment Help, Ask Question on Programs and data , Get Answer, Expert's Help, Programs and data Discussions

Write discussion on Programs and data
Your posts are moderated
Related Questions
Bank transfer What  if we  have  two  values,  representing bank  accounts, and  need  to transfer an  amount of money  amt between them?  Consider that a bank account is show

#Why can''t I cd my Desktop? A minute ago I would open up cmd and it starts in C:\Users\myname but now it''s starting in C:\WINDOWS\system> and I don''t where I am or how to get ou

Define a function that draws a pentagon of a size you provide when you call the function. Include a ''''''docstring'''''' as the first line of the function''s body — it tells the p

Perimeter of a polygon Now, let's consider the problem of computing the length  of the perimeter of a polygon. The input is a structure of vertices,  encoded as a list of list

Write an algorithm for a program that shows the use of all 6 math functions. Write, test, and debug the program using Python. SAMPLE OUTPUT (not including author/program infor

Coding examples Following are some  attempts at defining a function isSubset,  which  takes  two  arguments, a and  b, and  returns True if a is a subset  of b, assuming that

Write a program that requests a password after the author/program information is displayed. Make the password "hello". The program should then ask the user for their name: if the n

#que Write a program that will take price data for stocks and print it graphically to the screen. Your program should begin by asking the user for the file name. It should then cre

Tuples  and strings Python has two different more list-like data  types  that are very important to understand.A tuple  is a structure that  is like a list, but  is not  mutab

Environments in Python Generally, Python establishes the following binding environments: 1.  builtin     : the mother of all environments: it contains the de?nitions of