public Call(Expression left, TypeShim returnType, params Expression[] arguments) : base(returnType) { Left = left; Arguments = arguments; ReturnType = returnType; }
public Member(Expression left, string name, MemberInfo memberInfo, TypeShim type) : base(type) { Left = left; Name = name; MemberInfo = memberInfo; }
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; } }
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) { }
public Variable(string name, bool mutable, TypeShim type) : base(type) { Name = name; Mutable = mutable; }
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(); }
public Parameter(string name, bool mutable, TypeShim type) : base(name, mutable, type) { }
public Divide(Expression left, Expression right, TypeShim result) : base(left, right, result) { }
public VariableIsTypeTrivia(Variable variable, TypeShim type) : base(variable) { Type = type; }
public Binary(Expression left, Expression right, TypeShim result) : base(result) { Left = left; Right = right; }
public Constant(object value, TypeShim type) : base(type) { Value = value; }
protected Expression(TypeShim type) { Trivia = new HashSet <Trivia>(); Type = type; }
public DataType(TypeShim type) : base(type) { }
protected Unary(Expression operand, TypeShim result) : base(result) { Operand = operand; }
public Multiply(Expression left, Expression right, TypeShim result) : base(left, right, result) { }