Skip to content

Commit 46a5f11

Browse files
author
robertDurst
committed
some more file cleanup, mostly file headers and renaming
1 parent e46899e commit 46a5f11

File tree

15 files changed

+148
-117
lines changed

15 files changed

+148
-117
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set(CMAKE_CXX_STANDARD 17)
77
ADD_LIBRARY(SailfishcLibs
88
./src/lexar/Lexar.cpp
99
./src/lexar/Token.cpp
10-
./src/parser/Parser.cpp
10+
./src/sailfish/sailfishc.cpp
1111
./src/errorhandler/ParserErrorHandler.cpp
1212
./src/errorhandler/SemanticAnalyzerErrorHandler.cpp
1313
./src/main/CommandLine.cpp

src/common/display.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
*
55
* Base structure and credit:
66
* https://stackoverflow.com/questions/2616906/how-do-i-output-coloured-text-to-a-linux-terminal
7+
*
8+
* Simple utility class for displaying formatted messages.
79
*/
810
#pragma once
911
#include <ostream>

src/errorhandler/Error.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/*
22
* Robert Durst 2019
33
* Sailfish Programming Language
4+
*
5+
* Simple utility class for formatting and displaying various types of errors.
46
*/
57
#pragma once
68
#include "../common/display.h"

src/errorhandler/ParserErrorHandler.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/*
22
* Robert Durst 2019
33
* Sailfish Programming Language
4+
*
5+
* Parser handles errors related to lexing and parsing.
46
*/
57
#pragma once
68
#include "Error.h"

src/errorhandler/SemanticAnalyzerErrorHandler.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/*
22
* Robert Durst 2019
33
* Sailfish Programming Language
4+
*
5+
* Semantic Analyzer Error Handler handles errors related to Semantic Analysis.
46
*/
57
#pragma once
68
#include "Error.h"

src/lexar/Lexar.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/*
22
* Robert Durst 2019
33
* Sailfish Programming Language
4+
*
5+
* Lexar encapsulates the logic for retreiving tokens one by one from a given
6+
* source code text file.
47
*/
58
#pragma once
69
#include "Token.h"

src/lexar/Token.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/*
22
* Robert Durst 2019
33
* Sailfish Programming Language
4+
*
5+
* Tokens are objects with a kind and a value.
46
*/
57
#pragma once
68
#include <iostream>

src/main/CommandLine.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ fullCompilation(const std::string& filename)
5353

5454
std::cout << "Compiling " << blue << filename << normal << ".\n";
5555

56-
Parser* p = new Parser(filename);
57-
p->parse();
56+
sailfishc* sfc = new sailfishc(filename);
57+
sfc->parse();
5858

5959
std::cout << green << "Successfully compiled: " << normal << blue
6060
<< filename << "\n"
6161
<< normal;
6262

63-
p->transpile();
63+
sfc->transpile();
6464

6565
std::cout << green << "Successfully wrote compiled code to: " << normal
6666
<< blue << " out.c\n"

src/main/CommandLine.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
/*
22
* Robert Durst 2019
33
* Sailfish Programming Language
4+
*
5+
* CommandLine handles the basic command line utilities for the compiler.
46
*/
57
#pragma once
68
#include "../common/display.h"
79
#include "../lexar/Lexar.h"
8-
#include "../parser/Parser.h"
10+
#include "../sailfish/sailfishc.h"
911
#include <iostream>
1012
#include <stdlib.h>
1113
#include <string>

0 commit comments

Comments
 (0)