From: Francis Russell Date: Wed, 28 Mar 2012 17:30:37 +0000 (+0100) Subject: Work on building types for code generation. X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=9b4322ce440f4d7a657044321914a0b848efb218;p=francis%2Fofc.git Work on building types for code generation. --- diff --git a/src/ofc/codegen/IterationTemplate.scala b/src/ofc/codegen/IterationTemplate.scala index 723c045..c7ea71e 100644 --- a/src/ofc/codegen/IterationTemplate.scala +++ b/src/ofc/codegen/IterationTemplate.scala @@ -1,4 +1,4 @@ package ofc.codegen -class IterationTemplate { +class IterationTemplate(statement: Statement) { } diff --git a/src/ofc/codegen/LoopRange.scala b/src/ofc/codegen/LoopRange.scala new file mode 100644 index 0000000..985b09e --- /dev/null +++ b/src/ofc/codegen/LoopRange.scala @@ -0,0 +1,4 @@ +package ofc.codegen + +class LoopRange(index: VariableSymbol, start: Expression, count: Expression, statement: Statement) extends Statement { +} diff --git a/src/ofc/codegen/Record.scala b/src/ofc/codegen/Record.scala new file mode 100644 index 0000000..c8341a1 --- /dev/null +++ b/src/ofc/codegen/Record.scala @@ -0,0 +1,3 @@ +package ofc.codegen + +class RecordType extends Type diff --git a/src/ofc/codegen/Statement.scala b/src/ofc/codegen/Statement.scala new file mode 100644 index 0000000..4028f7d --- /dev/null +++ b/src/ofc/codegen/Statement.scala @@ -0,0 +1,4 @@ +package ofc.codegen + +trait Statement +class NullStatement extends Statement diff --git a/src/ofc/codegen/Symbol.scala b/src/ofc/codegen/Symbol.scala index 424c052..5993e19 100644 --- a/src/ofc/codegen/Symbol.scala +++ b/src/ofc/codegen/Symbol.scala @@ -1,3 +1,4 @@ package ofc.codegen class Symbol(name: String) +class VariableSymbol(name: String) extends Symbol(name) diff --git a/src/ofc/codegen/Type.scala b/src/ofc/codegen/Type.scala new file mode 100644 index 0000000..0094ef0 --- /dev/null +++ b/src/ofc/codegen/Type.scala @@ -0,0 +1,3 @@ +package ofc.codegen + +trait Type diff --git a/src/ofc/generators/onetep/PPDFunctionSet.scala b/src/ofc/generators/onetep/PPDFunctionSet.scala index ebd2537..37a771d 100644 --- a/src/ofc/generators/onetep/PPDFunctionSet.scala +++ b/src/ofc/generators/onetep/PPDFunctionSet.scala @@ -1,6 +1,12 @@ package ofc.generators.onetep +import ofc.codegen._ class PPDFunctionSet(val basis : String, data : String) extends FunctionSet { + def getReader = { + new IterationTemplate(new NullStatement()) + } + def getDiscreteIndices = List.empty + def getSpatialIndices = List.empty /* class SphereIndex(parent: PPDFunctionSet) extends DiscreteIndex { def getName = "sphere_index"