Make your own compiler, interpreter, parser, or expression analyzer
Lex and Yacc
Two of the oldest unix tools. Lex is a lexical analyser (token parser), and Yacc is a Look Ahead Left-to-Right (LALR) parser generator. BNF notation is used as a formal way to express context free grammars. Code and grammar are mixed, so grammar is tied to implementation language.
Plex and Pyacc
Plex and Pyacc are pascal implementations of Lex and Yacc and they are part of your FreePascal distribution.
Lazarus Lex and Yacc
You can find Lazarus Lex and Yacc here.