diff options
author | AidenRushbrooke <72034940+AidenRushbrooke@users.noreply.github.com> | 2021-12-05 20:52:33 +0000 |
---|---|---|
committer | AidenRushbrooke <72034940+AidenRushbrooke@users.noreply.github.com> | 2021-12-05 20:52:33 +0000 |
commit | 1709cb30fbdecff9cb78ad65b06792f1b6cee3fa (patch) | |
tree | f99efb0bb9b101e21b1f365f61e26b4d3510d91f /report | |
parent | 9e6c89f1fa93287104381e02f0bbbdd6060a9382 (diff) | |
download | esotericFORTRAN-1709cb30fbdecff9cb78ad65b06792f1b6cee3fa.tar.gz esotericFORTRAN-1709cb30fbdecff9cb78ad65b06792f1b6cee3fa.zip |
Updated report grammar
Diffstat (limited to 'report')
-rw-r--r-- | report/esoteric_project_report.pdf | bin | 298285 -> 299547 bytes | |||
-rw-r--r-- | report/esoteric_project_report.tex | 58 |
2 files changed, 46 insertions, 12 deletions
diff --git a/report/esoteric_project_report.pdf b/report/esoteric_project_report.pdf Binary files differindex 5c33d8a..b01ca3c 100644 --- a/report/esoteric_project_report.pdf +++ b/report/esoteric_project_report.pdf 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. |