You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Darabonba Code Generator was designed to work in Node.js. The preferred way to install the Generator is to use the NPM package manager. Simply type the following into a terminal window:
npm install @darabonba/python-generator
Usage
'use strict';constpath=require('path');constfs=require('fs');constGenerator=require('@darabonba/python-generator');constDSL=require('@darabonba/parser');constmodulePath='<module path>';constmoduleOutputDir='<output dir path>';constteaFile=fs.readFileSync(path.join(modulePath,'Darafile'),'utf8');constmain=fs.readFileSync(path.join(modulePath,'main.dara'),'utf8');constpkgInfo=JSON.parse(teaFile);constconfig={outputDir: moduleOutputDir,pkgDir: modulePath,
...pkgInfo};// generate AST data by parserconstast=DSL.parse(main,path.join(modulePath,'main.dara'));// initialize generatorconstgenerator=newGenerator(config,'python');generator.visit(ast);
Issues
Opening an Issue, Issues not conforming to the guidelines may be closed immediately.
Changelog
Detailed changes for each release are documented in the release notes.
License
Apache-2.0
Copyright (c) 2009-present, Alibaba Cloud All rights reserved.