Chapter 3. Basic SIMPOL Grammatical Stucture
Every programming language has various characteristics about the way that it is expected to be presented that can reasonably be termed its grammar. In this chapter we will discuss the points that will assist you in writing programs in SIMPOL. Although SIMPOL derives from BASIC in some respects, like any good language there are a number of elements that differentiate it from other languages that exist.
BASIC is a line-oriented language, whereas C and Pascal are
statement-oriented. SIMPOL is mainly a statement-oriented language,
but similarly to BASIC, it is not necessary to close a string at the end
of a line, it will be done for you if you forget. More significant is
that in SIMPOL every program begins at the main()
function and ends when it returns from that function. There are no
labels nor is there any equivalent of the BASIC keywords GOTO and GOSUB.
For some programmers a more significant departure will be the total
absence of global variables. In spite of, or perhaps because of these
differences program design in SIMPOL is fast and effective and results
in very fast and easily followed and maintained code.
End of Statement Characters
There are several ways to indicate the end of a statement in SIMPOL,
using a semi-colon ;
, a colon :
, and
by starting a new line. These can also be mixed in a program, there is no
requirement that they be used consistently.