C-Grammar - A Grammar for the C- Programming Language...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
A Grammar for the C- Programming Language (version S07) January 12, 2007 1 Introduction This is a grammar for the C- programming language. This language is very similar to C and has a lot of features in common with a real-world structured programming language. There are also some real differences between C and C-. For instance the declaration of procedure arguments, allowable variable names, what constitutes the body of a procedure etc. For the grammar that follows here are the types of the various elements by type font: Keywords are in this type font. TOKEN CLASSES ARE IN THIS TYPE FONT. Nonterminals are in this type font. The symbol ± means the empty string. 1.1 Some Token Definitions letter = a | . . . | z | A | . . . | Z digit = 0 | . . . | 9 ID = letter + digit * NUM = digit + Also note that white space is ignored except that it must separate ID ’s, NUM ’s, and keywords. Comments
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

C-Grammar - A Grammar for the C- Programming Language...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online