Home

Awesome

Rockstar Lexer

A simple Lexer for the Rockstar programming language specification.

About

The Rockstar Lexer is a simple lexer (lexical analyser) written in Haskell with the Alex tool for generating lexical analysers, that recognizes the Rockstar programming language specification (see below). The Rockstar Lexer can read a file and analyse its contents, determining which valid (and invalid) tokens are present, and showing them in the standard output. Its tokens can also be used with Happy to create a parser (see: Improvements and ideas).

About the Rockstar programming language

According to its creator, Dylan Beattie:

Rockstar is a dynamically typed Turing-complete programming language. Rockstar is designed for creating computer programs that are also song lyrics, and is heavily influenced by the lyrical conventions of 1980s hard rock and power ballads.

You can find the Rockstar programming language specification here (dylanbeattie/rockstar).

Installation

After cloning the repository,

cd rockstar-lexer
stack build --fast

It will prompt you the path to executable.

Usage

If you want to analyse a file, use

/PATH_TO_EXECUTABLE/rockstar-lexer filepath 

or

stack exec -- rockstar-lexer filepath

where filepath is an absolute or relative path to the file you want to analyse.

You can also get (basic) help (pretty much what's stated in this section) if you use rockstar-lexer --help or rockstar-lexer -h .

Implementation details

Known issues

Improvements and ideas

Final remarks

This the my first personal project I publish online. I'm a programming languages enthusiast and this is my second attempt on writing an interpreter (or at least one of its modules). I'm also (kind of) a newbie using Haskell, so if you check the code and have any

then feel free to open an issue or submit a pull request to let me know!