Ejemplo n.º 1
0
 private void AddGetStackVariable(string name, int startIndex, bool interruptable)
 {
     if (_action.GetVariableOrDefault(name) is VariableInfo actionVariable)
     {
         _instructions.Add(InstructionProvider <GroupState> .GetInstruction(InstructionCode.SPR, new object[] { _action.ActionStackLocation - actionVariable.StackLocation - 1 }, sourcePosition: startIndex, interruptable: interruptable));
     }
     else
     {
         throw new LanguageConstraintException($"Variable '{name}' is not declared.", startIndex);
     }
 }