Skip to content

dhy2000/libsysy-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libsysy-rs

A rust implementation of libsysy, the static link library with i/o and timer of SysY, a subset of c language for cscc compiler competition.

Usage

To build the library, run cargo build -r and the artifact is at target/release/libsysy.a. To link with c or assambly code, run gcc -static -o <binary> <c source/assembly code> libsysy.a and get a static-linked executable binary.

There is an example, enter example directory and execute ./run.sh to run the example.

Structure

Features

  • Fully compatible with the official libsysy in C
  • libc api calls in rust
  • Data transfer between rust and c via raw pointer and unsafe
  • Module constructor and destructor in rust with ctor crate

About

SysY link library in rust.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published