www.pudn.com > pascallex.rar > pascal.cpp


#include "stdafx.h"
#include "common.h"
#include "lex.h"
#include "string.h" 
#include  
 
int main(int argc, char* argv[]) 
{
	if(argc>1) 
	{
		strcpy(sourcefile,argv[1]);
		register char* cp;
		cp=&sourcefile[strlen(sourcefile)]-1;
		yyin=fopen(sourcefile,"r");
		while((cp>=sourcefile)&&(*cp!='.')&&(*cp!='\\'))cp--;
		if(*cp=='.')*cp=0;
	}
 
#ifdef _DEBUG
	else{
		strcpy(sourcefile,"example");
		yyin=fopen("example.pas","r");
	}
#endif
	if(yyin==NULL){
		cout<<"请在屏幕输入源文件,按ctrl+z结束输入"<