1.1.1 • Published 5 months ago

@darabonba/csharp-generator v1.1.1

Weekly downloads
25
License
Apache-2.0
Repository
github
Last release
5 months ago

English | 简体中文

Darabonba Code Generator for CSharp

Node.js CI codecov NPM version npm download

Installation

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/csharp-generator

Usage

'use strict';
const path = require('path');
const fs = require('fs');

const Parser = require('@darabonba/parser');
const CSGenerator = require('@darabonba/csharp-generator');

const sourceDir = "<Darabonda package directory>";
const outputDir = "<Generate output directory>";

// generate ast data by Parser
let packageMetaFilePath = path.join(sourceDir, 'Darafile');
let packageMeta = JSON.parse(fs.readFileSync(packageMetaFilePath, 'utf8'));
let mainFile = path.join(sourceDir, packageMeta.main);
let ast = Parser.parse(fs.readFileSync(mainFile, 'utf8'), mainFile);

// initialize generator
let generatorConfig = {
  ...packageMeta,
  pkgDir: sourceDir,
  outputDir
};

let generator = new CSGenerator(generatorConfig);

// generate csharp code by generator
generator.visit(ast);

// The execution result will be output in the 'outputDir'

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.

1.1.1

5 months ago

1.1.0

1 year ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.19

3 years ago

1.0.20

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago