# Yaounde Informal Speech Compiler
**Authors:** Abena, Essindi and Yimgaing
This project is a compiler for Yaounde informal speech (Camfranglais, Pidgin, and slang). It includes a lexer and a parser to analyze the structure of this informal language.
## Overview
The compiler works in two steps:
1. Lexical Analysis: Breaking sentences into tokens.
2. Syntactic Analysis: Checking if the tokens follow the grammar rules.
## Grammar Rules (CFG)
The compiler uses a Context-Free Grammar (CFG) that has been specifically adapted to handle the parataxis and code-switching found in Yaounde informal speech. To enable LL(1) parsing, the grammar has been left-factored and left-recursion has been removed.
### 1. Sentence Structure (S)
The entry point of the grammar handles various ways a sentence can start in informal speech:
- **S → INTERJECTION S**: Handles opening interjections like "Abeg, ..." or "Ekiee, ...".
- **S → SLANG S**: Handles discourse markers or negation at the start.
- **S → VP**: Handles imperative sentences (commands) where the subject is dropped (e.g., "Drop me for carrefour").
- **S → NP VP**: The standard subject-predicate structure.
### 2. Noun Phrases (NP)
The noun phrase handles subjects and objects, including code-mixed elements:
- **NP → DETERMINER [NOUN|ADJECTIVE] NP'**: Handles "this taxi", "that big pikin".
- **NP → NOUN NP'**: Handles "Taxi", "Chauffeur".
- **NP → PRONOUN NP'**: Handles "I", "you", "dem".
- **NP → CODE_MIX**: Handles specifically recognized mixed-language chunks.
- **NP' → NOUN NP' | ε**: Allows for noun chaining (e.g., "taxi driver") and terminates the phrase.
### 3. Verb Phrases (VP)
The verb phrase handles actions and their modifiers:
- **VP → SLANG VP**: Handles aspect markers and negation (e.g., "no sabi", "don finish").
- **VP → VERB VP'**: The main verb followed by its complements.
- **VP' (Complements)**: A recursive rule that handles a sequence of:
- **NP VP'**: Direct objects.
- **PP VP'**: Prepositional phrases.
- …