monkey2dart

Compiles the Monkey programming language into equivalent Dart.

Still missing:

  • IfExpression
  • PrefixExpression
  • print is currently the only available built-in

Installation

dev_dependencies:
    monkey2dart: ^1.0.0-alpha

Then, in your command-line:

$ pub get

Usage

Requires package:build_runner.

// tool/phases.dart
import 'package:build_runner/build_runner.dart';
import 'package:monkey2dart/build.dart';

final PhaseGroup phases = new PhaseGroup.singleAction(
    const Monkey2DartBuilder(),
    new InputSet('monkey_hello', const ['lib/*.monkey']));

// tool/build.dart
import 'package:build_runner/build_runner.dart';
import 'phases.dart';

main() => build(phases, deleteFilesByDefault: true);
$ dart tool/build.dart

Libraries

build

monkey2dart