Skip to content

Latest commit

 

History

History
77 lines (64 loc) · 1.27 KB

README.md

File metadata and controls

77 lines (64 loc) · 1.27 KB

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