Giter VIP home page Giter VIP logo

libfbjs's Introduction

Archived Repo
=============
This is an archived project and is no longer supported or updated by Facebook. 
Please do not file issues or pull-requests against this repo. If you wish to 
continue to develop this code, we recommend you fork it.

Proceed and be bold!

== Building ==
It's recommended that you build this software with the latest versions of flex
and bison.

You can download flex here:
http://flex.sourceforge.net/

And bison here:
http://www.gnu.org/software/bison/

This software was developed using flex version 2.5.35 and bison version 2.3.
Please note that flex 2.5.4 is OLDER than 2.5.35, and will not be able to build
this software.

To build simply execute `make fbjs`. You can ignore the sign warning in
`yy_get_next_buffer`; I'm pretty sure that's a bug in flex and not in libfbjs.


== How to use ==
To apply the FBJS2 transformations to a program `make fbjs` and pipe a program
to `fbjs`. In cli.cpp you'll find the code needed to invoke this transformation.

To use the FBJS2 parser in other software you may want to check out
jsbeautify.cpp. Documentation is paltry, but it should be pretty easy to get up
to speed if you have a familiarity of Javascript and C++.


== Notes ==
* NodeString expressions are implemented poorly right now. Instead of parsing
  what's in the string we just grab the raw contents from code. This was just
  a hack because I didn't feel like writing the state machine to convert \x,
  \u, \0, etc into bytes.
* There will be a memory leak when you attempt to parse a program with a syntax
  error in it. This is because the authority of freeing allocated nodes is left
  to the parent node. The problem is that the allocated child nodes aren't added
  to the AST until the very last reduciton. Thus, when a ParseException is
  raised the allocated nodes are lost since they never became associated with a
  managed node.
* Handling of virtual semicolons is probably not to spec.

libfbjs's People

Contributors

jamesgpearce avatar davefet 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.