1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Aaron VonderHaar 4cc2150338 ex2: bonus 3 years ago
input-files Initial commit 3 years ago
scripts Initial commit 3 years ago
solutions Improved pointers to documentation, git dependencies from git:// to https://, updated Cubix dep 3 years ago
test Initial commit 3 years ago
tutorial ex2: bonus 3 years ago
.gitignore Initial commit 3 years ago
LICENSE Initial commit 3 years ago
README.md Improved pointers to documentation, git dependencies from git:// to https://, updated Cubix dep 3 years ago
Setup.hs Initial commit 3 years ago
commons-lang3-3.2-SNAPSHOT.jar Initial commit 3 years ago
cubix-tutorial.cabal Initial commit 3 years ago
javaparser-1.0.8.jar Initial commit 3 years ago
javaparser-to-hs.jar Initial commit 3 years ago
package.yaml Initial commit 3 years ago
stack.yaml Move away from SSH remotes in stack.yaml; update Cubix version 3 years ago

README.md

These are the exercises accompanying the Cubix tutorial. They are found in the tutorial folder.

  • Exercise 1: Language fragments: Creating a toy language using the style of representation used by Cubix
  • Exercise 2: Parametric syntax: Writing a small transformation that runs on multiple languages
  • Exercise 3: Incremental parametric syntax: Expressing a language using a hybrid of language-specific and generic parts
  • Exercise 4: Language-parametric transformation: Writing a sanitization transformation that runs on C, Java, JavaScript, Lua, and Python

Getting started

Open the documentation for Cubix.Essentials. This is a companion to this tutorial. It contains everything you will need to complete the exercises, organized in a tutorial form.

For exercise 2 and later, you'll also want to open the documentation for Cubix.Language.Parametric.Syntax, which contains the generic nodes shared across language representations.

Now, open up tutorial/ex1/Main.hs and start following along.

To build:

./scripts/fastbuild.sh # Normal "stack build" also suffices

To run your exercises

stack exec tut1 # Or tut2, tut3, tut4

To run the standard solutions

stack exec soln1 # Or soln2, soln3, soln4