Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 965 Bytes

readme.md

File metadata and controls

54 lines (40 loc) · 965 Bytes

URDU Programming Language

It is simple compiler that compiles a dialect of BASIC to C, while being written in Go Lang

It supports:

  • Numerical variables
  • Basic arithmetic
  • If statements
  • While loops
  • Print text and numbers
  • Input numbers
  • Labels and goto
  • Comments

How to run

go build -o compiler
./compiler <filename>.urdu

Hello World

DEKHAO "Hello Dunya"

Average of numbers program


NAM a = 0
JAB a < 1 KARO
    DEKHAO "Enter number of scores: "
    BTAO a
JABBND

NAM b = 0
NAM s = 0
DEKHAO "Enter one value at a time: "
JAB b < a KARO
    BTAO c
    NAM s = s + c
    NAM b = b + 1
JABBND

DEKHAO "Average: "
DEKHAO s / a

Resources

Read the tutorial: Let's make a Teeny Tiny compiler, part 1 as well as part 2 and part 3