GithubHelp home page GithubHelp logo

kevinkelley / article-llvm-rpg Goto Github PK

View Code? Open in Web Editor NEW

This project forked from strumenta/article-llvm-rpg

0.0 1.0 0.0 4.1 MB

CMake 1.03% C++ 94.69% Objective-C++ 0.45% Shell 0.09% ANTLR 2.64% Batchfile 0.05% Objective-C 0.01% C 0.55% Makefile 0.49%

article-llvm-rpg's Introduction

A tutorial on how to write a compiler using LLVM

The project requires the LLVM librariaries installed see https://llvm.org/docs/GettingStarted.html#getting-started-with-llvm.

Project Structure

.
├── bin           
│   └── antlr-4.8-complete.jar   // ANTLR4 tool
|
├── rpgle           
│   └── CALCFIB.rpgle   // Sample RPG file
├── src             
│   ├── antlr           // ANTLR4 grammar files
│   ├── generated       // ANTLR4 generated parser/lexer
│   └── rpg             // C++ source code
│      
└── CMakeLists.txt      // CMake file

Compile and run

CMake

article-llvm-rpg$ cmake .

Build the project

article-llvm-rpg$ make -j2 

Run the sample

article-llvm-rpg$ ./rpg rpgle/CALCFIB.rpgle 

Generate parser and lexer

The ANTLR4 lexer and parser are already included in the source code, the antlr .jar file required to is available in the bin directory. To re generate the lexer and the parser:

article-llvm-rpg$ java -cp ./bin/antlr-4.8-complete.jar org.antlr.v4.Tool -Dlanguage=Cpp -listener -visitor -o src/generated/ -Xexact-output-dir -package antlrcpprpg src/antlr/RpgLexer.g4 src/antlr/RpgParser.g4

article-llvm-rpg's People

Contributors

mctaverna avatar

Watchers

 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.