Parser and type checker almost completely working

Added testing env
This commit is contained in:
macocianradu
2021-11-11 17:25:30 +01:00
parent 464ef29caa
commit 3890ed5f03
32 changed files with 287 additions and 356 deletions

View File

@@ -0,0 +1,4 @@
enum PeriodEnum: <"The enumerated values to specified the period, e.g. day, week.">
D displayName "day" <"Day">
M displayName "month" <"Month">
Y displayName "year" <"Year">

View File

@@ -0,0 +1,4 @@
enum EnumWithoutDisplay: <"The enumerated values to specified the period, e.g. day, week.">
D <"Day">
M <"Month">
Y <"Year">

View File

@@ -0,0 +1,3 @@
enum EnumWithoutDescription:
X displayName "xs"
Y displayName "ys"

View File

@@ -0,0 +1,3 @@
enum Wrong:
A <"asd"> displayName "dsa"
B <"xyz"> displayName "zyx"

View File

@@ -0,0 +1,3 @@
enum Wrong2
A <"asd"> displayName "dsa"
B <"xyz"> displayName "zyx"

View File

@@ -0,0 +1,3 @@
enum Wrong3::
A <"asd"> displayName "dsa"
B <"xyz"> displayName "zyx"

View File

@@ -0,0 +1,6 @@
type Period: <"description">
periodMultiplier int (1..1) <"A time period multiplier, e.g. 1, 2 or 3 etc. A negative value can be used when specifying an offset relative to another date, e.g. -2 days.">
testMany TestType (0..*) <"Test many">
testSome TestSomeType (1..*) <"Test some">
testMaybeOne TestZeroOneType (0..1) <"Test zero or one">
testAll Test (2..15) <"Test all">

View File

@@ -0,0 +1,2 @@
type TestType:
periodMultiplier int (1..1)

View File

@@ -0,0 +1,2 @@
type TestSomeType: <"description">
periodMultiplier int (1..1) <"A time period multiplier, e.g. 1, 2 or 3 etc. A negative value can be used when specifying an offset relative to another date, e.g. -2 days.">

View File

@@ -0,0 +1,2 @@
type TestZeroOneType extends Period:
periodMultiplier int (1..1)

View File

@@ -0,0 +1,2 @@
type WrongCardinality: <"description">
periodMultiplier int (1.1) <"A time period multiplier, e.g. 1, 2 or 3 etc. A negative value can be used when specifying an offset relative to another date, e.g. -2 days.">

View File

@@ -0,0 +1,2 @@
type WrongCardinality2: <"description">
periodMultiplier int (1..a) <"A time period multiplier, e.g. 1, 2 or 3 etc. A negative value can be used when specifying an offset relative to another date, e.g. -2 days.">

View File

@@ -0,0 +1,2 @@
type MissingType: <"description">
periodMultiplier (1.1) <"A time period multiplier, e.g. 1, 2 or 3 etc. A negative value can be used when specifying an offset relative to another date, e.g. -2 days.">

View File

@@ -0,0 +1,12 @@
func EquityPriceObservation: <"Function specification for the observation of an equity price, based on the attributes of the 'EquityValuation' class.">
inputs:
equity Equity (1..1)
valuationDate AdjustableOrRelativeDate (1..1)
valuationTime BusinessCenterTime (0..1)
timeType TimeTypeEnum (0..1)
determinationMethod DeterminationMethodEnum (1..*)
output:
observation ObservationPrimitive (1..1)
assign-output
observation: if asd exists then var2