Exemple #1
0
 public Call(Expression left, TypeShim returnType, params Expression[] arguments)
     : base(returnType)
 {
     Left       = left;
     Arguments  = arguments;
     ReturnType = returnType;
 }
Exemple #2
0
 public Member(Expression left, string name, MemberInfo memberInfo, TypeShim type)
     : base(type)
 {
     Left       = left;
     Name       = name;
     MemberInfo = memberInfo;
 }
Exemple #3
0
 public TupleCall(Expression left, TypeShim returnType, Expression argument)
     : base(returnType)
 {
     Left       = left;
     Argument   = argument;
     ReturnType = returnType;
 }
 public ShadowingVariable(Variable shadow, TypeShim type) : base(shadow.Name, shadow.Mutable, type)
 {
     this.Shadow = shadow;
     while (this.Shadow is ShadowingVariable shadowing)
     {
         this.Shadow = shadowing.Shadow;
     }
 }
Exemple #5
0
 public Method(TypeShim returnType, string name, Expression body, Scope scope, params Variable[] parameters)
 {
     Name       = name;
     ReturnType = returnType;
     Parameters = parameters;
     Body       = body;
     Scope      = scope ?? new Scope();
 }
 /// <summary>
 /// Returns the definitions for property names used within the language.
 /// </summary>
 /// <returns></returns>
 protected virtual IEnumerable <GrammerDefinition> PropertyDefinitions()
 {
     return(new[]
     {
         new OperandDefinition(
             name: "PROPERTY_PATH",
             regex: @"(?<![0-9])([A-Za-z_][A-Za-z0-9_]*\.?)+",
             expressionBuilder: (value, parameters) => {
             return value.Split('.').Aggregate((Expression)parameters[0], (exp, prop) =>
             {
                 return Expression.MakeMemberAccess(exp, TypeShim.GetProperty(exp.Type, prop));
             });
         }),
     });
 }
 public Subtract(Expression left, Expression right, TypeShim result) : base(left, right, result)
 {
 }
Exemple #8
0
 public Variable(string name, bool mutable, TypeShim type)
     : base(type)
 {
     Name    = name;
     Mutable = mutable;
 }
Exemple #9
0
 public VariableDeclaration(string name, bool mutable, TypeShim type, Expression assignment = null)
     : base(type)
 {
     Variable   = new Variable(name, mutable, type);
     Assignment = assignment;
 }
 public Remainder(Expression left, Expression right, TypeShim result) : base(left, right, result)
 {
 }
 public Block(Scope scope, TypeShim returnType, params Expression[] statements)
     : base(returnType)
 {
     Statements = statements;
     Scope      = scope ?? new Scope();
 }
Exemple #12
0
 public Parameter(string name, bool mutable, TypeShim type) : base(name, mutable, type)
 {
 }
 public Divide(Expression left, Expression right, TypeShim result) : base(left, right, result)
 {
 }
Exemple #14
0
 public VariableIsTypeTrivia(Variable variable, TypeShim type) : base(variable)
 {
     Type = type;
 }
 public Binary(Expression left, Expression right, TypeShim result)
     : base(result)
 {
     Left  = left;
     Right = right;
 }
Exemple #16
0
 public Constant(object value, TypeShim type)
     : base(type)
 {
     Value = value;
 }
Exemple #17
0
 protected Expression(TypeShim type)
 {
     Trivia = new HashSet <Trivia>();
     Type   = type;
 }
 public DataType(TypeShim type)
     : base(type)
 {
 }
Exemple #19
0
 protected Unary(Expression operand, TypeShim result)
     : base(result)
 {
     Operand = operand;
 }
 public Multiply(Expression left, Expression right, TypeShim result) : base(left, right, result)
 {
 }