Coder Social home page Coder Social logo

u64lisa / axiol-language Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 0.0 607 KB

axiol-language is a small hobby language without any dependencies compiling to assembly and other different targets

Java 100.00%
compiler compiler-design lexer parser programming-language syntax-analysis

axiol-language's Introduction

axiol-language

  • axiol-language is a small hobby language without any dependencies compiling to assembly and other different targets. the following readme shows further descriptions and documentations to features and general elements of the language.

The following symbols show the current state of a feature, syntax or general element:

(โœ…) This feature is fully implemented and working to current date
(๐Ÿšง) This feature is halfway implemented or still in progress
(โŒ) This feature is NOT implemented and is still in planing

Diagram

---
title: Language Diagram
---
graph TD;
    classDef red stroke:#f00
    classDef green stroke:#0f0

    source(["Source *.ax"])
    lexer["Lexer (TokenStream)"]
    source:::red --> lexer
    parser["Parser (AST)"]
    lexer --> parser
    analysis["StaticAnalysis"]
    error_stage_1["Analysis Error report"]
    analysis --> error_stage_1
    optimising["ASTOptimizer"]
    parser --> analysis
    parser --> optimising    
    instructionGen["Instruction Generation"]
    optimising --> instructionGen
    instructionModification["Instruction Modification
    using the **isa** keyword"]
    instructionGen --> instructionModification
    optimising-- ISAStatement ---instructionModification
    linker["Linking multiple
    instruction sets"]
    instructionModification --> linker
    importingLogic["importing files"]
    importedSources["imported files"]
    linker --> importingLogic
    importingLogic --> importedSources
    importedSources --> lexer;
    compiler["Compiler Instructions
    to target"]
    inlineASM["Generating Inline 
    Assembly"]
    linker --> inlineASM
    linker --> compiler
       finishedCode(["Finished generated
        Code *.asm"])
    compiler --> finishedCode:::green
Loading

Compiler-Targets

Architecture Supported Sizes Status
ARM โŒ
THUMB
THUMB_EB
โŒ
AARCH64
AARCH64_32
AARCH64_BE
โŒ
X86
X86_64
โŒ
RISCV64
RISCV32
โŒ
MIPS
MIPS_EL
MIPS64
MIPS64_EL
โŒ
PPC32
PPC32_LE
PPC64
PPC64_LE
โŒ
SPARC64 โŒ
AVR โŒ
IR โŒ

Documentation

Primitives:

name desc size example (scaled on max range exp)
i8 signed type 8 42
i16 signed type 16 1000
i32 signed type 32 50000
i64 signed type 64 1000000
i128 signed type 128 100000000000000000000000000000000000000
u8 unsigned type 8 255u
u16 unsigned type 16 50000u
u32 unsigned type 32 400000000u
u64 unsigned type 64 1000000000000000000u
u128 unsigned type 128 100000000000000000000000000000000000000u
f32 floating type 32 3.14f
f64 floating type 64 3.141592653589793f
u0 equal to void 0 ()
string wrapped char-array len of array * 8 "Hello, World"
char single char 8 'A'
boolean 2 state type 8 true false
void unusable value can be used for returns 0 void
null null value can be used for returns 0 null

Usage References, Pointer, Clones

Syntax:

<type> [ptr][clone]<name> = [ref]<expr>;

pointer:

i32 *pointer = &value;

references:

i32 reference = *pointer;

address:

() address = (void*) &reference;

clone:

i32 @test = orig;

Lambda

(<ident>,...) -> {}
(<ident>,...) -> expr

examples:

lambdaTest(() -> 4);

lambdaTest((argc, args) -> 4);

lambdaTest((args) -> 4);

lambdaTest((args) -> {

});

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.