summaryrefslogtreecommitdiffstats
path: root/report/esoteric_project_report.tex
diff options
context:
space:
mode:
Diffstat (limited to 'report/esoteric_project_report.tex')
-rw-r--r--report/esoteric_project_report.tex53
1 files changed, 52 insertions, 1 deletions
diff --git a/report/esoteric_project_report.tex b/report/esoteric_project_report.tex
index a6f0079..f42a7a6 100644
--- a/report/esoteric_project_report.tex
+++ b/report/esoteric_project_report.tex
@@ -10,6 +10,8 @@
\newcommand{\la}{\leftarrow}
\usepackage{algorithm}
\usepackage{algorithmic}
+\usepackage{amsmath}
+\usepackage{mathtools}
\topmargin = 0pt
\voffset = -80pt
\oddsidemargin = 15pt
@@ -211,6 +213,9 @@ asdf
\clearpage
\chapter{BNF form}
+\cite{davie1982recursive} talk about bnf form here
+
+
\begin{table}[h!]
\begin{center}
@@ -218,10 +223,34 @@ asdf
\hline
\textbf{Abbreviation} & \textbf{Term}\\
\hline
+ $<$program$>$ ::= & $<$sequence$>$ \\
+ \hline
$<$statement$>$ ::= & $<$assignment$>$ $|$ \\
& IF $|$ \\
& WHILE \\
\hline
+ $<$sequence$>$ ::= & $<$assignment$>$ $|$ $<$sequence$>$ $|$ \\
+ & $<$clause$>$ $|$ $<$sequence$>$ $|$ \\
+ &$<$empty$>$ \\
+ \hline
+ $<$clause$>$ ::= & IF $|$ \\
+ & DO $|$ \\
+ & PRINT $|$ \\
+ & FUNCTION \textbar \\
+ & SUBROUTINE \\
+ \hline
+ $<$assignment$>$ ::= & CHARACTER $<$string$>$ = $<$expression$>$ $|$ \\
+ & LOGICAL $<$string$>$ = $<$expression$>$ $|$ \\
+ & COMPLEX $<$string$>$ = $<$expression$>$ $|$ \\
+ & REAL $<$string$>$ = $<$expression$>$ $|$ \\
+ & INTEGER $<$string$>$ = $<$expression$>$ \\
+ \hline
+ PRINT ::= & PRINT format [ , output\textunderscore item\textunderscore list ] \\
+ \hline
+ FUNCTION ::= & FUNCTION $<$string$>$ [ , output\textunderscore item\textunderscore list ] \\
+ & $<$sequence$>$ \\
+ & RETURN END FUNCTION \\
+ \hline
IF ::= & IF $<$expression$>$ THEN $<$statement$>$ END IF $|$\\
& IF $<$expression$>$ THEN $<$statement$>$ ELSE $<$statement$>$ END IF \\
\hline
@@ -230,8 +259,30 @@ asdf
& DO $<$expression$>$ $<$expression$>$ = $<$expression$>$, \\
& $<$expression$>$, $<$expression$>$ $<$statement$>$ continue \\
\hline
-
+
+ CHARACTER ::= & any character in ascii table\\
+ \hline
+
+ LOGICAL ::= & TRUE\textbar FALSE \\
+ \hline
+
+ COMPLEX ::= & a combination of real and imaginary numbers e.g. $3i$ where $i = \sqrt{-1}$\\
+ \hline
+
+ REAL ::= & INTEGER\textbar RATIONAL\textbar IRRATIONAL\\
+ \hline
+
+ RATIONAL :: = & any fractional number e.g. 1/3 or 0.333 \\
+ \hline
+
+ IRRATIONAL ::= & $\pi$ \textbar $\sqrt{2} $ etc. \\
+ \hline
+
+
+ INTEGER ::= & 0\textbar1\textbar2\textbar3\textbar4\textbar5\textbar6\textbar7\textbar8\textbar9 \\
+
+ \hline
\end{tabular}
\label{tab:table1}
\caption{Grammar table for Fortran}