/**************************************************

 * File: scan.h         Project by: David Hodgdon *

 * Class: ECE476        Instructor: Bruce Land    *         

 *************************************************/
#ifndef SCAN_H
#define SCAN_H
#include <stdio.h>
#define fname "test/mary.bas"

enum ScanSymbol{ScanIdent, ScanNum, ScanStr, ScanEOF, ScanEOL, ScanPlus, ScanMinus, ScanTimes, ScanDiv, ScanExpon, ScanNewStatement, /*ScanAssign,*/
	ScanIntegerVar, ScanRealVar, ScanStringVar,
	ScanComma, ScanLeftParen, ScanRightParen,ScanSemicolon,
	ScanEqual, ScanLessThanEqual, ScanGreaterThanEqual, ScanGreaterThan, ScanLessThan, ScanNotEqual,
	ScanAND, ScanOR, ScanNOT,
	ScanFOR, ScanGOSUB, ScanNEXT, ScanSTEP, ScanGOTO, ScanIF, ScanTHEN, ScanTO,
	ScanDATA, ScanREAD, ScanLET,  ScanPRINT, ScanREM, ScanINPUT,
	ScanINT, ScanDIM, ScanLEN, ScanRAND, ScanREAL, ScanSND, ScanHOME};

extern float scanRealValue;	// floating point number appearing in code

extern int scanIntValue;		// integer value appearing in code +-32K, 16bit integer

extern char scanIsFloat;		// 1=number is FP, 0=number is INT

extern char equalCount;	// must be reset to ZERO for each "line"!!!!!!!


extern char c, cBackup;			// current character in code


#ifndef ATMEL
extern FILE *f; extern FILE *fBackup;			// file pointer, only for testing on PC

#endif


#define TEMPLEN 60
extern char tempStr[TEMPLEN+1];

void ScanSkipLine();
void ScanInit();
void ScanClose();
enum ScanSymbol ScanGetSymbol();
#ifdef ATMEL
void ScanError(flash char * err);
#else 
void ScanError(char * err);
#endif


#ifdef ATMEL
void ScanReopenForATMEL();
#endif


#ifdef ATMEL
void ScanDebug(flash char *err);     
#else 
void ScanDebug(char *err);  
#endif

#endif