sidharth-anand / YeetScript

A Language description and compiler implemented as part of the course Compiler Construction

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

YeetScript Compiler

Group Details

Group 12

  • Akhil Macherla (2019A7PS1211H)
  • Aryan Arora (2019A7PS1204H)
  • Sidharth Anand (2019A7PS1203H)
  • Yashaswi Yenugu (2019A7PS1210H)

======================================================================

Commands

YeetScriptCompiler parse FILE

Parse a YeetScript file and output the token list

USAGE
  $ YeetScriptCompiler parse [FILE] [-n] [-w]

ARGUMENTS
  FILE  Path to the YeetScript file to parse

FLAGS
  -n, --include-newlines
  -w, --include-whitespaces

DESCRIPTION
  Parse a YeetScript file and output the token list

EXAMPLES
  $ YeetScriptCompiler parse main.ys

See code: src/commands/parse.ts

YeetScriptCompiler help [COMMAND]

Display help for YeetScriptCompiler.

USAGE
  $ YeetScriptCompiler help [COMMAND] [-n]

ARGUMENTS
  COMMAND  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for YeetScriptCompiler.

See code: @oclif/plugin-help

Building

To get YeetScriptCompiler up and running you must have nodejs and yarn installed.

  • Clone the repo ( git clone https://github.com/sidharth-anand/YeetScript.git )
  • Move into the project ( cd YeetScript )
  • Install dependencies ( yarn install )
  • Build the project ( yarn build )
  • Run the parser with a test file ( ./bin/dev parse test/sources/combined.ys )

Documentation

You can find JSDoc style documentation for every major class and function alongside the code.

Language Definition

All the files related to the language definition can be found in src/definitions

The transition rules for the DFA are at ys.rules and the BNF for YeetScript is at ys.bnf

YeetScript DFA DFA.png for the original high-res image

Testing

To test the project you can simply run

yarn test

This should trigger 11 extensive unit tests which cover all aspects of the YeetScript language and various codestyles. It should also contain failing tests for inavlid token sequences.

Examples

The examples are part of the test suite and conver all essential aspects of the YeetScript language. You can find them in test/sources.

The correct output token stream for these example YeetScript files can be found in test/tokens.

About

A Language description and compiler implemented as part of the course Compiler Construction

License:MIT License


Languages

Language:TypeScript 90.6%Language:Python 8.5%Language:JavaScript 0.6%Language:HTML 0.3%Language:Batchfile 0.0%