The Tower Bridge in Sacramento, California Getting Started
Programming Languages
Latest News
Getting Started
Screen Shots
About GOLD
How It Works
Why Use GOLD?
Revision History
Freeware License
More ...
What is a Parser?
Backus-Naur Form
DFA Lexer
LALR Parsing
More ...

What is a Programming Language?

When a software engineer designs and writes a program, it is often in one of the many modern programming languages available. Rather than taking on the rather tedious task of writing the program using the actual instructions used by the computer processor, the logic and behavior of the program are expressed using human-like and English-like terms. Whether the programming language is C++ or COBOL,  the representation of which actions the program is to perform and how they are actually implemented differs greatly.

Programming languages are classified by their "generation". The first programs were written in machine code - since no other programming technology had been developed. If another computer processor was designed with the same basic instruction set, but a slightly different machine code format, programs had to be completely rewritten.

This lead to the development of "second generation" programming languages: assembly. Assemblers display each instruction using a keyword rather than the binary format. This gives a layer of  abstraction between the machine code and the instruction set itself. Programs became far easier to read and write.

The disadvantage to the second generation languages was that programs could not be ported to other platforms. As a result, computer scientists designed the first "third generation" programming language: FORTRAN. Though it is not used much today, its effect on the computer industry was immense. Programs could be written in human-like and English-like terms and then later compiled and executed on different machines. When most programmers use the term "programming language", they are referring to the third generation languages such as C++, COBOL, Visual Basic, Java and Delphi.

There is, however, a catch...

To convert a modern third generation language to machine code, those human-like and English-like terms must be broken down into their different logical units. This is the job of a parser.

What is a Grammar?

A grammar is simply a formal definition of the syntax of a language. Every language has a formal syntax, and thus, a grammar.

When you describe the syntax of a language, you need to specify how each reserved word, identifier, etc... will appear. You also have to define how each of the different symbols will be organized together to form more meaningful structures. 

Even though the format used to describe a grammar can be different, the "grammar" for that language is still the same. The grammar for LISP, for instance, is constant no matter how it is written.

Next: Terminals & Regular Expressions