Пример #1
0
 void Replace(ref ProgObj obj)
 {
     if (obj is NameObj named)
     {
         var found = Find(named.Name);
         obj = found ?? throw new CompilationError(ErrorType.ObjectIsNotDefined);
     }
     else
     {
         obj.Accept(this);
     }
 }
Пример #2
0
 public Variable(Variable other)
 {
     Name = other.Name;
     Type = other.Type;
 }
Пример #3
0
 public Evaluation(ProgObj expr)
 {
     Expr = expr;
 }
Пример #4
0
 public Assignment(ProgObj left, ProgObj right)
 {
     Left  = left;
     Right = right;
 }
Пример #5
0
 public Parameter(Parameter other)
 {
     Name = other.Name;
     Type = other.Type;
 }
Пример #6
0
 public Parameter(int index, TypeObj type)
 {
     Name = ((char)('a' + index)).ToString();
     Type = type;
 }