ToyIDE

ToyIDE LogoToyIDE is an imitation of a full-featured IDE plus a toy language with an interpreter and a compiler. All the parts were built from scratch in Scala, without relying on any existing code or libraries.

The project is purely educational. It is a product of a long vacation in the country and a desire to learn how all this stuff really works.

Although I employed an evolutionary design in the development (to uncover the reasons behind architecture), it turns out that many techniques in the code come close to commonly used patterns. I learned a lot from the project and hope it might be useful to the people who want to know more about lexers, parsers, AST, Java bytecode and other similar fun, but tricky things.

Screenshots | Features | Downloads | Resources

Screenshots

ToyIDE: Main Window


Features

  • Pluggable languages (plus a simple imperative, statically typed language).
  • Syntax and error highlighting, inspections:
    ToyIDE: Highlighting
  • Editor with selection, copy/paste, undo/redo, braces balancing, auto-indentation.
    ToyIDE: Edit Menu   ToyIDE: Code Menu
  • Split editing:
    ToyIDE: Split Editing
  • Brace matching:
    ToyIDE: Brace Matching
  • Show usages:
    ToyIDE: Show Usages
  • Autocompletion (identifiers, keywords):
    ToyIDE: Autocompletion
  • Code formatting:
    ToyIDE: Code Formatting (before)

    ToyIDE: Code Formatting (after)
  • Rename refactoring:
    ToyIDE: Rename Refactoring (before)

    ToyIDE: Rename Refactoring (after)
  • Control flow analysis:
    ToyIDE: Control Flow Analysis
  • Code optimization:
    ToyIDE: Code Optimization
  • Structure pane:
    ToyIDE: Structure Pane
  • Interpreter:
    ToyIDE: Interpreter
  • Compiler (with static optimizations):
    ToyIDE: Compiler
  • JVM class export:
    ToyIDE: Class Export


Downloads

ToyIDE binaries: toyide-1.0-bin.zip (10MB)


Resources

Project is available as a GitHub repository.

  • Source code is 100% Scala.
  • Maven pom.xml is provided.
  • There are 577 unit tests (running time is less than 3 seconds).