import java.io.{InputStreamReader, InputStream}
import gr.grnet.aquarium.util.Loggable
import gr.grnet.aquarium.util.yaml._
+import org.yaml.snakeyaml.Yaml
+import java.lang.StringBuffer
import java.util.Date
/**
*
* @author Georgios Gousios <gousiosg@gmail.com>
*/
-object DSL extends Loggable {
- private object Vocabulary {
- val creditpolicy = "creditpolicy"
- val resources = "resources"
- val policies = "policies"
- val policy = "policy"
- val pricelists = "pricelists"
- val pricelist = "pricelist"
- val agreements = "agreements"
- val agreement = "agreement"
- val name = "name"
- val overrides = "overrides"
- val effective = "effective"
- val from = "from"
- val to = "to"
- val repeat = "repeat"
- val start = "start"
- val end = "end"
- }
+object DSL extends Loggable {
private val emptyPolicy = DSLPolicy("", None, Map(),
DSLTimeFrame(new Date(0), None, Option(List())))
}
}
+sealed abstract class DSLTreeNode {
+ abstract def toYaml() : String
+ abstract def children() : List[DSLTreeNode]
+}
+
case class DSLCreditPolicy (
policies: List[DSLPolicy],
pricelists: List[DSLPriceList],
--- /dev/null
+package gr.grnet.aquarium.logic.accounting.dsl
+
+object Vocabulary {
+ val creditpolicy = "creditpolicy"
+ val resources = "resources"
+ val policies = "policies"
+ val policy = "policy"
+ val pricelists = "pricelists"
+ val pricelist = "pricelist"
+ val agreements = "agreements"
+ val agreement = "agreement"
+ val name = "name"
+ val overrides = "overrides"
+ val effective = "effective"
+ val from = "from"
+ val to = "to"
+ val repeat = "repeat"
+ val start = "start"
+ val end = "end"
+}