Coder Social home page Coder Social logo

cgarrotti / pas2js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from davidroliveira/pas2js

0.0 0.0 0.0 35 KB

Pascal-to-JavaScript converter

Home Page: http://iottmco.wordpress.com/2011/07/10/how-little-things-change-a-pascal-to-javascript-converter/

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.70% Lex 10.81% Yacc 87.90% C 0.27% JavaScript 0.31%

pas2js's Introduction

pas2js: Convert Pascal to Javascript

Usage

pas2js < program.pas > program.js

The resulting program.js will be ill-formatted, so if you're planning on editing it, you'll want to run it through a pretty-printer, such as google's closure compiler.

pas2js < program.pas | closure --formatting PRETTY_PRINT > program.js

The resulting javascript file will be dependendent on pascal.js for equivalents of various pascal functions.

Known Bugs

First note that this code is a) outdated and b) written for a different dialect of pascal than you're using, written by a programmer who doesn't have your habits. Don't assume that it will do anything but barf when you feed it your own code. Listed below are some known and important bugs.

  • Types aren't handled quite correctly. (Specifically, they are mostly ignored.)

  • Labels and GOTO statements will not work. (It is not completely infeasible to support these in the future, but doing so may result in a serious performance penalty.)

  • WITH blocks will generate warnings when run through a pretty-printer or a linter, since the converted version uses JavaScript's deprecated with construct.

  • The pascal.js library is far from complete.

pas2js's People

Contributors

bytbox 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.