Skip to content

Commit a9cd85a

Browse files
committed
Add readme documents
1 parent b2c42d2 commit a9cd85a

2 files changed

Lines changed: 51 additions & 0 deletions

File tree

68 KB
Binary file not shown.

main.tex

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
\documentclass{article}
2+
\usepackage[utf8]{inputenc}
3+
\usepackage[margin=1in]{geometry}
4+
5+
\title{README}
6+
\author{Naming Conventions and Documentation }
7+
\date{}
8+
9+
\usepackage{natbib}
10+
\usepackage{graphicx}
11+
12+
\begin{document}
13+
\maketitle
14+
15+
\section{Prefix and Postfix Conventions}
16+
\begin{enumerate}
17+
\item Functions that are prefixed with "G\_" are global functions. G functions enforce encapsulation on a naming scheme level, so users do not get confused. Global functions can handle any arbitrary input to their parameters due to their input sanitation. \\
18+
19+
A G function should only call helper functions within its code block. Code blocks implies scope.
20+
21+
\end{enumerate}
22+
23+
\section{Return Conventions}
24+
\begin{enumerate}
25+
\item The return value of a function is denoted by an arrow, followed by return values separated by underscores. For example, often times, a G function returns a value\_state pair. This is denoted by: $\rightarrow (value\_state)$. The pair, or tuple, is a list of two elements. The first, being the value, and the second, being the state. \\
26+
27+
Value-state pairs were often returned due to the side effect challenge. We were able to complete the side effect challenge without using $let$, due to our G functions returning the value of a passed in expression and updated state. \\
28+
\end{enumerate}
29+
30+
\section{Atomic Statements}
31+
\begin{enumerate}
32+
\item Atomic statements are statements that are valid either in condition statement (i.e. if (atomic statement) then...) or on their own (i.e (atomic statement);) At the moment, this is just assign statements, arithmetic expressions, boolean expressions, and comparison expressions.\\~\\
33+
(e.g. $(>\ x\ (\ +\ y\ 1))$ is an atomic statement) \\
34+
(e.g. $(==\ 3\ (=\ x (\ +\ x\ 1))$ is an atomic statement)\\
35+
(e.g $(=\ x\ 1)$ is an atomic statement)
36+
\end{enumerate}
37+
38+
\section{Value and State naming}
39+
\begin{enumerate}
40+
\item evaluate-parse-tree$\rightarrow$retval\_state runs the parsing of the program.
41+
42+
\item evaluate-statement$\rightarrow$retval\_state is our MState function. Our state functions follow this pattern. G-evaluate-if-statement$\rightarrow$retval\_state is equivalent to MState-if. G-evaluate-while-statement$\rightarrow$retval\_state is equivalent to MState-while. And so on.
43+
44+
\item G-eval-atomic-statement$\rightarrow$value\_state is most equivalent to MValue. Our value functions follow this pattern. G-eval-assign$\rightarrow$value\_state is equivalent to MState-assign. eval-boolean-expr-uni$\rightarrow$value\_state, along with our other similar boolean functions of this nature, is equivalent to Mvalue-boolean. And so on.
45+
\end{enumerate}
46+
47+
48+
49+
50+
51+
\end{document}

0 commit comments

Comments
 (0)