How compilers work

Conclusion

This article offered a brief look at how compilers parse and prepare source code. Keep in mind that not all compilers adhere to the approach described in this article. For example, one-pass compilers do without an internal representation of the code and generate the object code in a single pass. Also, the steps presented in this article sometimes do not occur in distinct phases but are, instead, interwoven.

Infos

  1. Compiler construction lecture notes (in German): http://www.staff.uni-giessen.de/~gc1079/
  2. Flex: https://github.com/westes/flex
  3. Bison: https://www.gnu.org/software/bison/

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Perl: Parser

    Lexers and parsers aren’t only for the long-bearded gurus. We’ll show you how you can build a parser for your own custom applications.

  • Parrot

    Parrot is an all-in-one tool for developing and executing new programming languages. Perl 6 runs on Parrot; chances are your language can run on it, too.

  • Compiler Design - Terror in the classroom
  • Rust Language

    We look at a few features of Rust, Mozilla's systems programming language, and its similarity to other languages.

  • JavaScript Alternatives

    JavaScript is the stuff of which many interactive web clients is made, but it comes with a fair amount of historical ballast. The creators of four alternative scripting languages seek to ditch the ballast.

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95

News