Git Product home page Git Product logo

scalac-plugin-basic's Introduction

BASIC-emitting Scala compiler plugin

An example of how to write a plugin for the Scala compiler.

This plugin adds a phase that traverses selected parts of the AST, generates corresponding BASIC code and writes it to a file.

Only supports a tiny subset of Scala/BASIC syntax.

Usage

First package the plugin into a jar:

$ sbt package

Then compile the sample code in src/main/test:

$ sbt test:compile

This will result in a BASIC file being created:

$ cat printHelloForever.bas
10 REM
20 PRINT "Hello Scala World"
30 GOTO 10

Run the file in a BASIC interpreter of your choice (I used Chipmunk BASIC on OSX).

$ basic printHelloForever.bas
Hello Scala World
Hello Scala World
Hello Scala World
Hello Scala World
...

scalac-plugin-basic's People

Contributors

cb372 avatar

Stargazers

frankfanslc avatar ak avatar Dmytro Mitin avatar Ikhun Um avatar Rutvik Patel avatar Jochen Schneider avatar Wilson de Carvalho avatar Andrey Ivanov avatar  avatar Naoki Aoyama avatar Shane Delmore avatar Vladimir Polushin avatar sion avatar Akhilesh Srikanth avatar Hideki Ikio avatar Taro L. Saito avatar Noriyuki Kazusawa avatar haya14busa avatar Ken Kaizu avatar Paul Horn avatar Andrew Lawson avatar Akos Krivachy avatar Philipp Schmidt avatar Mike Pakhomov avatar Vincent PÉRICART avatar Sam Starling avatar Shohei Shimomura avatar Lloyd avatar

Watchers

 avatar Franklin Chen avatar  avatar James Cloos avatar  avatar

Forkers

empia heyrutvik

scalac-plugin-basic's Issues

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.