Due Date: Wednesday, June 27, 2007, before or on 3:00 PM
Submission Requirements:
Write a program that will act like a scanner using the C representation below. Test your program with the following inputs:
Submission Requirements:
- computerized (word-processor-application-generated)
- printed in short bond paper
- text uses:
- font: Garamond
- size: 12 pt.
- source code uses:
- font: Courier
- size: 10 pt.
- including your test suite (input/output)
Write a program that will act like a scanner using the C representation below. Test your program with the following inputs:
- mid = (hi + lo) / 2;
- degc = (degf - 32) * (5.0 / 9);
- your sample 5 inputs.
REPRESENTING TOKENS IN C
typedef enum {
IDENT, INT_CONST, BINOP, LEFTPAREN, . . .
} TokenKind;
typedef union {
char *name;
int int_const;
. . .
} TokenValue;
typedef struct {
TokenKind kind;
TokenValue value;
} Token;
No comments:
Post a Comment