A satirical, Urdu-inspired programming language that uses Pakistani political terminology as programming constructs.
Compiler Construction Project
University of Central Punjab | Fall 2025
VigoLang is an educational programming language designed for learning compiler construction principles. It features a unique syntax inspired by contemporary Pakistani political discourse, transforming political terminology into programming constructs.
β οΈ Disclaimer: This language is purely satirical and academic. The creator has no political affiliation or association with any political party or organization.
| Feature | Description |
|---|---|
| π Satirical Keywords | 20 unique keywords from Pakistani political terminology |
| π§ Custom Operators | Unique operators like +:, -:, *:, :=, =?, >?, <? |
| π Distinctive Syntax | Double braces {{ }}, double brackets [[ ]], @ terminator |
| π― Identifier Prefix | All variables start with ^ for zero keyword conflicts |
| π Complete Compiler | Lexical analyzer (Phase 1) + Syntax analyzer (Phase 2) |
Compiler-Project-VigoLang/
βββ π Phase_1/ # Lexical Analyzer (Phase 1)
β βββ scanner.l # Flex scanner specification
β βββ test_program.vigo # Sample VigoLang program
β βββ tokens.txt # Tokenization output
β βββ errors.txt # Error log
β βββ PHASE_1_REPORT.pdf # Compiled report
β βββ DEMO_VigoLang.mp4 # Demo video
β βββ π Test_With_Explicit_Errors/ # Error testing
β βββ test_with_errors.vigo # Test program with errors
β βββ tokens.txt # Tokenization output
β βββ errors.txt # Error log
β
βββ π Phase_2/ # Syntax Analyzer (Phase 2)
β βββ parser.y # YACC parser specification
β βββ scanner.l # Modified scanner for parser
β βββ valid_program.vigo # Valid test program
β βββ invalid_program.vigo # Invalid test program (error demo)
β βββ VigoLang_Phase_2_Document.pdf # Compiled report
β βββ vigolang_parser # Compiled parser executable
β βββ lex.yy.c # Generated scanner C code
β βββ y.tab.c # Generated parser C code
β βββ y.tab.h # Generated parser header
β
βββ LICENSE # MIT License
βββ README.md # This file
- GCC Compiler
- Flex (Lexical Analyzer Generator)
- Bison (Parser Generator)
cd Phase_1
# Compile the scanner
flex scanner.l
gcc lex.yy.c -o vigo_scanner -lfl
# Run the scanner
./vigo_scanner test_program.vigocd Phase_2
# Generate parser and scanner
flex scanner.l
bison -d parser.y
# Compile
gcc lex.yy.c y.tab.c -o vigolang_parser -lfl
# Test with valid program
./vigolang_parser valid_program.vigo
# Test with invalid program (see error handling)
./vigolang_parser invalid_program.vigo| Keyword | Purpose | Standard Equivalent |
|---|---|---|
ghq |
Main function | main |
safehouse |
Class definition | class |
nro |
Return statement | return |
order_hai |
If condition | if |
doosra_order |
Else-if | else if |
warna_vigo |
Else | else |
long_march |
For loop | for |
jab_tak_missing |
While loop | while |
deal_ho_gai |
Break | break |
chaltay_raho |
Continue | continue |
farmaan |
Print/Output | print |
taftish |
Input | input |
qaidi_no |
Integer type | int |
bayania |
String type | string |
float_sarkar |
Float type | float |
ishara |
Character type | char |
namaloom |
Void type | void |
ain |
Constant | const |
neutral |
Boolean true | true |
janwar |
Boolean false | false |
| Operator | Description | Example |
|---|---|---|
+: |
Addition | ^a +: ^b |
-: |
Subtraction | ^x -: 5 |
*: |
Multiplication | ^p *: ^q |
:= |
Assignment | ^x := 10 |
=? |
Equality | ^x =? ^y |
>? |
Greater than | ^a >? ^b |
<? |
Less than | ^x <? 10 |
<< |
Output stream | farmaan << ^msg |
>> |
Input stream | taftish >> ^val |
| Symbol | Description |
|---|---|
@ |
Statement terminator |
{{ }} |
Block delimiters |
[[ ]] |
Expression delimiters |
, |
Separator |
#* *# |
Multi-line comment |
### |
Single-line comment |
#* VigoLang Factorial Calculator *#
ghq[[ ]] {{
qaidi_no ^num := 5@
qaidi_no ^fact := 1@
qaidi_no ^i := 1@
farmaan << "Calculating factorial"@
order_hai [[ ^num <? 0 ]] {{
farmaan << "Error: Negative"@
}}
warna_vigo {{
long_march [[ ^i := 1@ ^i <? ^num +: 1@ ^i := ^i +: 1 ]] {{
^fact := ^fact *: ^i@
}}
}}
farmaan << ^fact@
nro 0@
}}
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β VigoLang Syntax Analyzer v2.0 β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Variable declaration parsed
β Conditional statement (order_hai) parsed
β For loop (long_march) parsed
β Program structure validated
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SYNTAX ANALYSIS SUCCESSFUL! β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SYNTAX ERROR DETECTED β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Line Number: 5
Error Type: syntax error
Found Token: 'farmaan'
- Phase 1 Report - Lexical Analyzer Documentation
- Phase 2 Report - Syntax Analyzer Documentation
See the demo video for a complete walkthrough of the lexical analyzer.
Muhammad Ahmad
Registration: L1F22BSCS0634
University of Central Punjab
Compiler Construction - Fall 2025
This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ for Compiler Construction
"Where politics meets programming"