Stage 1 of the
Klein compiler project
OUT: Thursday, August 31
DUE: Friday, September 15
STATUS CHECK DUE: Friday, September 8
This stage consists of one component of your Klein compiler and three auxiliary programs.
Write a scanner for Klein.A scanner is a function or object that takes as input a string or sequence of characters and produces as output a sequence of Klein tokens.
Write a program that uses your scanner to produce a listing of all the tokens in a valid Klein program.Display one token per line. For tokens with semantic content, such as an identifier or a number, display the content, too. For test program print-one.kln, it might generate:
keyword function identifier main leftparen rightparen separator typename integer identifier print leftparen integer 1 rightparen integer 1
Write at least one meaningful legal program in Klein.Your test program should be at least at the level of an early CS1 program. If you are stumped for where, try one of these ideas.
Create an executable or a Unix command-line script named kleins that takes the name of a Klein program as an argument and runs your token-listing program on it.This will be the first in a series of tools that makes up the command-line suite of your Klein compiler.
Submit only one copy of each assignment per team, both electronically and on paper. The team captain or a designated team member can be responsible for the submission.