diff options
author | chris-sutcliffe <ctd.sutcliffe@gmail.com> | 2021-10-18 15:43:54 +0100 |
---|---|---|
committer | chris-sutcliffe <ctd.sutcliffe@gmail.com> | 2021-10-18 15:43:54 +0100 |
commit | 3c3706a8957f27d7bcb553eff6ded1c6dc76fa24 (patch) | |
tree | 57460311b95f201eac1c71c8536f5e8eef6c0659 /report | |
parent | ec16bb890e36e125f8f31636549bdba7280b6acb (diff) | |
download | esotericFORTRAN-3c3706a8957f27d7bcb553eff6ded1c6dc76fa24.tar.gz esotericFORTRAN-3c3706a8957f27d7bcb553eff6ded1c6dc76fa24.zip |
add some notes on grammar and start lexer section
Diffstat (limited to 'report')
-rw-r--r-- | report/esoteric_project_report.pdf | bin | 197284 -> 189988 bytes | |||
-rw-r--r-- | report/esoteric_project_report.tex | 61 | ||||
-rw-r--r-- | report/report.pdf | bin | 0 -> 67012 bytes |
3 files changed, 60 insertions, 1 deletions
diff --git a/report/esoteric_project_report.pdf b/report/esoteric_project_report.pdf Binary files differindex 58a9978..b241efe 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 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} diff --git a/report/report.pdf b/report/report.pdf Binary files differnew file mode 100644 index 0000000..33a6960 --- /dev/null +++ b/report/report.pdf |