-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhw2_util.cpp
More file actions
37 lines (32 loc) · 1.25 KB
/
hw2_util.cpp
File metadata and controls
37 lines (32 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//
// Created by Saikat Chakraborty on 9/24/20.
//
#include <string>
#include <iostream>
#include "hw2_util.h"
void printCallExprReformatOutput(int lineNo, const std::string& originalSource,
const std::string& formattedSource){
std::cout << "==================================================\n";
std::cout << "Function call found at line " << lineNo << "\n";
std::cout << "Original Source\n";
std::cout << "---------------------------------------------------\n";
std::cout << originalSource << "\n";
std::cout << "---------------------------------------------------\n";
std::cout << "Formatted Source\n";
std::cout << "---------------------------------------------------\n";
std::cout << formattedSource << "\n";
std::cout << "==================================================\n";
}
void printRecursiveFunction(const std::string& functionName, bool recursive){
std::cout << functionName << " - ";
if(!recursive) {
std::cout << "non-";
}
std::cout << "recursive\n";
}
void printForStmt(int ln){
std::cout << "==================================================\n";
std::cout << "Found For Statement at line : " << ln
<< "\n";
std::cout << "==================================================\n";
}