All Projects → ftchirou → Blink Lexer

ftchirou / Blink Lexer

Starting code of the first challenge in the Let's Build a Programming Language series.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Blink Lexer

Hython
Haskell-powered Python 3 interpreter
Stars: ✭ 550 (+2191.67%)
Mutual labels:  interpreter
Zetavm
Multi-Language Platform for Dynamic Programming Languages
Stars: ✭ 592 (+2366.67%)
Mutual labels:  interpreter
Springboot Learning
🚕 spring boot学习案例,方便spring boot 初学者快速掌握相关知识
Stars: ✭ 724 (+2916.67%)
Mutual labels:  interpreter
Goruby
GoRuby, an implementation of Ruby written in Go
Stars: ✭ 562 (+2241.67%)
Mutual labels:  interpreter
05ab1e
A concise stack-based golfing language
Stars: ✭ 583 (+2329.17%)
Mutual labels:  interpreter
Wasmi
Wasm interpreter in Rust
Stars: ✭ 670 (+2691.67%)
Mutual labels:  interpreter
Wren
The Wren Programming Language. Wren is a small, fast, class-based concurrent scripting language.
Stars: ✭ 5,345 (+22170.83%)
Mutual labels:  interpreter
Mico
Mico ("Monkey" in catalan). Monkey language implementation done with C++. https://interpreterbook.com/
Stars: ✭ 19 (-20.83%)
Mutual labels:  interpreter
Q3vm
Q3VM - Single file (vm.c) bytecode virtual machine/interpreter for C-language input
Stars: ✭ 585 (+2337.5%)
Mutual labels:  interpreter
Bic
A C interpreter and API explorer.
Stars: ✭ 719 (+2895.83%)
Mutual labels:  interpreter
Webassemblyjs
Toolchain for WebAssembly
Stars: ✭ 566 (+2258.33%)
Mutual labels:  interpreter
Jaspy
a Python VM written entirely from scratch in JavaScript with some unique features
Stars: ✭ 577 (+2304.17%)
Mutual labels:  interpreter
Tiny Compiler
A tiny evaluator and compiler of arithmetic expressions.
Stars: ✭ 680 (+2733.33%)
Mutual labels:  interpreter
Minimal
A Delightfully Diminutive Lisp. Implemented in < 1 KB of JavaScript with JSON source, macros, tail-calls, JS interop, error-handling, and more.
Stars: ✭ 560 (+2233.33%)
Mutual labels:  interpreter
Llamalang
Repository for the Llama Programming Language. Work In Progress
Stars: ✭ 6 (-75%)
Mutual labels:  interpreter
Hashlink
A virtual machine for Haxe
Stars: ✭ 523 (+2079.17%)
Mutual labels:  interpreter
Sci
Configurable Clojure interpreter suitable for scripting and Clojure DSLs.
Stars: ✭ 596 (+2383.33%)
Mutual labels:  interpreter
Poop
A new perspective on programming
Stars: ✭ 19 (-20.83%)
Mutual labels:  interpreter
Ligo
ligo language interpreter
Stars: ✭ 17 (-29.17%)
Mutual labels:  interpreter
Xeus
Implementation of the Jupyter kernel protocol in C++
Stars: ✭ 693 (+2787.5%)
Mutual labels:  interpreter

LBPL Challenge 1: Build a lexer for Blink

Welcome to the first challenge in the Let's Build a Programming Language series. The goal of this challenge is to write a lexer for Blink.

How to setup

Start by forking this repository to your own Github account.

Once the project is forked, make sure that you have the latest version of Node.js installed and run the following commands in a command line prompt to setup the challenge.

  1. $ git clone https://github.com/<replace_with_your_github_username>/blink-lexer.git
  2. $ cd blink-lexer
  3. $ npm install

How to complete the challenge

The goal of this challenge is to write a lexer for Blink in JavaScript (ES6). For that purpose, in the src/main/lexer directory, you have been provided with a Token class, a TokenType enumeration, a basic skeleton for the Lexer class, as well as a test file in src/test/lexer/lexer-test.js. Your job is to make all the tests pass by completing the Lexer class.

Your starting point ...

  • tokentype.js contains all the types of token available in Blink.
  • token.js contains a simple Token class.
  • lexer.js contains a skeleton for a Lexer class with a empty nextToken() method. This is the file where all of your changes should be made.
  • lexer-test.js contains the unit tests validating that your implementation of the Lexer class works as expected.
  • lexical-grammar.txt contains the regular expressions describing valid Blink lexemes. This will serve as guide when implementing the nextToken() method in the Lexer class.
  • A tour of Blink. An overview of all the features in Blink.

How to run the tests

Whenever you're ready to test your code

  1. run npm run build at the root of the project to build
  2. and npm run test to run the tests

Reporting bugs and Suggestions

Please create a Github issue if you found something that needs to be fixed on this project or if you have a suggestion to improve it.

Support and Help

Feel free to ping me on Twitter @ftchirou if you have any question or need a clarification while completing this challenge.

Have fun. 🙌

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].