Skip to content

This repo contains an example language built using Python.

Notifications You must be signed in to change notification settings

shubhamchdhary/ExampleLanguage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ExampleLanguage

This repo contains an example language built using Python.

The lexr.py file contains the lexer to extract tokens.

The parsr.py contains the parser to parse the tokens.

The interpreter.py contains the actual interpreter of the example language.

###########################################################################

USE........................................................................

python interpreter.py

Example program to implement functions of BASIC Language.

BASIC >> ADD 2,2 4

BASIC >> SUB 7,5 2

BASIC >> MUL 3,4 12

BASIC >> PRINT Hello World!

Hello World!

BASIC >> print hello world!

SyntaxError : Commands must be in upper case.

CommandError : Invalid command.

BASIC >> PRINTT hello

CommandError : Invalid command.

BASIC >>

Releases

No releases published

Packages

No packages published

Languages