Compilers and Hardware Constraints
Programming in high-level languages such as C is like crossing
an ocean without spending time looking at the water.
developerWorks spent an hour with two IBM Research Compiler
programmers exploring the ecosystem that lies beneath the
surface.
Data alignment: Straighten up and fly right
Data alignment is an important issue for all programmers who directly use memory. Data alignment affects how well your software performs, and even if your software runs at all. As this article illustrates, understanding the nature of alignment can also explain some of the "weird" behaviors of some processors.
Expressions, Conversion and Evaluation with C
This tutorial is a complete guide to Algebraic
Expressions, their different Notations etc. Detailed
coverage on how to convert expression from one
notation to another and Evaluation of Expression in
different notations. Algorithms, illustrative
examples, schematics and included programs help to
understand the concepts more clearly and easily.
Fast tokenizer
Fast tokenizer for C++ - like 'lexx'. The project is a fast
lexical analyzer/tokenizer and should be quite easy to use. The
demo application lets the user enter a text and scans it for a
predefined set of tokens which could be used by a calculator.
Garbage Collection FAQ
This a FAQ about Garbage Collection and GC is a part of a language's runtime system, or an add-on library, perhaps assisted by the compiler, the hardware, the OS, or any combination of the three, that automatically determines what memory a program is no longer using, and recycles it for other use. It is also known as ``automatic storage (or memory) reclamation.
Handle Your Errors Using Flex and Bison
Flex and Bison are powerful tools for developing lexical and grammar parsers, in particular language compilers and interpreters. Although it is easy to generate programs using Flex and Bison, it is a bit harder to make those programs produce user-friendly syntax and semantic error messages. This article examines the error-handling features of Flex and Bison, shows how to use them, and details some pitfalls.
Lexical Analyzer
Lexical analysis involves scanning the program to be compiled and recognizing the tokens that make up the source statements Scanners or lexical analyzers are usually designed to recognize keywords, operators, and identifiers, as well as integers, floating point numbers, character strings, and other similar items that are written as part of the source program. The exact set of tokens to be recognized of course, depends upon the programming language being used to describe it.
Parse your Text with Yacc and Lex
Examine the processes behind building a parser using the lex/flex and yacc/bison tools, first to build a simple calculator and then delve into how you can adopt the same principles for text parsing. Parsing text is an important part of many applications. Within UNIX, several elements of the OS rely on parsing text, from the shell you use to interact with the system, through to common tools and commands like awk or Perl, right through to the C compiler you use to build software and applications.