13.07.2015 Views

apple-pascal-1.3-manual

apple-pascal-1.3-manual

apple-pascal-1.3-manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

esult is called a compound statement. As noted earlier, the body of everyPascal procedure and function, as well as every main program, consists of asingle compound statement. Here is the syntax diagram for the compoundstatement:1--..,,....-M statement 1---....-HThe arrow coming back through the semicolon indicates that manystatements may be placed between BEGIN and END, as long as they areseparated by semicolons.You can nest any number of BEGIN ... END statements. Within any block,the Compiler will associate the last BEGIN with the first END, thenext-to-last BEGIN with the second END, and so on. If you haven't writtenan equal number of BEGINs and ENDs, the Compiler will stop and displayan error message. In complicated programs it is advisable to mark BEGINsand ENDs with comments, so you can keep them straight. Comments arediscussed at the end of this chapter.Expression SyntaxAn expression may consist of a single symbol, or a sequence of symbols ofpractically any length. Every expression contains at least one constant orvariable reference, which has a value. The expression may also containother symbols (such as arithmetic or logical operators) that modify orcombine the values of its constants or variable references. As a result, everyexpression as a whole also has a value. This value is used or manipulatedby the statement of which the expression is a part.The rules for composing valid expressions are complex. They are discussedin detail at the beginning of Chapter 6.Symbol SyntaxWithin each Pascal expression, there are general rules you must followwhen writing individual symbols. They are explained in this section.Pascal SyntaxIII-19

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!