Skip to content

An interpreter and compiler for the Circuit language.

Notifications You must be signed in to change notification settings

Bitbot25/circuit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Circuit

A compiled / interpreted language made in Rust.

Installation

Add this to your Cargo.toml

[dependencies]
circuit-lang = "0.1.0"

Example

extern crate circuit_lang as circuit;

use circuit::lexer;
use circuit::parser::{ParseStream, parse};

fn main() {
   let tokens = lexer::tokenize("1+2").expect("Failed to tokenize input!");
   let mut stream = ParseStream::new(tokens);

   // Parses an add expression or one with lower precedence.
   println!("Generated AST: {:#?}", parse::add(&mut stream));
}

Finished syntax

use std::env;

fun main() {
   printf("The name of this program is {0}", env::arg(0));
   print("Hello, World!");
}

About

An interpreter and compiler for the Circuit language.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages