Coder Social home page Coder Social logo

satyajitghana / projektbarium Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 8.29 MB

ProjektBarium - a compiler for my programming language barium

License: MIT License

CMake 1.90% C++ 87.71% Makefile 0.04% Yacc 6.58% Lex 2.47% Shell 1.30%
projekt barium compiler llvm conan flex bison yacc mini compiler-design

projektbarium's Introduction

Projekt Barium - A Basic Compiler for Barium Programming Language

This is the compiler i built for my programming lanugage barium, a fun little project to understand compilers.

Tech Stack : Flex, Bison, LLVM

Build Status

ubuntu-build

Status

language-count top-language repo-size loc-count

release-date release license maintainer

The Compiler Recipe

Lexical Analyzer (Lex) -> Semantic Parsing (Bison) -> Assembly (LLVM) -> Executable

Task List

  • Add Data Types (decimal, fraction)
  • Operators, Symbols, Reserved Keywords
  • Add Looping Statements - ongoing (parse done)
  • Add Control Statements - ongoing (parse done)
  • Add Output Statements - uses vprintf
  • Add Input Statements
  • Add Arrays Support - ongoing (parse done)
  • Create a CI/CD Pipeline
  • Output executables instead of obj files (partial support)
  • locations (YYLTYPE, and @$)

Far-fetched task list

  • Make it a Library
  • Add Boost Math Support
  • Containerize the Compiler using Docker

Dependencies

  • LLVM 9.0.1
  • Bison 3.5.2
  • Flex 2.6.4

Known Issues

  • Spacing is required between operators to remove ambiguity

Build Barium (Installs Deps)

$ sudo sh build.sh

Run Tests

$ sh run_tests.sh

Example Run

Normal Run

$ ./barium test_files/test_all_ir.bar -v OFF

Debug Verbose Run

$ ./barium test_files/test_all_ir.bar -v INFO

Screenshot

help

Compiler Recipe

compiler-recipe

Example AST

Run binary-op-test

AST binary-op-test-ast

projektbarium's People

Contributors

prachipoddar20 avatar satyajitghana avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

sho94os

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.