public Void VisitVarParameter(VarParameter ast, FormalParameter arg) { Declaration actualType = ast.Identifier.Visit(this, null); if (!ast.Identifier.IsVariable) { ReportError("parameter is not a variable", ast.Identifier); } else if (arg is VarFormalParameter parameter) { CheckAndReportError(actualType.Equals(parameter.Type), "wrong type for var parameter", ast.Identifier); } else { ReportError("var parameter not expected here", ast.Identifier); } return(null); }
public int VisitVarParameter(VarParameter ast, Frame frame) { EncodeFetchAddress(ast.Identifier, frame); return(Machine.AddressSize); }