summaryrefslogtreecommitdiffstats
path: root/report/esoteric_project_report.tex
diff options
context:
space:
mode:
authorAidenRushbrooke <72034940+AidenRushbrooke@users.noreply.github.com>2021-12-05 20:52:33 +0000
committerAidenRushbrooke <72034940+AidenRushbrooke@users.noreply.github.com>2021-12-05 20:52:33 +0000
commit1709cb30fbdecff9cb78ad65b06792f1b6cee3fa (patch)
treef99efb0bb9b101e21b1f365f61e26b4d3510d91f /report/esoteric_project_report.tex
parent9e6c89f1fa93287104381e02f0bbbdd6060a9382 (diff)
downloadesotericFORTRAN-1709cb30fbdecff9cb78ad65b06792f1b6cee3fa.tar.gz
esotericFORTRAN-1709cb30fbdecff9cb78ad65b06792f1b6cee3fa.zip
Updated report grammar
Diffstat (limited to 'report/esoteric_project_report.tex')
-rw-r--r--report/esoteric_project_report.tex58
1 files changed, 46 insertions, 12 deletions
diff --git a/report/esoteric_project_report.tex b/report/esoteric_project_report.tex
index 3da6800..fd144b0 100644
--- a/report/esoteric_project_report.tex
+++ b/report/esoteric_project_report.tex
@@ -162,25 +162,36 @@ asdf
\begin{table}[h!]
\begin{center}
-
\begin{tabular}{|l|r|}
\hline
\textbf{Abbreviation} & \textbf{Term}\\
\hline
- $<$program$>$ ::= & $<$statement$>$* \\
+ $<$program$>$ ::= & $<$function-call$>$* \\
+ \hline
+ $<$function-call$>$ ::= & $<$main-function$> |$ \\
+ & $<$function$> |$ \\
+ & $<$subroutine$>$\\
+ \hline
+ $<$main-function$>$ ::= & "program" $<$identifier$>$ $<$block$>$ "program "$<$identifier$>$\\
+ \hline
+ $<$function$>$::=&$<$type$>$$<$identifier$>$"("$<$expression$>$","*")"$<$block$>$\\
+ \hline
+ $<$subroutine$>$::=&$<$identifier$>$"("$<$expression$>$","*")"$<$block$>$\\
+ \hline
+ $<$block$>$::=& $<$statement$>$* "end" $|$\\
+ & $<$statement$>$* $<$return$>$ "end" $|$\\
\hline
$<$statement$>$ ::= & $<$declaration$>$ $|$ \\
& $<$expr-Statement$>$ $|$\\
& $<$print-Statement$>$ $|$ \\
- & $<$if-Statement$>$ \\
- & $<$do-Statement$>$ \\
+ & $<$if-Statement$>$ $|$\\
+ & $<$do-Statement$>$ $|$\\
& $<$do-while-Statement$>$ \\
\hline
- $<$block$>$::=& $<$statement$>$* "end"\\
- \hline
$<$declaration$>$ ::= & "character (len = "$<$number$>$")::"$<$identifier$>$ $|$ \\
- & "int::"$<$identifier$>$ \\
+ & "int::"$<$identifier$>$ $|$\\
& "real::"$<$identifier$>$ \\
+ & $<$type$>$ "dimension("$<$expression$>$*")"::$<$identifier$>$\\
\hline
$<$print-Statement$>$ ::= & "print *" (","$<$expression$>$)* \\
\hline
@@ -196,14 +207,32 @@ asdf
& $<$block$>$ \\
& "do"\\
\hline
+ $<$return$>$ ::= & "return" $<$expression$>$\\
+ \hline
$<$expr-statement$>$ ::= & $<$expression$>$\\
\hline
+ \end{tabular}
+ \label{tab:table1}
+ \caption{Grammar table for EsotericFortran Statements}
+\end{center}
+\end{table}
+\begin{table}[h!]
+ \begin{center}
+ \begin{tabular}{|l|r|}
+ \hline
+ \textbf{Abbreviation} & \textbf{Term}\\
+ \hline
+ \hline
$<$expression$>$ ::= & $<$assignment$>$\\
\hline
$<$assignment$>$ ::= & $<$identifier$>$"="$<$equality$>$$|$\\
& $<$equality$>$$|$\\
\hline
- $<$equality$>$ ::= & $<$comparison$>$"=="$<$comparison$>$$|$\\
+ $<$equality$>$ ::= & $<$logical$>$("=="$|$"/=")$<$logical$>$$|$\\
+ & $<$logical$>$$|$\\
+ \hline
+ $<$logical$>$ ::= & $<$comparison$>$(".and."$|$".or.")$<$comparison$>$$|$\\
+ & $<$".not."$>$$<$comparison$>$$|$\\
& $<$comparison$>$$|$\\
\hline
$<$comparison$>$ ::= & $<$term$>$("$>$"$|$"$<$"$|$"$>=$"$|$"$>=$")$<$term$>$$|$\\
@@ -212,12 +241,16 @@ asdf
$<$term$>$ ::= & $<$factor$>$("+"$|$"-")$<$factor$>$$|$\\
& $<$factor$>$$|$\\
\hline
- $<$comparison$>$ ::= & $<$primary$>$("*"$|$"/")$<$primary$>$$|$\\
+ $<$factor$>$ ::= & $<$exponent$>$("*"$|$"/")$<$exponent$>$$|$\\
+ & $<$exponent$>$$|$\\
+ \hline
+ $<$exponent$>$ ::= & $<$primary$>$"**"$<$primary$>$$|$\\
& $<$primary$>$$|$\\
\hline
$<$primary$>$ ::= & $<$number$>$$|$\\
& $<$identifier$>$$|$\\
- & $<$string$>$\\
+ & $<$string$>$$|$\\
+ & $<$identifier$>$"("$<$expression$>$","*")"\\
\hline
$<$number$>$ ::= & $<$digit$>$*("."$<$digit$>$*)?\\
@@ -233,13 +266,14 @@ asdf
$<$alpha$>$::=&"a"..."z"$|$"A"..."Z"\\
\hline
+ $<$type$>$::=&"int"$|$"real"$|$"string"\\
+ \hline
\end{tabular}
\label{tab:table1}
- \caption{Grammar table for Fortran}
+ \caption{Grammar table for EsotericFortran Expressions}
\end{center}
\end{table}
-
\chapter{Documentation}\label{MethLab}
We decided it would be a good idea to note down and record our application stage by stage while developing our Esolang so that we may refer back to previous parts for reference. It will also help track our progress throughout the project to ensure we stay on track.