Skip to content

AndrewRutherfoord/sle-rug-2023

 
 

Repository files navigation

useful commands:

Create Parse Tree for File

import ParseTree;
import Syntax;
t = parse(#start[Form], |project://sle-rug/examples/tax.myql|, allowAmbiguity=true);

Getting Syntax Highlighting to work

import IDE;
main();

Create AST for File

First 2 steps from Create Parse Tree for File. Then:

import CST2AST;
ast = cst2ast(t);

Checking

import IDE;
import ParseTree;
import AST;
import CST2AST;
import Syntax;

t = parse(#start[Form], |project://sle-rug/examples/tax.myql|, allowAmbiguity=true);

ast = cst2ast(t);

check(ast);

Eval

Create Parse Tree for File

import IDE;
import ParseTree;
import AST;
import CST2AST;
import Syntax;
import Compile;
import Eval;

tax = parse(#start[Form], |project://sle-rug/examples/tax.myql|, allowAmbiguity=true);
ast = cst2ast(tax);

env = initialEnv(ast);

// Example eval
eval(ast, input("hasBoughtHouse", vbool(true)), env)

About

SLE course at University of Groningen

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rascal 71.8%
  • HTML 14.9%
  • JavaScript 13.3%