Showcase/ArnoldC
Generated Jun 1, 2026, 10:15 AM

Project Overview

This project implements a programming language inspired by the one-liners of Arnold Schwarzenegger. It parses code written in this language and generates Java bytecode that can be executed.

Tech Stack

  • Scala: The primary programming language.
  • ASM: A Java bytecode manipulation framework used for generating .class files.
  • Parboiled-scala: A library for writing parsers.
  • ScalaTest: A testing framework.
  • FreeTTS: A speech synthesis library, likely for the -declaim option.

High-Level Architecture

The project follows a typical compiler structure:

  1. Parser (ArnoldParser): Takes the ArnoldC source code as input and transforms it into an Abstract Syntax Tree (AST). The AST is composed of various AstNode implementations, such as StatementNode, ExpressionNode, and OperandNode.
  2. AST (org.arnoldc.ast.*): Represents the structure of the parsed ArnoldC code. Nodes like PrintNode, AssignVariableNode, MethodNode, and MainMethodNode define the language's constructs.
  3. Code Generator (ArnoldGenerator, ArnoldParser): Traverses the AST and generates Java bytecode using the ASM library. The generate methods within each AstNode are responsible for emitting the appropriate bytecode instructions.
  4. Class Loader (ArnoldGenerator, ByteCodeExecutor): Loads the generated bytecode as a Java class.
  5. Executor (Executor): Runs the compiled Java class, specifically executing its main method.
  6. Declaimer (Declaimer - not fully shown, but referenced): Likely processes the AST to produce a human-readable representation or perform some analysis.

Entry Points

  • org.arnoldc.ArnoldC.main(args: Array[String]): This is the main entry point for the command-line interface. It handles parsing command-line arguments (like -run or -declaim), reading the ArnoldC source file, invoking the ArnoldGenerator to produce bytecode, writing the .class file, and then either executing the compiled code via Executor or processing it with Declaimer.
  • org.arnoldc.ArnoldGenerator.generate(arnoldCode: String, filename: String): This method orchestrates the parsing and bytecode generation process. It creates an ArnoldParser instance, parses the code into an RootNode (the root of the AST), and then calls the generateByteCode method on the RootNode.
  • org.arnoldc.Executor.execute(className: String): This method is responsible for loading and running the generated Java bytecode. It uses a custom ClassLoader to load the class and then invokes its main method.

The typical flow for running an ArnoldC program is: ArnoldC reads the source file -> ArnoldParser builds AST -> ArnoldGenerator generates bytecode -> FileOutputStream writes .class file -> Executor loads and runs the .class file.

Key Concepts

  1. Abstract Syntax Tree (AST): The core data structure representing the parsed ArnoldC code. Developers need to understand how different language constructs are mapped to AstNode subclasses (e.g., PrintNode for TALK TO THE HAND, AssignVariableNode for GET TO THE CHOPPER).
    • Refer to: src/main/scala/org/arnoldc/ast/AstNode.scala and its subclasses.
  2. Bytecode Generation: The process of translating AST nodes into Java bytecode instructions using the ASM library. Each AstNode has a generate method responsible for this.
    • Refer to: src/main/scala/org/arnoldc/ArnoldGenerator.scala and the generate methods in AST nodes like src/main/scala/org/arnoldc/ast/PrintNode.scala.
  3. Symbol Table (org.arnoldc.SymbolTable): Used to keep track of variables, their scopes, and method information during parsing and code generation. It's crucial for managing variable addresses and method signatures.
    • Refer to: src/main/scala/org/arnoldc/SymbolTable.scala (not provided, but its usage is evident in AST nodes).
  4. Main Method Structure: ArnoldC programs have a defined entry point, IT'S SHOWTIME and YOU HAVE BEEN TERMINATED, which corresponds to the MainMethodNode.
    • Refer to: src/main/scala/org/arnoldc/ast/MainMethodNode.scala and src/main/scala/org/arnoldc/ArnoldC.scala.
  5. Keywords and Mappings: The project maps Arnold Schwarzenegger's catchphrases to programming language constructs. Understanding these mappings is key to writing ArnoldC code.
    • Refer to: README.md for the keyword list.

What is in this showcase?

Programming language based on the one-liners of Arnold Schwarzenegger. Every page here was generated from the source repository: the overview, one page per module, and the file paths each claim is based on. Nothing was written by hand, and nothing requires an account to read.

Generated pages
4
Latest generation
Jun 1, 2026

How are these docs generated?

ShipDocs indexes the repository, plans one module per component, writes each page from the real code with cited file paths, then re-generates the pages a commit changed. The module plan and the citations you see here are the same ones the product produces for a private repository.

Can I do this for my own repository?

Yes. Import a GitHub, GitLab, or Bitbucket repository and you get the same structure for your code, plus cited chat and an MCP endpoint for coding agents. Start with the free trial (no card) and keep the Markdown either way: generate docs for your own repository.

What other repositories are documented here?

Browse every live documentation example · Run a free analysis on your own repo

By The ShipDocs team · Reviewed