Skip to content

aslakjohansen/cflat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cflat

This package implements the C♭ language (pronounced C-flat). It aims to implement the procedural subset of C#.

Currently, it supports:

  • integers and booleans.
  • variable declarations and assignments in one statement.
  • variable assignments.
  • branches with if and else.
  • blocks.
  • while, do-while and for loops.
  • strings can be printed but are not handled nicely.
  • optional initial environment (map from variable names to values)

Functionality implemented:

  • Lexing
  • Parsing
  • Rendering of abstract syntax tree
  • Evaluation of abstract syntax tree (result as a map of variables)

Installation

The package can be installed by adding cflat to your list of dependencies in mix.exs:

def deps do
  [
    {:cflat, "~> 0.2.2"}
  ]
end

The docs can be found at https://hexdocs.pm/cflat.

Use

Open the demo in Livebook.

About

Package implementing the C♭ subset of the C# programming language

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages