Tugas Besar IF 2124 Teori Bahasa Formal dan Otomata aplikasi CFG dan CNF pada Parsing NodeJS Semester 3 Tahun 2022/2023
- 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.
- Python 3
- Clone the repo
git clone https://github.com/akmaldika/Parsing-NodeJs.git
-
Make sure directory on terminal is in '..\Parsing-NodeJs\'
-
Run the program
python main.py <path-of-test-file.js>
- 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
- 13521050 Akmal Mahardika Nurwahyu Pratama
- 13521087 Razzan Daksana Yoni
- 13521095 Muhamad Aji Wibisono