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
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:
Examples
The application should parse and execute the following example correctly:
Example 1
Tasks