//cs657 project
//micro-Pascal Scanner
//Author:Guangming Xing
//Date:Apr 5 1998
#include<iostream.h>
#include<ctype.h>
#include<stdlib.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#define KEYNUM 17 
typedef enum
{
 IDLE,     //white space		0
 WHITESPACE,     //white space or Tab	1
 COMMENT_CB,     //{ for comment	2
 COMMENT_RB,     //(* for comment	3
 IDENTIFIERPRO,  //identifier processing4
 NUMBERPRO,    //number processing	5
 REALNUMPRO,   //real Number pro	6
 EXPONENTPRO,   //Exponent Processing	7
 STRPRO        //String Processing	8

} STATES;


typedef enum
{
 ID,        //it is an Identifier	0	
 INT_CONST, //Integer Constant		1
 FLOAT_CONST,//Float Constant		2
 STRING_CONST,//String Constant		3
 LEFT_C_B,//Left Curly Bracket		4
 RIGHT_C_B,//Right Curly Bracket	5
 SLASH,   //Slash /			6
 QUOTE,   //Quote '			7
 COMMA,   //Comma ,			8
 STAR,    //Star *			9
 PLUS,    //Plus +			10
 MINUS,   //Minus -			11
 ENDFILE,    //End of file   		12
 EQU,     //Equal			13
 LESSEQU,//Less or Equal		14
 LESS,    //Less			15
 GREATEQU,//Greater or Equal		16
 GREAT,    //Greater			17
 NON_EQU,   //Not Equal			18
 ASSIGN,    //Assign			19
 SEMICOLON,//Semi Colon ;		20
 DOT,      //Dot .			21
 LEFT_R_B, //Round Bracket		22
 LEFT_RECT_B,  //Rectangle Bracket	23
 BEGIN,   //Begin			24
 END,     //End				25
 WHILE,   //While			26
 DO,      //Do				27
 REPEAT,  //Repeat			28
 UNTIL,   //Until			29
 IF,      //If				30
 THEN,    //Then			31
 ELSE,    //Else			32
 PROGRAM,//Program			33
 VAR,    //Var				34
 PROCEDURE,//Procedure			35
 TYPE,      // 	Type    		36
 RECORD,     //Record 			37
 DIV,      //Div			38
 ARRAY ,   //Array			39
 OF,       //of				40
 UNUSED ,   //For Unusded		41
 RIGHT_R_B,//Right Round Bracket	42
 RIGHT_RECT_B,//Right Rect Bracket	43
 BOUND,      //two dots for array	44
 COLON      //Colon :			45
} TOKEN_TYPE;

typedef struct {
TOKEN_TYPE Token_Type;//The type of a Token like:Integer Constant....
char       token[64];//If needed what is the Token
} TOKEN;

void Get_Lex(TOKEN_TYPE);
TOKEN Get_Token(void);
void Comment_CB_Pro(void);
void Comment_RB_Pro(void);
void Number_Pro(void);
void Identifier_Pro(void);
void String_Pro(void);
void Real_Number_Pro(void);
void Exponent_Pro(void);
void Err_Pro(void);
void Next_Char();



 
