Parsers Tutorial

Key Concepts

Particle Syntax (Particles) is a syntax for human & machine friendly languages that are as simple as possible. Simplicity is measured by the count of the pieces: the fewer pieces to build a language the better.

A Particles program is a string, a particle, and a spreadsheet all at the same time. You will often work treat your program as all 3, sometimes concurrently.

Parsers is a language built on top of Particles for building other languages. This tutorial walks you through building a very simple language in Parsers.

Parsers has one main concepts: Parsers. Parsers take a line(s) and handle it according to the definitions you write in your Parsers program. A language is simple a combination of Parsers.

Before you start:

Step 1

Step 2

Step 3

{yourLanguageNameGoesHere}Parser root

Step 4

{yourLanguageNameGoesHere}Parser root description {thisIsALangageToHelpYouDoX}

Step 5

birthdaysParser root description A language for storing your friend's birthdays. friendParser description Store information about a friend. cruxFromId

Step 6

birthdaysParser root description A language for storing your friend's birthdays. inScope friendParser friendParser description Store information about a friend. cruxFromId

Step 7

friend friend friend

Step 8

... friendParser description Store information about a friend. cruxFromId inScope nameParser nameParser

Step 9

friend name friend name ...

Step 10

nameAtom paint string ...

Step 11

... nameParser catchAllAtomType nameAtom

Step 12

friend name Ben Franklin friend name Ada Lovelace

Step 13

birthdaysParser root description A language for storing your friend's birthdays. inScope friendParser catchAllParser errorParser errorParser baseParser errorParser

frieeeend name Ben Franklin

Step 14

That's all for now! Let us know what you need to do next. Of course, we haven't really gotten to the fun stuff yet. Languages get really interesting once you start implementing the "interesting methods", like compile, execute, render, and format.

Built with Scroll v136.10.0