Giter Site home page Giter Site logo

cobolscript's Introduction

CobolScript

COBOL language compiler to Javascript. Work in Progress

Installation

Via npm using (Node.js)[http://nodejs.org]:

npm install cobolscript

Usage

Reference in your program:

var cobolscript = require('cobolscript');

To compile a source code:

var program = cobolscript.compileProgram('display "Hello, world".');

To compile a file:

var program = cobolscript.compileProgramFile('./hello.cob');

To run a compiled program:

program.run(cobolscript.getRuntime());

Some programs need a runtime object that provides helper functions, i.e. display implementation. In the above example, a console-oriented runtime object is obtained.

In web samples, a runtime that uses request, response is used:

http.createServer(function(req, res) {
    program.run(cobs.getRuntime({ request: req, response: res }));
}).listen(8000);

Development

git clone git://github.com/ajlopez/CobolScript.git
cd CobolScript
npm install
npm test

Samples

Hello Simple Hello, world program, without division declarations.

Hello Program Hello, world program, with identification, environment, data and procedure divisions.

Hello Web Hello web page. display output produces page content.

Factorial Factorial console program, using working storage variable, perform with using and giving and local variables for recursion.

Factorial Web Factorial web page.

Local Using local to define a variable, instead of working storage.

Template Console program using a template. CobolScript can be embedded in text.

Template Web Web page using a template.

Web Server Accessing Node.js functions, to start a web server and serves a single page.

Linkage Section Using linkage section to access provided request, response in web page.

Asynchronous Hello Perform and procedure using the new async reserved word.

MySQL Connecting and using a MySQL server.

MySQL Web Connecting and using a MySQL server, generating web pages, listing databases, tables and columns.

Web Site Dynamic site using MySQL server, with customers and suppliers.

To do

  • More Samples
  • Logical operators and expressions
  • IS, NOT
  • Comparison word operators
  • Compute
  • Complex expressions
  • Pictures.
  • File section.
  • Database section.
  • Copy
  • exec sql.

Versions

  • 0.0.1 Published
  • 0.0.2 Under development, in master

References

COBOL Tutorial

COBOL Tutorials

COBOL Programming Standards

Contribution

Feel free to file issues and submit pull requests โ€” contributions are welcome.

If you submit a pull request, please be sure to add or update corresponding test cases, and ensure that npm test continues to pass.

cobolscript's People

Contributors

ajlopez avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.