예제 #1
0
파일: calc.c 프로젝트: rukumar333/cs220
tree * getStatement(token **tokenPtr,char *buffer) {
	assert((*tokenPtr)!=NULL);
	if ((*tokenPtr)->type==LCURLY) {
		(*tokenPtr)=nextToken((*tokenPtr),buffer,false);
		tree * exp = getExpList(tokenPtr,buffer);
		if (((*tokenPtr)==NULL) || (*tokenPtr)->type!=RCURLY) {
			printf("Syntax error... unbalanced curly braces... not enough right\n");
			exit(1);
		}
		(*tokenPtr)=nextToken((*tokenPtr),buffer,false);
		return exp;
	}
	tree * asg=getAssignment(tokenPtr,buffer);
	if (asg!=NULL) return asg;
	asg = getWhile(tokenPtr,buffer);
	if (asg != NULL) return asg;
	tree * exp=getExpression(tokenPtr,buffer);
	if ((*tokenPtr)==NULL) return exp;
	if ((*tokenPtr)->type==EOS) return exp;
	printf("Syntax error... expected assignment or expression... found neither\n");
	exit(1);
}
예제 #2
0
const char * posix_error_exception::what() const noexcept {
	return ("Error occured - " + Logger::getPosixErrorDescription(getErrno()) +
			" - while " + getWhile()).c_str();
}
예제 #3
0
const char * info_exception::what() const noexcept {
	return ("Exception occured while " + getWhile()).c_str();
}