GithubHelp home page GithubHelp logo

sei-lisa / lsl-compiler Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 2.0 160 KB

Distill the built-in Second Life viewer's LSL compiler into a standalone executable generating LSO and Mono (asm only, no binary)

License: GNU Lesser General Public License v2.1

Makefile 0.30% C++ 88.28% Yacc 7.63% C 1.24% Objective-C 1.94% Python 0.60%
lsl compiler secondlife scripting viewer-sources

lsl-compiler's Introduction

LSL-compiler

This is a standalone LSL compiler, extracted from the viewer sources. Its main purpose is to allow the analysis of the generated code, providing an insight into the internals of Mono and LSO, but it can also be used as an external syntax checking tool.

This version includes some fixes and code changes that are believed to exist in the server (like the output of ldloc/stloc), or that do not affect compilation or generated code (like fixes to the pretty printer).

Building

Building requires installation of kwdb. The file indralex.py present in the source should be copied to kwdb's lsl2dfg/lsloutputs/ directory. Edit Makefile to point to the installation directory of kwdb and to modify the compiler options if required.

kwdb in turn requires python 2. flex and bison are also required. And of course, a C++ compiler (tested with g++ only).

Running

Run by entering:

./lslcomp <filename>

The input script's extension defaults to .lsl if not specified. In case of successful compilation, it generates the following files:

  • An .out file with the LSO assembler output.
  • A .cil file with the Mono assembler output.
  • An .lsl.pp (or whatever the original extension was, with .pp appended) file with the pretty-printed script output.

In case of error, the error message is displayed in standard error, and the .out file and possibly the .lsl.pp file are still generated.

The generated .cil file is suitable as input to the Mono assembler, which can generate a .dll with this command:

ilasm /dll <filename>.cil

(assuming you have the mono-devel package).

License

This program, like the viewer sources it is based on, is licensed under the GNU LGPL v2.1.

Copyright © 2010 Linden Research, Inc.
Copyright © 2017 Sei Lisa.

Sei Lisa is the author's user name in the Second Life® virtual world.

lsl-compiler's People

Contributors

sei-lisa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

wildwiz fixedbit

lsl-compiler's Issues

Prebuilt Release exe

I am not C/Cpp developer, Can we have prebuilt exe file in releases page to download.

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.