/dslbook

Sample Kotlin DSL for Menus. Part of the book: Building Domain Specific Languages in Kotlin on leanpub

Primary LanguageKotlin

Building Domain Specific Languages in Kotlin

This repository contains the code for the book. Enjoy.

See leanpub.com/kotlindsls.

example code

Create amazing code like this

builder {
            "blt" has "bacon"
            "blt" has "lettuce"
            "blt" has "tomato"

            "pizza" has "cheese"
            "pizza" has "pepperoni"

            "blt" with ingredients named "bacon"
            "blt" with condiments named mayonnaise
            "blt" with condiments named mustard

            "blt" with ingredients named "bacon" and "lettuce" and "tomato"
            "blt" with condiments named mayonnaise and mustard

            "blt" with ingredients named "bacon" and "lettuce" and "tomato" and condiments named mayonnaise and mustard
        }