Skip to content

Tugas Besar IF2124 Teori Bahasa Formal dan Otomata 2022/2023

Notifications You must be signed in to change notification settings

akmaldika/Parsing-NodeJs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parsing-NodeJs

Tugas Besar IF 2124 Teori Bahasa Formal dan Otomata aplikasi CFG dan CNF pada Parsing NodeJS Semester 3 Tahun 2022/2023

Table of Contents

General Information

  • The goal of this project is to create parsing for node js using grammar and parse algorithm.
  • This project is using CFG (Context-Free Grammar) for grammar and using CYK (Cocke-Younger-Kasami) for parse algorithm.
  • Students were asked to implement what they got in class by making their own code.

Technologies Used

  • Python 3

Setup

Prerequisite

Instalation

  1. Clone the repo
git clone https://github.com/akmaldika/Parsing-NodeJs.git
  1. Make sure directory on terminal is in '..\Parsing-NodeJs\'

  2. Run the program

python main.py <path-of-test-file.js>

Example Program Test

  • Example of Accepted
// File : Accepted.js
function foo(arg) {
    if (arg > 100) {
        return 'Greater'
    }
    else {
        return 'Lower'
    }
}
  • output :
File accepted
Relative length :  32
RunTime: 0.7610864639282227
  • Example of rejected
// File : recj.js
function foo(arg) {
    if (arg > 100) 
        return 'Greater'
    }
    else {
        return 'Lower'
    }
}
  • output :
Syntax Error (CYK)
Relative length :  31
RunTime: 0.7130420207977295

Contributors

About

Tugas Besar IF2124 Teori Bahasa Formal dan Otomata 2022/2023

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published