Archived
1
0
Fork 0

Changed extensions from C style to C++ style

This commit is contained in:
Brandon Rozek 2018-09-26 19:28:55 -04:00
parent 8b5732a398
commit 3cdf1f439c
20 changed files with 53 additions and 53 deletions

View file

@ -1,7 +1,7 @@
GPP = g++ -Wall -std=c++17
sloth: src/main.c src/parser/lex.yy.o src/parser/parser.tab.o src/variables/environment.o src/variables/variable.o src/variables/value.o src/operations/node.o src/operations/operators.o src/string.o src/shell.o
$(GPP) src/main.c src/parser/lex.yy.o src/parser/parser.tab.o src/variables/environment.o src/variables/variable.o src/variables/value.o src/operations/node.o src/operations/operators.o src/string.o src/shell.o -ledit -o sloth
sloth: src/main.cpp src/parser/lex.yy.o src/parser/parser.tab.o src/variables/environment.o src/variables/variable.o src/variables/value.o src/operations/node.o src/operations/operators.o src/string.o src/shell.o
$(GPP) src/main.cpp src/parser/lex.yy.o src/parser/parser.tab.o src/variables/environment.o src/variables/variable.o src/variables/value.o src/operations/node.o src/operations/operators.o src/string.o src/shell.o -ledit -o sloth
src/parser/lex.yy.o: src/parser/lex.yy.c src/parser/parser.tab.h
$(GPP) -c src/parser/lex.yy.c -o src/parser/lex.yy.o
src/parser/parser.tab.o: src/parser/parser.tab.c
@ -12,18 +12,18 @@ src/parser/parser.tab.c: src/parser/parser.y
bison -d -o src/parser/parser.tab.c src/parser/parser.y
src/parser/lex.yy.c: src/parser/lexer.l
flex -o src/parser/lex.yy.c src/parser/lexer.l
src/variables/environment.o: src/variables/environment.h src/variables/environment.c
$(GPP) -c src/variables/environment.c -o src/variables/environment.o
src/variables/variable.o: src/variables/variable.h src/variables/variable.c
$(GPP) -c src/variables/variable.c -o src/variables/variable.o
src/variables/value.o: src/variables/value.h src/variables/value.h
$(GPP) -c src/variables/value.c -o src/variables/value.o
src/operations/operators.o: src/operations/operators.h src/operations/operators.c
$(GPP) -c src/operations/operators.c -o src/operations/operators.o
src/operations/node.o: src/operations/node.h src/operations/node.c
$(GPP) -c src/operations/node.c -o src/operations/node.o
src/shell.o: src/shell.h src/shell.c
$(GPP) -c src/shell.c -o src/shell.o
src/variables/environment.o: src/variables/environment.hpp src/variables/environment.cpp
$(GPP) -c src/variables/environment.cpp -o src/variables/environment.o
src/variables/variable.o: src/variables/variable.hpp src/variables/variable.cpp
$(GPP) -c src/variables/variable.cpp -o src/variables/variable.o
src/variables/value.o: src/variables/value.hpp src/variables/value.cpp
$(GPP) -c src/variables/value.cpp -o src/variables/value.o
src/operations/operators.o: src/operations/operators.hpp src/operations/operators.cpp
$(GPP) -c src/operations/operators.cpp -o src/operations/operators.o
src/operations/node.o: src/operations/node.hpp src/operations/node.cpp
$(GPP) -c src/operations/node.cpp -o src/operations/node.o
src/shell.o: src/shell.hpp src/shell.cpp
$(GPP) -c src/shell.cpp -o src/shell.o
src/string.o: src/string.h src/string.c
$(GPP) -c src/string.c -o src/string.o
clean:

View file

@ -1,7 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "sloth.h"
#include "shell.h"
#include "sloth.hpp"
#include "shell.hpp"
void interpret_file(char* fileName);

View file

@ -2,12 +2,12 @@
#include <stdlib.h>
#include <string>
#include <assert.h>
#include "node.h"
#include "operators.h"
#include "../constants.h"
#include "node.hpp"
#include "operators.hpp"
#include "../constants.hpp"
#include "../parser/parser.tab.h"
#include "../variables/value.h"
#include "../variables/variable.h"
#include "../variables/value.hpp"
#include "../variables/variable.hpp"
/* creates a new node and returns it */
struct Node* make_node(int type, struct Value* value, std::string id) {

View file

@ -2,8 +2,8 @@
#define NODE_H
#include <string>
#include "../variables/value.h"
#include "../variables/environment.h"
#include "../variables/value.hpp"
#include "../variables/environment.hpp"
#define ID_SIZE 100
#define MAX_CHILDREN 3

View file

@ -1,8 +1,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "operators.h"
#include "../variables/value.h"
#include "operators.hpp"
#include "../variables/value.hpp"
struct Value* add(struct Value* x, struct Value* y) {
if (!x || !y) { fprintf(stderr, "Error, uninitialized values being used in add.\n"); }

View file

@ -1,6 +1,6 @@
#ifndef OPERATORS_H
#define OPERATORS_H
#include "../variables/value.h"
#include "../variables/value.hpp"
struct Value* add(struct Value* x, struct Value* y);
struct Value* subtract(struct Value* x, struct Value* y);

View file

@ -1,8 +1,8 @@
%{
#include <stdio.h>
#include <string.h>
#include "../operations/node.h"
#include "../variables/value.h"
#include "../operations/node.hpp"
#include "../variables/value.hpp"
#include "parser.tab.h"
#include "../string.h"

View file

@ -1,9 +1,9 @@
%{
#include <stdio.h>
#include <stdlib.h>
#include "parser.h"
#include "../operations/node.h"
#include "../constants.h"
#include "parser.hpp"
#include "../operations/node.hpp"
#include "../constants.hpp"
%}

View file

@ -1,10 +1,10 @@
#include <stdio.h>
#include <string.h>
#include "shell.h"
#include "parser/parser.h"
#include "variables/environment.h"
#include "operations/node.h"
#include "constants.h"
#include "shell.hpp"
#include "parser/parser.hpp"
#include "variables/environment.hpp"
#include "operations/node.hpp"
#include "constants.hpp"
// For keeping track of command history

View file

@ -1,12 +0,0 @@
#ifndef SLOTH_H
#define SLOTH_H
#include "constants.h"
#include "operations/node.h"
#include "variables/value.h"
#include "variables/variable.h"
#include "variables/environment.h"
#include "parser/parser.h"
#include "parser/parser.tab.h"
#endif

12
src/sloth.hpp Normal file
View file

@ -0,0 +1,12 @@
#ifndef SLOTH_H
#define SLOTH_H
#include "constants.hpp"
#include "operations/node.hpp"
#include "variables/value.hpp"
#include "variables/variable.hpp"
#include "variables/environment.hpp"
#include "parser/parser.hpp"
#include "parser/parser.tab.h"
#endif

View file

@ -1,8 +1,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "environment.h"
#include "variable.h"
#include "environment.hpp"
#include "variable.hpp"
struct Environment* create_environment(void) {
struct Environment* env = new Environment();

View file

@ -1,5 +1,5 @@
#include <stdlib.h>
#include "value.h"
#include "value.hpp"
#include <string>
#include <iostream>
#include "../parser/parser.tab.h"

View file

@ -1,7 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "variable.h"
#include "variable.hpp"
/* creates a new variable and returns it */
struct Variable* make_variable(char* id, struct Value* value) {

View file

@ -1,7 +1,7 @@
#ifndef VARIABLE_H
#define VARIABLE_H
#include "../operations/node.h"
#include "../operations/node.hpp"
struct Variable {
char id[ID_SIZE];