Skip to content
/ aGen Public
forked from dfranx/aGen

Fast and adaptable BlueByte generator

License

Notifications You must be signed in to change notification settings

octogame/aGen

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aGen

aGen is a header-only C++17 library that can be used to generate BlueVM bytecode. It can be used as a layer for compilers.

How to use

Since this is a header-only library no compiling is needed. You put aGen.hpp in your project and after that start using aGen by including the header.

There are few examples in the examples directory. The examples and aGen require no dependencies.

NOTE: you need to have a compiler that supports C++17 features to compile projects that use this library.

Example

Include library in your project:

#include "aGen.hpp"

Define new bytecode generator

ag::Generator gen;

Set bytecode version

gen.SetHeader(1, 0);

Define new function

gen.Function.Create("main");

Make that function active - function in which we will place our code

gen.Function.SetCurrent("main");

Put some code in the active function:

gen.Function.PushStack(5);	// 5
gen.Function.PushStack(2);	// 2 5
gen.Function.Add();		// 5 + 2
gen.Function.Return();		// return 5 + 2

Get bytecode that we generated with those commands:

ag::ByteCode bc = gen.Get();

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Fast and adaptable BlueByte generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 98.9%
  • CMake 1.1%