summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlfie Eagleton <67986414+TheAlfanator@users.noreply.github.com>2021-12-14 23:55:11 +0000
committerAlfie Eagleton <67986414+TheAlfanator@users.noreply.github.com>2021-12-14 23:55:11 +0000
commit44844aec87c0307a963a1c1ee3ef26f2650ab301 (patch)
tree6e1b07a3ba69b56a16628459a2e1eed9ba46ea7b
parentefe1d46b8ac2d63e2a824956e5e10e17a55e2ce8 (diff)
downloadesotericFORTRAN-44844aec87c0307a963a1c1ee3ef26f2650ab301.tar.gz
esotericFORTRAN-44844aec87c0307a963a1c1ee3ef26f2650ab301.zip
Agile development - Ch5 updates
-rw-r--r--report/esoteric_project_report.pdfbin317112 -> 320097 bytes
-rw-r--r--report/esoteric_project_report.tex49
-rw-r--r--src/Compiler/.idea/misc.xml6
-rw-r--r--src/Compiler/.idea/modules.xml8
-rw-r--r--src/Compiler/.idea/vcs.xml6
-rw-r--r--src/Compiler/.idea/workspace.xml33
6 files changed, 96 insertions, 6 deletions
diff --git a/report/esoteric_project_report.pdf b/report/esoteric_project_report.pdf
index c82cdf3..7d70c58 100644
--- a/report/esoteric_project_report.pdf
+++ b/report/esoteric_project_report.pdf
Binary files differ
diff --git a/report/esoteric_project_report.tex b/report/esoteric_project_report.tex
index 690b57d..82c4e2c 100644
--- a/report/esoteric_project_report.tex
+++ b/report/esoteric_project_report.tex
@@ -47,11 +47,6 @@
%\pagenumbering{roman}
%\newpage
-
-\begin{abstract}
-ABSTRACT INCOMPLETE
-\end{abstract}
-
\chapter{Introduction}
\label{chap:intro}
\section{Project Statement}
@@ -309,8 +304,50 @@ Conditions could include ``have they written \texttt{int} before this keyword''
The above code represents our decision making when it comes to identifying statements. We have two primary algorithms in this class; \texttt{matchAndAdvance()} and \texttt{matchOrError()}.
\subsection{matchAndAdvance()}
-asdf
+We have a function which tries to match the grammar of each token, and executes code depending on whether all the conditions were met. \texttt{matchAndAdvance()} takes a TokenType variable and checks if it matches what was expected. If so, it advances and keeps iterating until the end of the file is met. If not, it returns an error since something unexpected occurred. An example of where this function is used is in our Statement methods, where we check whether the following code is a statement or not. This is below, in Figure 5.3.
+
+
\subsection{matchOrError()}
+Our \texttt{matchOrError()} function does very similar to our previously mentioned \texttt{matchAndAdvance()}, with the exception of if something unexpected happens during the program's analysis, it will throw an error and display on the UI of our program, giving us feedback on what is causing the problem in our code.
+
+\section{Expression.java \& Statement.java}
+Programs are generally made up of expressions and statements. This is why we made abstract classes Expression.java and Statement.java. In our Expression class, we create a binary expression, which is when left and right objects are created, separated by an operator. This for example could be \texttt{5 * 4 + 3 * 6}. Here, our left and right operands are 5 * 4 and 3 * 6, separated by a PLUS token type. This can further be broken down by the numbers separated by the multiplication sign. Our Statements are lists of blocks which have a certain type, whether they are Prints or conditionals, or even iterables such as Whiles. An expression is also a statement, so we also accounted for having an ExpressionStatement. Ultimately, we have many functions in these abstracts which return certain types for each statement or expression, and this can be used for identification when our Parser eventually reads input.
+
+\section{Translator.java \& ExecuteC.java}
+Our translator file takes our list of statements previously analysed by our chain process, going through out lexer and parser, and one by one is converted into C code which can then be executed as it would normally to provide an output. We store these staments in an ArrayList and simply iterate over them using functions such as compileToC(), where for each statement, we evaluate it and add it to a text file which is eventually printed to the UI.
+
+\section{Agile \& Project Management}
+We worked well as a team. There were little issues. We decided to use the Agile method since it would lead to not only increased team communication, but better organisation when it came to our code. It also meant our development was flexible; we could choose what we wanted to work on at a given time with the use of sprints. \newline
+
+During our allocated project time, we did four major sprints. Our initial priority was creating the main framework for the compiler of our esoteric language. Then we handled variables and print statements. Then implemented conditionals and loops. Finally, we tackled arrays and functions. Once we tied up these loose ends, we could actually make a full Sieve of Eratosthenes algorithm to show the capability of the program. \\
+
+\subsection{Sprint 1: Creating the framework for the compiler}
+\begin{itemize}
+\item Language.java
+\item Token.java
+\item TokenScanner.java
+\item TokenType.java
+\end{itemize}
+
+\subsection{Sprint 2: Variables and Print statements}
+\begin{itemize}
+\item Parser.java
+\item Expression.java
+\item Statement.java
+\end{itemize}
+\subsection{Sprint 3: Conditionals and loops}
+\begin{itemize}
+\item Parser.java
+\item Utils.java
+\end{itemize}
+\subsection{Sprint 4: Arrays \& functions}
+\begin{itemize}
+\item Parser.java
+\item Environment.java
+\item ExecuteC.java
+\item Translator.java
+
+\end{itemize}
\chapter{Implementation}\label{Impl}
diff --git a/src/Compiler/.idea/misc.xml b/src/Compiler/.idea/misc.xml
new file mode 100644
index 0000000..40674af
--- /dev/null
+++ b/src/Compiler/.idea/misc.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_15" project-jdk-name="15" project-jdk-type="JavaSDK">
+ <output url="file://$PROJECT_DIR$/out" />
+ </component>
+</project> \ No newline at end of file
diff --git a/src/Compiler/.idea/modules.xml b/src/Compiler/.idea/modules.xml
new file mode 100644
index 0000000..ca63ec2
--- /dev/null
+++ b/src/Compiler/.idea/modules.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectModuleManager">
+ <modules>
+ <module fileurl="file://$PROJECT_DIR$/Compiler.iml" filepath="$PROJECT_DIR$/Compiler.iml" />
+ </modules>
+ </component>
+</project> \ No newline at end of file
diff --git a/src/Compiler/.idea/vcs.xml b/src/Compiler/.idea/vcs.xml
new file mode 100644
index 0000000..b2bdec2
--- /dev/null
+++ b/src/Compiler/.idea/vcs.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="VcsDirectoryMappings">
+ <mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
+ </component>
+</project> \ No newline at end of file
diff --git a/src/Compiler/.idea/workspace.xml b/src/Compiler/.idea/workspace.xml
new file mode 100644
index 0000000..56a48e0
--- /dev/null
+++ b/src/Compiler/.idea/workspace.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ChangeListManager">
+ <list default="true" id="00907318-3381-4b49-a9e1-c4d601fc6923" name="Default Changelist" comment="" />
+ <option name="SHOW_DIALOG" value="false" />
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+ <option name="LAST_RESOLUTION" value="IGNORE" />
+ </component>
+ <component name="Git.Settings">
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/../.." />
+ </component>
+ <component name="ProjectId" id="22I8Eu9T9oQfEpKBuVvBCZP4z0u" />
+ <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
+ <component name="ProjectViewState">
+ <option name="hideEmptyMiddlePackages" value="true" />
+ <option name="showLibraryContents" value="true" />
+ </component>
+ <component name="PropertiesComponent">
+ <property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
+ </component>
+ <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
+ <component name="TaskManager">
+ <task active="true" id="Default" summary="Default task">
+ <changelist id="00907318-3381-4b49-a9e1-c4d601fc6923" name="Default Changelist" comment="" />
+ <created>1639513634954</created>
+ <option name="number" value="Default" />
+ <option name="presentableId" value="Default" />
+ <updated>1639513634954</updated>
+ </task>
+ <servers />
+ </component>
+</project> \ No newline at end of file