Commit a5d153ba authored by Evgeny Kusmenko's avatar Evgeny Kusmenko
Browse files

added if else syntax

parent 894dc73c
......@@ -58,7 +58,7 @@ grammar CNNArch extends de.monticore.CommonExpressions, de.monticore.lang.Math,
Architecture = methodDeclaration:LayerDeclaration*
instructions:(Instruction || ";")+ ";";
Instruction = (LayerVariableDeclaration | NetworkInstruction);
Instruction = (LayerVariableDeclaration | NetworkInstruction | ParameterDeclaration);
LayerVariableDeclaration = "layer" Layer Name;
......
/* (c) https://github.com/MontiCore/monticore */
architecture IfElseNet(){
def input Q(-oo:oo)^{1} x
def output Q(-oo:oo)^{1} prediction
param a;
param b;
if (x<a) {
data->FullyConnected(2)->prediction
} elseif(x<b) {
data->FullyConnected(2)->FullyConnected(2)->prediction
} else {
data -> FullyConnected(2)-> prediction
};
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment