GithubHelp home page GithubHelp logo

nicholasliem / if2124_tugasbesar_javascriptparser Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 2.0 381 KB

Tugas ini merupakan salah satu tugas besar matakuliah IF2124 Teori Bahasa Formal dan Automata yang berfokus pada pengaplikasian Context Free Grammar (CFG), Chomsky Normal Form (CNF), dan Algoritma CYK (Cocke-Younger-Yagami) untuk melakukan parsing terhadap bahasa pemrograman JavaScript.

JavaScript 5.30% Python 94.70%
cnf cyk-algorithm javascript language-parser parsing-expression-grammar

if2124_tugasbesar_javascriptparser's Introduction

TBFO_ParserNode.js

Table of Contents

Program Description

Dalam proses pembuatan program dari sebuah bahasa menjadi instruksi yang dapat dieksekusi oleh mesin, terdapat pemeriksaan sintaks bahasa atau parsing yang dibuat oleh programmer untuk memastikan program dapat dieksekusi tanpa menghasilkan error. Parsing ini bertujuan untuk memastikan instruksi yang dibuat oleh programmer mengikuti aturan yang sudah ditentukan oleh bahasa tersebut. Baik bahasa berjenis interpreter maupun compiler, keduanya pasti melakukan pemeriksaan sintaks. Perbedaannya terletak pada apa yang dilakukan setelah proses pemeriksaan (kompilasi/compile) tersebut selesai dilakukan.

How to Run Program

  1. Clone this repository
    $ git clone https://github.com/NicholasLiem/IF2124_TugasBesar_ParserNodeJs.git
  2. Change the directory to the location where the main program is stored
    $ cd IF2124_TugasBesar_ParserNodeJs
  3. Run the main program
    $ python main.py

Implementation Screenshots

Screenshot contoh source code yang valid pada JavaScript Source Code True
Screenshot hasil output true pada program Source Code True
Screenshot contoh source code yang tidak valid pada JavaScript Source Code True
Screenshot hasil output false pada program Source Code True

Team Members

  1. Juan Christopher Santoso - 13521116
  2. Nicholas Liem - 13521135
  3. Nathania Calista Djunaedi - 13521139

Workload Distributions

NIM Nama Tugas
13521116 Juan Christopher Santoso Grammar, Regex, CYK, Lexer, dan Laporan
13521135 Nicholas Liem CYK, Finite Automata, Lexer, dan Laporan
13521139 Nathania Calista Djunaedi Grammar, Regex, CNF, Bonus, dan Laporan

Folders and Files Description

  1. Folder Test
    Berisikan segala file .js yang ingin dites oleh program parser.
  2. File main.py
    Berisikan program utama yang menggabungkan segala fungsi dan algoritma yang telah dibuat.
  3. File rules.py
    Berisikan 'aturan' dalam pembacaan file .js menggunakan regex (regular expression).
  4. File FA.py
    Berisikan file untuk melakukan pengecekan apakah nama variabel dan penulisan ekspresi telah benar menggunakan FA (finite automata).
  5. File grammar_cfg.txt
    Berisikan aturan yang menjadi grammar dasar bagi syntax .js yang akan dites
  6. File grammar_reader.py
    Berisikan algoritma untuk mengubah token yang telah dibaca menggunakan rules.py menjadi CNF (Chomsky Normal Form) berdasarkan grammar pada file grammar_cfg.txt.
  7. File cnf.txt
    Berisikan aturan cnf yang telah dibuat menggunakan algoritma pada file grammar_reader.py
  8. File cyk.py
    Berisikan file yang mengandung algoritma untuk membaca CFG (Context Free Grammar) berdasarkan CNF yang telah dibuat.
  9. Folder assets
    Berisikan screenshots untuk ditampilkan pada README.

Meme Section

alt text

if2124_tugasbesar_javascriptparser's People

Contributors

gulilil avatar nathaniacalista01 avatar nicholasliem avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.