The StaDyn Programming Language
Source code documentation of StaDyn, a hybrid static and dynamic typing language.
PromotionOperation.cs
Go to the documentation of this file.
1 using System.Collections.Generic;
2 using DynVarManagement;
3 using System;
4 using ErrorManagement;
5 namespace TypeSystem.Operations {
10  public enum KindOfPromotion { Simple, Verbose };
11 
12  public abstract class PromotionOperation : TypeSystemOperation {
13 
14  public static PromotionOperation Create(TypeExpression type, MethodType methodAnalyzed, Location location) {
15  return new SimplePromotionOperation(type, methodAnalyzed, location);
16  }
17 
18  public static PromotionOperation Create(TypeExpression type, Enum op, MethodType methodAnalyzed, Location location) {
19 
20  return new VerbosePromotionOperation(type, op, methodAnalyzed, location);
21  }
22 
23  public abstract KindOfPromotion KindOfPromotion {
24  get;
25  }
26  }
27 }
This class encapsulates a location in a specific file. Implements an Inmutable pattern. So it can be used in any context, that is his internal fields never change.
Definition: Location.cs:24
This class represent the entry wnen sending a message to an operation object derived from TypeExpress...
Abstract class that represents all different types.
static PromotionOperation Create(TypeExpression type, MethodType methodAnalyzed, Location location)
static PromotionOperation Create(TypeExpression type, Enum op, MethodType methodAnalyzed, Location location)
Representa a method type.
Definition: MethodType.cs:37
KindOfPromotion
This class implements factory method pattern ( virtual constructor). Role: Factory ...