Commit 375a6e30 authored by Václav Král's avatar Václav Král

Added README

parent 6ca69683
Usage:
```sh
./build.sh # builds the project
./fml.sh input.json > output.bc # compiles the input json into FML bytecode
./fml.sh -d input.json # compiles the input and produces debug printout of bytecode
```
\ No newline at end of file
#!/bin/bash
./target/release/compiler-bc-rs "$1"
if [ "$1" = "-d" ]; then
./target/release/compiler-bc-rs -d "$2"
else
./target/release/compiler-bc-rs "$1"
fi
......@@ -10,7 +10,7 @@ use crate::compiler::instruction::Instruction;
use crate::compiler::program::Program;
use crate::compiler::program_object::ProgramObject;
use anyhow::*;
use std::collections::{HashMap, HashSet};
use std::collections::HashMap;
use std::ops::Deref;
type Index = u16;
......@@ -24,7 +24,6 @@ pub struct Function {
#[derive(Debug)]
pub struct Compiler {
label_cnt: u16,
labels: HashSet<String>,
const_pool: Vec<ProgramObject>,
globals: Vec<Index>,
entry: Index,
......@@ -37,7 +36,6 @@ impl Compiler {
pub fn new() -> Compiler {
Compiler {
label_cnt: 0,
labels: HashSet::new(),
const_pool: Vec::new(),
globals: Vec::new(),
entry: 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment