Skip to content

Simple lexer, parser and semantic analyzer for pascal based language using vanilla JS

Notifications You must be signed in to change notification settings

eltonoak/emergency-language

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Lexer, Parser and Semantic Analyzer for Emergency Language

About the project

EMERGENCY LANGUAGE is a Pascal based language.

This project was forked from Ghaiklor Pascal Interpreter and used for educational purposes. Was implemented only the compiler front-end, there is no code generation or code interpretation.

You can see the Emergency grammar here

What's new?

Based on the Ghaiklor Pascal Interpreter was added:

  • The syntax is a little bit different.
  • IF instruction [DONE]
  • WHILE instruction [DONE]

Code example

  program correto;
  inteiro a, b, c;
  logico d, e6, f;
  {Comentário correto}
  inicio
    a:=1;
    enquanto (a>1) faca
    inicio
      se (b>10) entao
        b:=2;
      a:=a-1;
    fim //Outro comentario correcto.
  fim.

How to run

Pre-requisites

  1. NodeJS installed.

Run

  1. Clone the repository or download as .zip
  2. Open the terminal
  3. Go to src in the project folder
  4. Execute the command node index.js "source file name"
    Eg: node index.js programaCorrecto.txt

You can write your own program, enjoy.

About

Simple lexer, parser and semantic analyzer for pascal based language using vanilla JS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published