Skip to content

erlang-one/bert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Type Driven BERT Parser Generator

Supported Languages

  • Java
  • JavaScript
  • Swift

Erlang Model

-record(error, { code=[] :: [] | binary() }).
-record(ok, { code=[] :: [] | binary() }).
-record(io, { code=[] :: [] | #ok{} | #error{},
              data=[] :: [] | <<>> | { atom(), binary() | integer() } }).

Swift Model

class Err {
    var code: AnyObject?
}
class Ok {
    var code: AnyObject?
}
class Io {
    var code: AnyObject?
    var data: AnyObject?
}

Specification

Chain(types: [
     Model(value:Tuple(name: "io", body: [
          Model(value:Chain(types: [
               Model(value: Tuple(name:"ok", body: [
                    Model(value:Atom())])),
               Model(value: Tuple(name:"error", body: [
                    Model(value:Atom())]))])),
          Model(value:Tuple(name:"", body:[
               Model(value:Atom()),
               Model(value:Chain(types: [
                    Model(value:Binary()),
                    Model(value:Number())]))]))])) ])

Run

$ rebar compile

Credits

  • Anton Makarov
  • Viacheslav Katsuba
  • Maxim Sokhatsky

OM A HUM

About

Type Driven BERT Parser Generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 72.1%
  • Erlang 27.9%