From 3c3706a8957f27d7bcb553eff6ded1c6dc76fa24 Mon Sep 17 00:00:00 2001
From: chris-sutcliffe <ctd.sutcliffe@gmail.com>
Date: Mon, 18 Oct 2021 15:43:54 +0100
Subject: add some notes on grammar and start lexer section

---
 report/esoteric_project_report.tex | 61 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 60 insertions(+), 1 deletion(-)

(limited to 'report/esoteric_project_report.tex')

diff --git a/report/esoteric_project_report.tex b/report/esoteric_project_report.tex
index 25491d5..788226a 100644
--- a/report/esoteric_project_report.tex
+++ b/report/esoteric_project_report.tex
@@ -83,7 +83,66 @@ Esolangs are programming languages designed to be jokes or proof of concept lang
 \section{Example - Shakespearian Programming Language}
 The Shakespeare Programming Language is esoteric code parodied on extracts from Romeo and Juliet. Here, code is written so it reads like how a script would, such as \texttt{[Enter Juliet]} where \texttt{Juliet} may be a variable name. Other examples include using \texttt{Acts} or \texttt{Scenes} as GOTO statements, where the interpreter can jump to a certain point in the code and read from there. Otherwise, these are ignored similar to the title or character descriptions. Other examples include LOLCODE, Hodor or White Space. This serves the purpose of writing code in a different manner to usual, sometimes for humour. The aim is to replace typical language features so that it can still be read by a compiler or interpreter but also look and read very differently by the user.  
 
-\chapter{Grammar - FORTRAN}
+\chapter{The Structure of our Programming Language}
+\section{The Lexar (Lexical Analysis)} 
+In the field of linguistics or computer programming language design, lexical analysis is the process of converting a sequence of characters (such as a computer program) into a sequence of tokens. 
+This process is also known as tokenisation, particularly in the field of natural language processing (NLP).
+When designing a programming language, the task of lexical analysis or tokenisation is performed by a lexer. 
+The actual matching of tokens is often performed using regular expressions, defined in the design stage in order to reliably match all tokens in the language. 
+
+
+\chapter{Grammar}
+
+
+\section{Introduction to Language Grammar}
+\begin{verbatim}
+
+Work in progress currently
+
+\end{verbatim}
+Context free grammars – something = something else 
+
+Context free because there is no rule or context about where this grammar belongs, only where it goes
+
+Rewrite rules:
+S $\rightarrow$ DET N
+Were first invented by Panini %Pāṇini
+ who worked on Sanscrit grammar rules
+ 
+Port Royal Grammer by Antoine Arnauld and Claude Lancelot in 1660 who worked at Port-Royal-des-Champs
+
+then Ferdinand de Saussure (19th century)
+
+then Chomsky with Chomsky hierarchy.
+
+
+BNF form (Backus Naur form)  is a meta language for grammars
+Named after the people who invented it simultaneously 
+example:
+\begin{verbatim}<program> ::= <sequence>? 
+\end{verbatim}
+This means a program consists of a sequence of allowable grammars followed by question mark
+Can be read as “program consists of a sequence of things followed by question mark”
+
+
+Grammar consists of a series of rewrite rules
+Grammar is a quadruple. It is a set of:
+\begin{itemize}
+	\item Terminal symbols
+	\item Non terminal symbols
+	\item Set of rules
+	\item Start symbol (one of the non-terminal symbols)	
+\end{itemize}
+
+
+Any regular grammar can be recognised by regular expressions (refer to regular grammar in Chomksy hierarchy)
+
+After Chomsky came Backus and Naur – BNF 
+
+Niklaus Wirth – Pascal language
+
+Dijkstra – programming without goto (gotoless programming)
+
 
 \section {Why we chose FORTRAN}
 
-- 
cgit v1.2.3

