Next: Language and Grammars
Up: No Title
- Formally, a language is a set of flat strings (sentences)
- In practice, each string in a language has a structure
which can be described by a tree.
- Structure rules for sentences are defined by a grammar
- The sentences of a programming language are (legal) programs.
- Programs are sentences of tokens (words). The structure
of a program is given by a context-free grammar.
- Words themselves are sequences of characters, the structure
of words can also be given by a grammar.