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.

Compiling

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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.