Created
January 28, 2010 09:46
-
-
Save elephantum/288588 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GdDocument(name) { | |
this.name = name; | |
this.sources = []; | |
} | |
function GdProcess(inputs, outputs) { | |
this.inputs = inputs; | |
this.outputs = outputs; | |
for (var i in this.outputs) { | |
this.outputs[i].sources.push(this); | |
} | |
} | |
function GdCondition() { | |
} | |
function GdConditional(doc, condition) { | |
this.doc = doc; | |
this.condition = condition; | |
} | |
function cond(condition, doc) { | |
return new GdConditional(doc, condition); | |
} | |
function req(doc) { | |
return new GdConditional(doc, null); | |
} | |
function And(a, b) { | |
this.a = a; | |
this.b = b; | |
} | |
function and(a, b) { | |
return new And(a ,b); | |
} | |
var passport = new GdDocument("passport"); | |
var registration = new GdDocument("registration"); | |
var form32 = new GdDocument("form32"); | |
var male_age_17_27 = new GdCondition(); | |
var foreignPassport = new GdDocument("zagran"); | |
var initialGetForeignPassport = new GdProcess( | |
[ | |
req(passport), | |
req(registration), | |
cond(male_age_17_27, form32) | |
], | |
[ | |
foreignPassport | |
] | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment