public Type GetInstanceType(Expr node, bool isReturnType) { // Special-case void types for return types if (isReturnType && node is TypeExpr && ((TypeExpr)node).type is VoidType) { return ((TypeExpr)node).type; } helper.scope = scope; node.Accept(helper); if (node.computedType.IsCompleteType()) { return node.computedType.InstanceType(); } log.ErrorNotUseableType(node.location, node.computedType); return new ErrorType(); }
private object Evaluate(Expr expr) { return(expr.Accept(this)); }
// Print expression in polish notation public string Print(Expr expr) { return(expr?.Accept(this)); }
public override void Accept(IASTEncoder encoder) { Expr.Accept(encoder); encoder.Encode(this); }
internal override void Accept(ExprVisitor visitor) { visitor.Visit(this); _obj.Accept(visitor); _ifIsError.Accept(visitor); }
object evaluate(Expr expr) { return(expr.Accept(this)); }
public virtual T Visit(Expr e) => e.Accept(this);
public override void GenCode(Expr expr) { expr.Accept(this); }
private void Resolve(Expr expr) => expr.Accept(this);
internal static string Print(Expr expr) { return(expr.Accept(new AstPrinter())); }
public void WriteLine(Expr expr) { writer.WriteLine(expr.Accept <string>(this)); }
private object Resolve(Expr expression) { return(expression.Accept(this)); }