1 / 10

Prog . techniques

Prog . techniques. Standard prog . techniques. Complex programs can be broken down into simpler parts called “Modules” These come in 2 types,“Procedures ” and “Functions This allows multiple programmers to work on the same project at the same time

luther
Download Presentation

Prog . techniques

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Prog. techniques

  2. Standard prog. techniques • Complex programs can be broken down into simpler parts called “Modules” • These come in 2 types,“Procedures” and “Functions • This allows multiple programmers to work on the same project at the same time • This means you can assign more complex modules to higher level programmers

  3. E.G school reports

  4. Parameters • variables passed to modules • Can be declared when calling the module or declared inside the module itself • These are known as “Local” variables • Local variables reset once the module is exited • Variables that have to be used by multiple modules are called “Global” variables

  5. Calling procedures • When a procedure is called, the computer has to save the location of the current module so that it can return once finished • This is ok for simple programs when only 1 procedure is called at a time but when multiple procedures need to be called, the computer has to store the locations in order • This can be done through the use of a stack (first in, last out)

  6. Defining syntax • Languages do not evolve but are invented • The language must stick to a set of rules so that the translator can run correctly • Each set of rules are language specific • “for i = 0 to 5” in VB • For(i=0;i<=5;i++){ in AS2

  7. Terminal symbols • These are the base characters (e.g. A, B, C, 1, 2, 3, etc) • ABC is a combination of letters – can be described as “Letter, letter, letter” • A is not a combination as it is a base character

  8. BNF • In BNF, you can define combinations using this syntax • ::= “Is defined as” • | “Or” • E.g. <WORD>::=<LETTER><LETTER><LETTER> • This allows words exactly 3 characters large • To allow for unlimited characters, you can nest the definition • E.G <WORD>::=<LETTER><LETTER>|<WORD><LETTER>

  9. Syntax Diagrams • This is a more visual method for defining syntax • Combinations are shown in flow graph format • E.G

  10. Reverse Polish

More Related