kozily / admin

Tasks, project documentation and wiki repository
0 stars 0 forks source link

Pattern matching statement kernel implementation #42

Closed smpiano closed 6 years ago

smpiano commented 8 years ago

Description

Implement the kernel syntax for pattern matching statements. This includes the parsing of pattern matching statements (only in kernel syntax), and their execution.

The kernel syntax for the pattern matching statement is as follows:

case <Variable> of <label>(<feature1>:<Var1> ... <featureN>:<VarN>) then <statement1> else <statement2> end

Examples

The application should parse and execute the following example correctly:

Example 1

local X in local Y in local Z in local 
  Y = 30
  X = person(age:Y)
  case X of person(age=Age) then
     Z = Age
  else
    skip
  end
end end end

Tasks