2024-02-24 21:30:30 +00:00
|
|
|
//import * as babelparser from "../babel/packages/babel-parser";
|
|
|
|
import * as babelparser from "@babel/parser";
|
|
|
|
//import core from "../babel/packages/babel-core";
|
|
|
|
import { parse_with_plugins } from "./parser/parse";
|
2024-05-11 14:09:03 +00:00
|
|
|
import {
|
|
|
|
SelfHostedRecipe,
|
|
|
|
TransformRecipe,
|
|
|
|
transform,
|
|
|
|
} from "./transform/transform";
|
|
|
|
|
|
|
|
import { parseDSLtoAST } from "../didactic-chainsaw-dsl/src/JSTQL_interface/fetchAST";
|
|
|
|
import { parseJSTQL } from "./langium/langiumRunner";
|
|
|
|
const path = "test.js";
|
2024-02-24 21:30:30 +00:00
|
|
|
const file = Bun.file(path);
|
|
|
|
const codeFromFile = await file.text();
|
|
|
|
const main = async () => {
|
2024-05-11 14:09:03 +00:00
|
|
|
//transform(selfHostedTransformExampleMultiStmt, codeFromFile);
|
|
|
|
|
|
|
|
const jstql_file =
|
2024-05-12 18:06:37 +00:00
|
|
|
"/home/rolfmg/Coding/Master/didactic-chainsaw/dsl_files/pipeline.jstql";
|
2024-05-11 14:09:03 +00:00
|
|
|
const test_file = Bun.file(jstql_file);
|
|
|
|
const test_JSTQL = await test_file.text();
|
2024-05-12 18:06:37 +00:00
|
|
|
let proposals = await parseJSTQL(test_JSTQL);
|
|
|
|
|
2024-02-24 21:30:30 +00:00
|
|
|
await Bun.write(
|
2024-05-12 18:06:37 +00:00
|
|
|
"output.js",
|
|
|
|
transform(proposals[0].pairs[0], codeFromFile)
|
2024-05-11 14:09:03 +00:00
|
|
|
);
|
2023-12-11 18:38:30 +00:00
|
|
|
};
|
2023-12-06 12:44:49 +00:00
|
|
|
|
|
|
|
main();
|