The C# Compiler

After that introduction to C# and object orientation in general, it's time to see how C# projects can be compiled. In this section, you learn how to compile more than just one file and how various classes can be combined.


Before you see how compiling works, we'll guide you through the steps of the compilation process itself.

The first thing to do is to call the lexer, which prepares tokens for the parser. In the case of Mono, the parser is based on Jay, a Java-based Berkley Port of Yacc. Miguel de Icaza ported Jay to C#. Tokens are code fragments that the system needs for checking the syntax. The syntax check is performed by a parser.

After creating a parse tree, the system starts to look for parent classes and tries ...

Get Mono Kick Start now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.